Skip to content

Commit df41fe5

Browse files
committed
Add Testing section and fix formatting of Boost file
1 parent e05f421 commit df41fe5

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

doc/Example of Cross Compiling the Azure IoT SDK for Python.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ Other required software:
2929
- g++ – the C++ compiler
3030
- cmake – application used to generate build files
3131
- git – used to clone repositories from GitHub.com
32-
- curl - library is referenced by the SDK
33-
- openssl - libraries are referenced by the SDK
3432

3533
Install these packages with:
3634
```
3735
sudo apt-get install cmake git build-essential curl libcurl4-openssl-dev libssl-dev uuid-dev
3836
```
37+
Your toolchain will also need to include the developer versions of OpenSSL, curl, and uuid.
3938
### Editing Files
4039

4140
You will need to create two files and modify one file during the course of this procedure. If you are using Ubuntu, then the simplest editor to use is nano. For example, if you wish to create a new file in your current directory simply type:
@@ -195,7 +194,7 @@ SET (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
195194
196195
SET (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
197196
```
198-
<div style="text-align: center; font-size: smaller">Figure 2: CMake toolchain file</div>
197+
Figure 2: CMake toolchain file
199198

200199
Create a second file called _mlinuxenv.sh_ and into it enter the following:
201200
```bash
@@ -207,21 +206,28 @@ export PATH=${ML_HOSTTOOLS}/bin:${ML_HOSTTOOLS}/bin/arm-mlinux-linux-gnueabi:$PA
207206

208207
cmake -DCMAKE_INSTALL_PREFIX=~/mlinux-out -DCMAKE_TOOLCHAIN_FILE=../build_all/linux/toolchain-mlinux.cmake ..
209208
```
210-
<div style="text-align: center; font-size: smaller">Figure 3: Build Generator Script</div>
209+
Figure 3: Build Generator Script
211210

212211
Having created the two files, we are now ready to build the SDK. Enter the following commands:
213-
```
212+
```bash
214213
chmod a+x mlinuxenv.sh
215214
cd ../../cmake
216215
../build_all/linux/mlinuxenv.sh
217216
make install
218217
```
219218
This will build the SDK and create the Python library. To check that the binary Python library has been built correctly enter:
220-
```
219+
```bash
221220
file ~/mlinux-out/lib/*.so
222221
```
223222
This should result in two lines of output, one for _iothub\_client.so_ and one for _iothub\_service\_client.so_. The details should say that they are _ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked_ which is the appropriate architecture for your target machine.
224223

224+
## Testing Your Binaries
225+
You simply need to copy the appropriate .so file found in the last step to your device. If your device is intended to send device to cloud messages then you will need to copy _iothub\_client.so_ to your device. If you wish to send cloud to device messages or view and manipulate the device registry then you will need to copy _iothub\_service\_client.so_ to your device.
226+
227+
There are sample Python scripts in the Azure IoT SDK. The device versions can be found at _\<Root of SDK\>/device/samples_ and the service versions at _\<Root of SDK\>/service/samples_.
228+
229+
One caveat that one should be aware of, one may occasionally encounter Python builds that **do not support** binary imports.
230+
225231
## Conclusion
226232

227233
This document has described the procedure to cross compile the Azure IoT SDK binary Python library targeting a MultiTech device.

0 commit comments

Comments
 (0)