Page 3
Link Quality Indicator Media Access Control Open Systems Interconnection Personal Area Network Physical Layer of the OSI model Radio Frequency RIIM Radiocrafts Industrial IP Mesh RSSI Received Signal Strength Indicator Software Development Kit Serial Peripheral Interface UART Universal Asynchronous Receiver Transmitter...
RIIM SOFTWARE DEVELOPMENT KIT (SDK) RIIM SDK User Manual RIIM Development Kit User Manual RIIM SDK Quick Start Guide RIIM SDK API reference Figure 1. RIIM network – system and documentation overview 2019 Radiocrafts AS Page 3 of 23 RIIM User Manual (rev.1.2)
Introduction This user manual shows how a custom application for wireless sensors or actuators can be quickly and easily developed on the Radiocrafts RIIM (Radiocrafts Industrial IP Mesh). The programming is done by using USER MANUAL RC188x-GPR the Intelligent C-programmable I/O (ICI) concept. ICI presents the user with an event-driven application framework with high-level C APIs that allows the application to interface any sensor/actuator and to implement any data processing and edge intelligence.
Containing the command line tools and scripts. These are described in detail later. Framework/User_API/ Containing the API header files User_Applications/ Your code as well as example code. This is where most users will work. 2019 Radiocrafts AS Page 5 of 23 RIIM User Manual (rev.1.2)
You can also chain events based on other events by defining an event within another event handler. For example, you can start a timer when a GPIO edge triggers. 2019 Radiocrafts AS Page 6 of 23 RIIM User Manual (rev.1.2)
Hopefully you get an idea of how easy it is to define and register a handler for an event. In a little more than 30 lines of actual code you have created a full CoAP and Mesh-enabled ADC sensor. 2019 Radiocrafts AS Page 8 of 23...
Radiocrafts. Figure 3. Workflow using RIIM SDK The development tools runs on both Linux-like systems and Windows. Radiocrafts provides 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.
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 encrypted AKEY=MyKey.key 2019 Radiocrafts AS Page 10 of 23 RIIM User Manual (rev.1.2)
The user application image must be created with the same key This is achieved using the scripts provided with the development environment from Radiocrafts. The example assumes that there exist a key file called encryption.key in the same folder as the application. The following...
Convert an input voltage to its raw ADC value convertToMicroVolts(Channel, Value) Convert an input voltage to a integer representing the input voltage in microvolts Table 2 - ADC functions 2019 Radiocrafts AS Page 12 of 23 RIIM User Manual (rev.1.2)
Generate a response message and send it back to the caller PayloadSize, Response, ResponseSize) send(RequestType, IPAddress, Send a GET, PUT, POST or DELETE message to a CoAP server Resource, Payload, PayloadSize) Table 3 - Coap functions 2019 Radiocrafts AS Page 13 of 23 RIIM User Manual (rev.1.2)
Initialize the Ethernet module. This is automatically called when user starts the Border Router with Network.startBorderRouter, and it is then not necessary to call this. Table 5 - Ethernet functions 2019 Radiocrafts AS Page 14 of 23 RIIM User Manual (rev.1.2)
Set the value on an output GPIO to logical 0 or 1 toggle(Pin) Invert the output value on an GPIO getValue(Pin) Read the value of a GPIO pin Table 6 - GPIO functions 2019 Radiocrafts AS Page 15 of 23 RIIM User Manual (rev.1.2)
SlaveAddress. Data is first written on bus, then read read(SlaveAddress, ReadBuffer, Perform only read on the I2C bus ReadLength) write(SlaveAddress, WriteBuffer, Perform only write on the I2C bus WriteLength) Table 7 - I2C functions 2019 Radiocrafts AS Page 16 of 23 RIIM User Manual (rev.1.2)
Perform a ping to any IP address getNodeType() Return the type of node we are configured as Set Channel(ChannelNumber) Sets the RF channel to use Table 8 - Network functions 2019 Radiocrafts AS Page 17 of 23 RIIM User Manual (rev.1.2)
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...
Transfer bytes over the SPI bus. Reading bytes is implicit, but any of the buffers can be set to NULL to disable reading or writing (disable writing means putting zero on the MOSI line) Table 11 - SPI functions 2019 Radiocrafts AS Page 19 of 23 RIIM User Manual (rev.1.2)
Create a new timer start(TimerID) Start the timer stop(TimerID) Stop the timer isActive(TimerID) Check if the timer is active config(TimerID, TimerMode,Period, (Re)-configure a timer TimerHandler) Table 12 - Timer functions 2019 Radiocrafts AS Page 20 of 23 RIIM User Manual (rev.1.2)
The following example shows how to print something on the console (UART) Example : ICI code static void DemoFunc() Util.printf("Reading sensors..\n"); return; Example 14 - UTIL example code Function Description printf(const char *format,...) Standard C-library printf 2019 Radiocrafts AS Page 21 of 23 RIIM User Manual (rev.1.2)
*format,...) snprintf(char *buffer, size_t buf_size, Standard C-library snprintf USER MANUAL RC188x-GPR const char *format,...) initRand() Start the random generator getRand() Get a random number Table 14 - UTIL functions 2019 Radiocrafts AS Page 22 of 23 RIIM User Manual (rev.1.2)
Radiocrafts AS customers using or selling these products for use in such applications do so at their own risk and agree to fully indemnify Radiocrafts AS for any damages resulting from any improper use or sale.
Need help?
Do you have a question about the RIIM Series and is the answer not in the manual?
Questions and answers