background image

   

 

 

User Manual 

RIIM – Radiocrafts Industrial IP Mesh 

Rev. 1.2 

 

 

Содержание RC1882-IPM

Страница 1: ...User Manual RIIM Radiocrafts Industrial IP Mesh Rev 1 2 ...

Страница 2: ...UAPI 12 8 2 ADC 12 8 3 COAP 13 8 4 DEBUG 14 8 5 ETHERNET 14 8 6 GPIO 15 8 7 I2C 16 8 8 NETWORK 17 8 9 NODE 18 8 10 NVS 18 8 11 SPI 19 8 12 TIMER 20 8 13 UART 21 8 14 UTIL 21 DOCUMENT REVISION HISTORY 23 DISCLAIMER 23 TRADEMARKS 23 LIFE SUPPORT POLICY 23 RADIOCRAFTS SUPPORT 23 CONTACT RADIOCRAFTS 23 Table of Tables Table 1 Makefile variables 10 Table 2 ADC functions 12 Table 3 Coap functions 13 Tab...

Страница 3: ...xample 12 Timer example code 20 Example 13 UART example code 21 Example 14 UTIL example code 21 Abbreviations Abbreviation Description ADC Analog to Digital Converter API Application Programming Interface CoAP Constrained Application Protocol DTLS Datagram Transport Layer Security GPIO General Purpose Input Output I2C Inter Integrated Circuit ICI Intelligent C Programmable I O LQI Link Quality Ind...

Страница 4: ... mesh network As a leaf node it is not able to transport packets to other nodes except its parent This mode uses the least amount of energy o All modes supports customer ICI applications and external connections Applications use the same RIIM Software Development Kit SDK for all node types Below is an illustration of the different elements and the documentation available Figure 1 RIIM network syst...

Страница 5: ...owledge of C programming but no expertise No expertise in wireless networking or device specific knowledge is required The goal of this guide is to reduce the complexity and confusion of embedded wireless to something simple and easy for everybody The guide covers the following topics how to quickly develop your application on ICI the event driven platform how to interface to sensors or actuators ...

Страница 6: ...Do not modify the content unless you know what you are doing Framework Linker o Files used during linking Framework Makefile o Used by the build process Framework Tools o Containing the command line tools and scripts These are described in detail later Framework User_API o Containing the API header files User_Applications o Your code as well as example code This is where most users will work ...

Страница 7: ...uators can be accessed using different interfaces I2C ADC GPIO SPI UART Periodic or one shot timer events can be created Custom actions can be triggered by network commands from the root node Global variables can be used to track internal states Data can be saved to non volatile memory to preserve them across power resets Algorithms can be implemented to process or filter data Underneath ICI silen...

Страница 8: ...ler Sensor_timer_handler static const uint8_t Resource_Name data static uint32_t milliVolts static void ReadSensor ADC convertToMicroVolts ADC0 milliVolts milliVolts 1000 return static void SendCoAP ipAddr RootNodeIPAddr We first check if we are part of a network and the address of the root node if Network getRootNodeAddress RootNodeIPAddr UAPI_OK return CoAP connectToServer RootNodeIPAddr false S...

Страница 9: ...oAP init ResponseHandler Create timer that sends the CoAP PUT message Sensor_timer_handler Timer create PERIODIC TimerPeriod ReadSensor CoAP_timer_handler Timer create PERIODIC TimerPeriod SendCoAP Timer start Sensor_timer_handler Timer start CoAP_timer_handler Start the node Network startLeafNode Return UAPI_OK to indicate setup went well return UAPI_OK Example 1 ADC sensor example Hopefully you ...

Страница 10: ...des a complete development environment with everything that is needed that the user can download for free Please see RIIM SDK Quick Start Guide on how to install the development environment In the following examples Linux is used For windows substitute the sh file ending with bat and dev ttyUSB0 with your associated COM port for example COM3 7 1 Using makefiles The build system is using makefiles ...

Страница 11: ...will be appended to the filename PORT Which serial port to use In windows this will be COM1 COM2 and in linux it will be dev ttyUSB0 dev ttyUSB1 AKEY Filename for the application encryption key NKEY Filename for the network encryption key Framework_Path The relative path to the framework Table 1 Makefile variables The variables can be overridden as in these examples make uploadImage PORT COM3 make...

Страница 12: ...ame folder as the application The following sequence must be followed make encrypted make uploadAppKey USER MUST RESET THE MODULE make uploadImage 7 4 Locking the module Locking the module means that no one can upload unencrypted images to the module anymore This feature helps protect the application and is NOT reversible It may be feasible to not lock the module if the user is actively developing...

