Difference between revisions of "MCU/WISE-1540 SDK"
Line 116: | Line 116: | ||
<div style="margin-left:0.847cm;margin-right:0cm;"> | <div style="margin-left:0.847cm;margin-right:0cm;"> | ||
We provide the console and the user can set parameters for connectivity by command set we supported. | We provide the console and the user can set parameters for connectivity by command set we supported. | ||
− | </div> | + | </div><br/> |
− | |||
== ARM mbed == | == ARM mbed == | ||
<div style="margin-left:0.847cm;margin-right:0cm;"> | <div style="margin-left:0.847cm;margin-right:0cm;"> | ||
Line 226: | Line 225: | ||
[[File:Wise1540 programming through ed20 10.png|center|Wise1540 programming through ed20 10.png]] | [[File:Wise1540 programming through ed20 10.png|center|Wise1540 programming through ed20 10.png]] | ||
</div> | </div> | ||
− | |||
= Example = | = Example = |
Revision as of 09:05, 8 September 2017
Contents
Introduction
Glossary
- Gateway
- The gateway like WISE-3310 has connectivity with SmartMesh IP manager responsible for communication with WISE-1540.
- Mote
- The mote is WISE-1540 that has connectivity with SmartMesh IP mote responsible for communication with gateway.
WISE-1540 Software Development Kit (SDK)
Source Tree
Directory | Description |
doc/ | Documents about WISE-1540 SDK. |
inc/ | Header files including examples, sensor driver and etc. |
lib/ | Library. |
src/ | Source files including examples, sensor driver and etc. |
Setup Development Environment
Preparing for Hardware
- For mote, WISE-1540, WISE-1500 and WISE-ED20 or WISE-ED22.
- For gateway, WISE-3310.
- PC running LINUX operating systems such as Ubuntu 16.04.1.
Please refer to the following steps for setup a WISE series of boards before using WISE-1540 SDK.
②WISE-1500
③WISE-ED20
④SW2 on WISE-ED20
- Please check pin1 and pin2 to “ON” as default.
- Switch pin1 to “ON”: flash programming, “OFF”: boot from flash.
⑤CN2 on WISE-1500
- Booting into the mode of network connection when both 3.3V and GPIO0 are opened.
- Booting into the mode of console of API when both 3.3V and GPIO0 are shorted.
⑥SW3 on WISE-1500
- Please check pin1 and pin2 to “OFF” as default.
- Switch pin2 to decide whether running “backup to default” while device booting. “ON”: enabled, “OFF”: disabled.
⑦One reset button on WISE-1500 and the other on WISE-ED20
⑧Micro USB connector
- Power supplies for UART3 debug port.
⑨Com port
- No supported.
Setting for Connectivity
WISE-1540 is designed in connectivity for wireless IoT communication with Linear Dust SmartMesh IP wireless sensor networks. The Linear Dust networks support a self-forming and self-healing mesh network solution complaint to 6LoWPAN Internet Protocol (IP) and IEEE802.15.4e standard. Before using WISE-1540 SDK, the user needs to check or set some parameters through the console for API.
Information and Parameters Setting
The user needs to double check connectivity setting the same as below table with SmartMesh IP networks before using WISE-1540 SDK:
Parameter | Expected Setting |
Network ID | 2001 (The same as manager on WISE-3310) |
Join Key | 4A4F494E414456414E54454348494F54 (The same as manager on WISE-3310) |
Auto Join | On |
Reset to default setting
This function can be used back to default setting the same as above section "Information and Parameters Setting".
Console for API
We provide the console and the user can set parameters for connectivity by command set we supported.
ARM mbed
The ARM mbed is IoT device platform and it has a lot of resources for IoT development. We supported ARM mbed OS on WISE-1540 to make user easily to get started and obtain great benefit from ARM mbed.
mbed CLI
The mbed CLI is command-line tool. The user needs to setup CLI for WISE-1540 SDK. Please refer to below link for information about how to setup CLI.
Flash Programming
Programming through WISE-ED22
Please refer to WISE-ED22 for flash programming.
Programming through WISE-ED20
Running Flash Loader Installer
Step01: Find installer flash_loader_demo_v2.9.0RC1.exe” in source tree, run it to install tool and set installation directory to default as below.
Step02: Installation process.
Step03: Finish installation.
Programming
Step01 Set into programming mode.
Please check pin1 of SW2 to “ON” on WISE-ED20 for flash programming.
Step02: Launch Flash Loader and select Port name "COMx" detected from your PC.
Step03: Check device if get response from it.
Step04: Select target as below for programming.
Step05: Enable option "Global Erase" and programming for binary from the path you specified.
Step06: Programming in progress.
Step07: Check the process of programming is done and successful.
Step08 Set into boot mode.
Please check pin1 of SW2 to “OFF” on WISE-ED20.
Step09: Boot from flash.
Press reset button and you can see snapshot like as below.
Example
There are two examples in WISE-1540 SDK. One is “Send Data” the user can refer to it for how to use connectivity to send data from mote to gateway. The other is “Exchange Data with Sensor Format” the user can refer to it for how to add sensor in mote and send data accessed from sensor to WISE-PaaS through mote and gateway.
Compile example
Send Data
This example is demonstrated how we could send data from mote to gateway. The user needs to run two programs synchronously that one is on WISE-1540 and the other is on gateway. In example it communicates with gateway using API in “mote_api.h” that can found located at folder “inc\wsn\sm_ipmt” of source tree of WISE-1540 SDK. The API has been implemented based on SmartMesh IP Mote API Guide and the user can refer to it for getting detailed if needed.
Please refer to the following to run example between mote and gateway:
Running example on Gateway
Step01: Get IoT Gateway SDK and Setup on PC.
The IoT Gateway SDK is not provided as default and the user needs contact with Advantech to get it.
Step02: Compile example.
① Set environment variable for compilation.
PC # cd /opt/poky/1.5.3/
PC # source ./environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
② The example “wise1021_senddata_gw.tar.bz2” is located in folder “src\sample” of source tree of WISE-1540 SDK. Please extract wise1021_senddata_gw.tar.bz2 to PC.
PC # tar jxvf wise1021_senddata_gw.tar.bz.
③ Compile and output binary.
PC # cd wise1021_senddata_gw/
PC # make clean
PC # make
PC # ls ipmg/
Step03: Upload binary to WISE-3310.
The following commands are for the user reference. These commands are demonstrated how the PC’s file system can be mounted through NFS on WISE-3310 and then the user can copy binary to WISE-3310 using command “cp”.
WISE-3310 # mount -t nfs -o nolock 172.22.12.223:/tmp /mnt/
WISE-3310 # cp /mnt/wise1021_senddata_gw/ipmg/wise1021_receive_sample /tmp
Step04: Begin execution.
The user can see snapshot as below while getting data from mote
WISE-3310 # /tmp/ipmg/wise1021_receive_sample /dev/ttyUSB0
Running example on WISE-1540
Step01: Compile example and programming.
Step02: Check status with LED.
Exchange Data with Sensor Format
This example is demonstrated how it could exchange data with sensor format between mote and gateway. The sensor format defined by Advantech combines IPSO data format with CoAP like protocol. By implementation the user needs to study “WISE sensor API” to know how to add sensor by self. In example it adds fake temperature sensor with sensor format and exchanges data between mote and gateway. Finally the fake temperature will be transfer to WISE-PaaS and it is presented by UI on browser, but WISE-PaaS has no more detailed in this document. Please get contact about WISE-PaaS detailed with Advantech if needed.
How to Handle Data between Mote and Gateway
Based on sensor format, the brief in bidirectional explain how it has been implemented in example as below:
From mote to gateway:
① The data accessed from sensor are encoded as packet with sensor format by mote.
② The packet is sent from mote to gateway.
③ The packet is received and decoded by gateway and then the received information will be transfer to WISE-PaaS.
From gateway to mote :
① The data and command are encoded as packet by gateway.
② The packet is sent from gateway to mote.
③ The packet is received and decoded by mote.
④ Depend on command/data received from gateway, the information about WISE-1540 and sensor data in real time are encoded by mote and send it back to gateway.
Running Example
Please refer to the following to run example between mote and gateway:
Running example on Gateway
There is nothing to do. This example is supported as default on WISE-3310.
Running example on WISE-1540
Step01: Compile example and programming.
Please refer to link for how to do.
Step02: Check status on terminal.
①
②
③ Compile.
Appendix
References
Liner Dust
About SmartMesh IP Networks: