This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
app-notes:cumulocity-agent [2017/02/10 13:10] krepel [Add the Cumulocity agent to the SDK] |
app-notes:cumulocity-agent [2021/08/04 09:20] (current) |
||
---|---|---|---|
Line 5: | Line 5: | ||
<code bash> | <code bash> | ||
#For PowerPC: | #For PowerPC: | ||
- | wget ftp://share.netmodule.com/router/public/toolchain/netbox-ppc/toolchain-ppc-4.8-linaro-x86_64.tar.bz2 | + | wget https://share.netmodule.com/router/public/toolchain/netbox-ppc/toolchain-ppc-4.8-linaro-x86_64.tar.bz2 |
mkdir /opt/toolchain | mkdir /opt/toolchain | ||
tar -xvf toolchain-ppc-4.8-linaro-x86_64.tar.bz2 -C /opt/toolchain | tar -xvf toolchain-ppc-4.8-linaro-x86_64.tar.bz2 -C /opt/toolchain | ||
Line 66: | Line 66: | ||
scp c8yAgent.conf <user>@<host>:/etc/c8yAgent.conf | scp c8yAgent.conf <user>@<host>:/etc/c8yAgent.conf | ||
</code> | </code> | ||
- | ==== You have to take some changes to the SDK ==== | + | ==== You have to take some changes to the cumulocity SDK ==== |
We have to do this, because the toolchain don't support the function **to_string()**. | We have to do this, because the toolchain don't support the function **to_string()**. | ||
include myString.h in the follow files: | include myString.h in the follow files: | ||
Line 86: | Line 86: | ||
* src/srnetsocket.cc ---> #include <errno.h> | * src/srnetsocket.cc ---> #include <errno.h> | ||
==== Build the agent ==== | ==== Build the agent ==== | ||
- | Now we can build the agent for the target device. | + | Now we can build the cumulocity SDK for NetModule Agent within the SDK directory. |
<code bash> | <code bash> | ||
export STAGING_DIR=/opt/toolchain | export STAGING_DIR=/opt/toolchain | ||
Line 95: | Line 95: | ||
make | make | ||
</code> | </code> | ||
- | Now go to the **src** folder. | + | Now go to the **src** folder to build NetModule Agent. |
<code bash> | <code bash> | ||
make | make | ||
</code> | </code> | ||
- | If all this steps was successful, then we can move the files to the router. We need the **src/main** ans the **srtemplate.txt**. With **scp** we can move it to the router. | + | If all this steps was successful, then we can move the files to the router. We need the **src/main** and the **srtemplate.txt**. With **scp** we can move it to the router. |
<code bash> | <code bash> | ||
- | scp main user@host:directory/main | + | scp main <user>@<host>:<directory>/main |
</code> | </code> | ||
No we can make a SSH connection to the router and start the agent. | No we can make a SSH connection to the router and start the agent. |