Страница 13: ... an example usage where the ADC is initialized read and the value is converted to millivolts and printed on the console Example ICI code static uint32_t milliVolts void ADC_DemoFunc milliVolts 0 Set up interface ADC init ADC0 ADC_FIXED_REFERENCE ADC_SAMPLING_DURATION_10_6_US ADC convertToMicroVolts ADC0 milliVolts milliVolts 1000 Print directly to console to show the latest values Util printf ADC ...

Страница 14: ...ine for readability in console return void ResponseHandler const uint8_t payload uint8_t payload_size Util printf Got CoAP Response Doing nothing with it n return RIIM_SETUP Network startBorderRouter NULL NULL NULL NULL Setup coap resource CoAP init ResponseHandler CoAP registerResource Resource_Name 1 CoAP_Handler return UAPI_OK Example 3 CoAP example code The following functions are part of the ...

Страница 15: ...Setup Print the current node setup on the UART printIPAddr IPAddr Nicely print IPAddr Table 4 Debug functions 8 5 Ethernet The Ethernet module contains functions for the Ethernet physical connection The following example shows how to initialize the Ethernet controller However this is normally not necessary as the Ethernet module is automatically initialized if the node is configured as a Border Ro...

Страница 16: ...GPIO_9 HIGH return UAPI_OK Example 6 GPIO example code The following functions are part of the GPIO module Function Description Init Initialize the GPIO module setDirection Pin Direction Set the GPIO direction to input or output setPull Pin Pull Set pullup pulldown or no pull on an input pin setHandler Pin InterruptEdge Handler Register a handler to be called when a specific transition happen on a...

Страница 17: ...ibility measuring with clock stretching enabled See Sensirion SHT35 datasheet wbuf 0 0x2C wbuf 1 0x0D I2C transfer 0x44 wbuf 2 rbuf 7 RIIM_SETUP Set up interface towards the SHT35 sensor I2C init I2C_400KHZ return UAPI_OK Example 7 I2C example code The following functions are part of the I2C module Function Description init Speed Initializes the I2C driver with the chosen Speed transfer SlaveAddre...

Страница 18: ... outside world startRouterNode Start the node as a Router This means that the node is capable of routing packets through itself startLeafNode Start the node as a Leaf This means that the node is NOT capabe of forwarding packets to other nodes but will use less energy getRootNodeAddress IPAddress This function returns the address of the WSN root node It will only do so if the node is part of a WSN ...

Страница 19: ...sion Table 9 Node functions 8 10 NVS The NVS module contains functions for accessing the non volatile memory This must be used with caution as it is possible to erase or corrupt the module firmware If that happens it may need to be reprogrammed at Radiocrafts Example TBD Example ICI code static void DemoFunc const uint8_t buffer 1234567890 NVS eraseSector 0x00001000 NVS write 0x00001000 10 buffer ...

Страница 20: ...IO setValue GPIO_3 HIGH Set up interface towards the LIS3DE sensor SPI init 4000000 SPI_POL_0_PHA_0 Setup accelerometer to update every second uint8_t wbuf 2 wbuf 0 0x20 0 write 0 do not increment 0x20 register address wbuf 1 0x17 1 Hz enable X Y and Z axes GPIO setValue GPIO_3 LOW SPI transfer 2 wbuf NULL GPIO setValue GPIO_3 HIGH return UAPI_OK Example 11 SPI example code The following functions...

Страница 21: ...ic const uint32_t TimerPeriod 10 static uint8_t Sensor_timer_handler static void ReadSensor Util printf Reading sensors n return RIIM_SETUP Create timer that sends the CoAP PUT message Sensor_timer_handler Timer create PERIODIC TimerPeriod ReadSensor Timer start Sensor_timer_handler return UAPI_OK Example 12 Timer example code Function Description create TimerMode Period Handler Create a new timer...

Страница 22: ...nitialize the UART module Baudrate Parity Databits and Stopbits must be specified startReceive UARTReceiveCallback Start reception and call a function when cancelReceive Stop reception startTransmit Buffer Length UARTTransmitCallback Start transmission of a buffer of bytes cancelTransmit Stop transmission even if it not finished Table 13 UART functions 8 14 UTIL The UTIL module contains useful hel...

Страница 23: ...l rev 1 2 Page 22 of 23 sprintf char buffer const char format Standard C library sprintf snprintf char buffer size_t buf_size const char format Standard C library snprintf initRand Start the random generator getRand Get a random number Table 14 UTIL functions ...

Страница 24: ...es host communication data buffering error check addressing and broadcasting It supports point to point point to multipoint and peer to peer network topologies RIIM is a trademark of Radiocrafts AS All other trademarks registered trademarks and product names are the sole property of their respective owners Life Support Policy This Radiocrafts product is not designed for use in life support applian...

Отзывы: