Difference between revisions of "WISE-3610 LoRa Gateway"

From ESS-WIKI
Jump to: navigation, search
Line 58: Line 58:
 
== How to enable all log with mbed-client example ==
 
== How to enable all log with mbed-client example ==
 
<pre> add_definitions(-DMBED_CONF_MBED_TRACE_ENABLE=1)  in define.txt</pre>
 
<pre> add_definitions(-DMBED_CONF_MBED_TRACE_ENABLE=1)  in define.txt</pre>
 +
 +
 +
 +
How to build mbed-client on x86 Ubuntu 16.04
 +
 +
depend on: cmake 3.5.1 &nbsp; python 2.7.12
 +
 +
unzip&nbsp;mbed-cloud-client-1.1-Linux-example-master.zip
 +
 +
# Modify define.txt & autogen.cmake to meet your environment
 +
 +
# Replace files which are in Patch folder<br/>&nbsp;&nbsp; &nbsp;define.txt&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;to mbed-cloud-client-1.1-Linux-example/mbed-cloud-client-example-ref/<br/>&nbsp;&nbsp; &nbsp;autogen.cmake&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;to mbed-cloud-client-1.1-Linux-example/mbed-cloud-client-example-ref/pal-platform &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=> x86 do not replace<br/>&nbsp;&nbsp; &nbsp;identity_dev_security.c&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;to mbed-cloud-client-1.1-Linux-example/mbed-cloud-client-example-ref/mbed-cloud-client-example
 +
 +
# Generate makefiles
 +
 +
&nbsp; &nbsp;cd &nbsp;mbed-cloud-client-1.1-Linux-example/mbed-cloud-client-example-ref/)<br/>&nbsp;&nbsp; &nbsp;cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DEXTARNAL_DEFINE_FILE=define.txt
 +
 +
# Build
 +
 +
&nbsp; &nbsp;make
 +
 +
# Execute 'mbedCloudClientExample.elf' application in&nbsp;./Debug or ./Release &nbsp;

Revision as of 07:14, 12 April 2017

ADF Demo 

How to build mbed client sample and copy to target board

sudo docker exec -it lora bash

cd /home/adv/work/build_env/LoRaSDK/WISE-3610_SDK_20170405_0f7f137

export ARMGCC_DIR=`pwd`/qsdk/staging_dir/toolchain-arm_cortex-a7_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/

cd qsdk/

make package/mbed/clean package/mbed/prepare package/mbed/compile V=s -j 8

scp eric@172.22.12.213:/home/eric/Work/LoRa/Docker/build_env/LoRaSDK/WISE-3610_SDK_20170405_0f7f137/qsdk/build_dir/target-arm_cortex-a7_uClibc-0.9.33.2_eabi/mbed/mbed-cloud-client-1.1-Linux-example-master/mbed-cloud-client-example-ref/Debug/mbedCloudClientExample.elf .


Ubuntu 16.04 x64 Docker Image ( for building LoRa SDK )

sudo docker run -it -name rora_dev -v $PWD:/home/adv/work/ [https://hub.docker.com/u/advwiseec/dashboard/ advwiseec]/[https://hub.docker.com/r/advwiseec/lorasdk_openwrt/ lorasdk_openwrt]


Add static route and DNS server on LoRa Gateway

route del default
route add -net 0.0.0.0 gw 172.22.15.130 netmask 0.0.0.0 dev br-lan
route add -net 172.16.0.0 gw 172.22.15.254 netmask 255.240.0.0 dev br-lan
echo "nameserver 8.8.8.8" >> /etc/resolv.conf


mbed-client sample with mosquitto library

Add link library of LoRaSDK\WISE-3610_SDK_20170405_0f7f137\qsdk\package\network\utils\mbed\mbed-cloud-client-1.1-Linux-example-master\mbed-cloud-client-example-ref\CMakeLists.txt

target_link_libraries (${TEST_LIB}.elf  ${SRC_LIBS})

target_link_libraries (${TEST_LIB}.elf  mosquitto)

Add depends of V:\Work\LoRa\Docker\build_env\LoRaSDK\WISE-3610_SDK_20170405_0f7f137\qsdk\package\network\utils\mbed\Makefile

DEPENDS += +libpthread +libstdcpp +librt +libmosquitto


How to modify mbed-client source code and build

unzip mbed-cloud-client-1.1-Linux-example-master.zip

modify

\LoRaSDK\WISE-3610_SDK_20170405_0f7f137\qsdk\package\network\utils\mbed\mbed-cloud-client-1.1-Linux-example-master\mbed-cloud-client-example-ref\mbed-cloud-client-example\main.cpp

zip mbed-cloud-client-1.1-Linux-example-master.zip ./mbed-cloud-client-1.1-Linux-example-master

cd qsdk/

make package/mbed/clean package/mbed/prepare package/mbed/compile V=s -j 8


How to enable all log with mbed-client example

 add_definitions(-DMBED_CONF_MBED_TRACE_ENABLE=1)  in define.txt


How to build mbed-client on x86 Ubuntu 16.04

depend on: cmake 3.5.1   python 2.7.12

unzip mbed-cloud-client-1.1-Linux-example-master.zip

  1. Modify define.txt & autogen.cmake to meet your environment
  1. Replace files which are in Patch folder
        define.txt                    to mbed-cloud-client-1.1-Linux-example/mbed-cloud-client-example-ref/
        autogen.cmake                to mbed-cloud-client-1.1-Linux-example/mbed-cloud-client-example-ref/pal-platform          => x86 do not replace
        identity_dev_security.c        to mbed-cloud-client-1.1-Linux-example/mbed-cloud-client-example-ref/mbed-cloud-client-example
  1. Generate makefiles

   cd  mbed-cloud-client-1.1-Linux-example/mbed-cloud-client-example-ref/)
    cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DEXTARNAL_DEFINE_FILE=define.txt

  1. Build

   make

  1. Execute 'mbedCloudClientExample.elf' application in ./Debug or ./Release