getting started with fp-sns-6lpnode1 software for iot sensor … · • complete firmware to...

26
Description FP-SNS-6LPNODE1 is an STM32Cube function pack which lets you connect your IoT node to a 6LoWPAN Wireless Sensor Network and expose the sensor and actuator resources using standard application layer protocols. This software together with the suggested combination of STM32 and ST devices can be used, for example, to develop smart home, building or lighting applications. The package contains sample applications to implement sensor data reading and LED control from a local or a remote device on the Internet. The software runs on the STM32 microcontroller and includes drivers for the S2-LP Sub-1 GHz RF radio, the SPIRIT1-based sub-1 GHz RF communication modules (SPSGRF-868 and SPSGRF-915), as well as the motion, environmental, and time-of- flight sensors. Getting started with FP-SNS-6LPNODE1 software for IoT sensor node connection to 6LoWPAN networks using sub-1GHz RF UM2100 User manual UM2100 - Rev 4 - April 2019 For further information contact your local STMicroelectronics sales office. www.st.com

Upload: others

Post on 21-Jun-2020

21 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

DescriptionFP-SNS-6LPNODE1 is an STM32Cube function pack which lets you connect your IoT node to a 6LoWPAN Wireless SensorNetwork and expose the sensor and actuator resources using standard application layer protocols.

This software together with the suggested combination of STM32 and ST devices can be used, for example, to develop smarthome, building or lighting applications. The package contains sample applications to implement sensor data reading and LEDcontrol from a local or a remote device on the Internet.

The software runs on the STM32 microcontroller and includes drivers for the S2-LP Sub-1 GHz RF radio, the SPIRIT1-basedsub-1 GHz RF communication modules (SPSGRF-868 and SPSGRF-915), as well as the motion, environmental, and time-of-flight sensors.

Getting started with FP-SNS-6LPNODE1 software for IoT sensor node connection to 6LoWPAN networks using sub-1GHz RF

UM2100

User manual

UM2100 - Rev 4 - April 2019For further information contact your local STMicroelectronics sales office.

www.st.com

Page 2: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

1 Acronyms and abbreviations

Table 1. List of acronyms

Acronym Description

IDE Integrated development environment

BSP Board support package

HAL Hardware abstraction layer

UDP User datagram protocol

6LoWPAN IPv6 over low power wireless personal area networks

RPL Routing protocol for low power and lossy networks

MCU Microcontroller unit

RF Radio frequency

OS Operative system

CoAP Constrained application protocol

LWM2M Lightweight machine to machine

IoT Internet of things

IPSO IP for smart objects

MEMS Micro electro-mechanical systems

Wi-Fi Wireless LAN based on IEEE 802.11

GUI Graphical user interface

UM2100Acronyms and abbreviations

UM2100 - Rev 4 page 2/26

Page 3: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

2 FP-SNS-6LPNODE1 software package

2.1 OverviewFP-SNS-6LPNODE1 is a software package which expands the functionality of STM32Cube.The key features of the package are:

• Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, usingsub-1GHz RF communication technology

• Middleware library with Contiki OS and Contiki 6LoWPAN protocol stack 3.0• Support for mesh networking technology through the standard RPL protocol• IPSO Smart Object data representation of the node resources (sensors and actuators) with the OMA

Lightweight M2M (LWM2M) standard• Sample implementation available for X-NUCLEO-S2868A1, X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5

boards, X-NUCLEO-IKS01A1 or X-NUCLEO-IKS01A2, and X-NUCLEO-6180X1 sensor boards, whenconnected to a NUCLEO-F401RE or a NUCLEO-L152RE board

• Easy portability across different MCU families, thanks to STM32Cube• Free, user-friendly license terms

This software uses Contiki OS to develop applications that can connect our node to a 6LoWPAN network.Communication in the 6LoWPAN network is handled by the S2-LP sub-1GHz RF transceiver (on an X-NUCLEO-S2868A1 expansion board) or SPIRIT1 sub-1GHz RF transceiver (on an X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5 expansion board) . Sensor data from motion and environmental sensors boards (X-NUCLEO-IKS01A1or X-NUCLEO-IKS01A2) and proximity sensor, gesture and ALS sensor board (X-NUCLEO-6180XA1) can beaccessed from a remote device via RESTful transactions (HTTP or CoAP protocol).The software enables the exposure of sensor and actuator resources on the node with standard routines basedon the OMA Lightweight M2M (LWM2M) specification, through an object model implemented according to theIPSO Smart Object Guidelines (see http://www.ipso-alliance.org/ipso-community/resources/smart-objects-interoperability/).Technical details on the Contiki OS/6LoWPAN stack can be found at https://github.com/contiki-os/contiki/wiki, inthe Internals section of the wiki.Information regarding Contiki APIs is available in the doxygen documentation in the FP-SNS-6LPNODE1package.

2.2 ArchitectureThis software is based on the STM32CubeHAL hardware abstraction layer for the STM32 microcontroller. itextends STM32Cube by providing a board support package (BSP) for the sub-1GHz RF communicationexpansion boards, the environmental and motion MEMS sensors expansion board, and for the proximity, rangingand light sensing sensors expansion board. The drivers abstract low-level details of the hardware and allow themiddleware components and applications to access sensor data in a hardware-independent manner, and toaccess and control the S2-LP sub-1GHz RF radio and the SPIRIT1-based sub-1GHz RF communication modules(SPSGRF-868 or SPSGRF-915).The software layers used by the application software to access and use the X-NUCLEO expansion boards are thefollowing:STM32Cube HAL layer: consists of a simple, generic and multi-instance set of APIs (application programminginterfaces) to interact with the upper application, library and stack layers. These generic and extension APIs aredirectly built around a generic architecture and allows layers like the middleware layer built on top of them toimplement their functions without requiring specific hardware configuration information for given microcontrollerunits (MCU). This structure improves library code reusability and guarantees easy portability across otherdevices.Board support package (BSP) layer: supports the peripherals on the STM32 Nucleo board, except the MCU.This limited set of APIs provides a programming interface for certain board specific peripherals like the LED anduser button. This interface also helps in identifying the specific board version.

UM2100FP-SNS-6LPNODE1 software package

UM2100 - Rev 4 page 3/26

Page 4: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Figure 1. FP-SNS-6LPNODE1 software architecture

2.3 Folder structure

Figure 2. FP- SNS-6LPNODE1 package folder structure

The folders in the software package are:• Documentation: with a compiled HTML file generated from the source code, which details the software

components and APIs.• Drivers: the HAL drivers, the board-specific drivers for each supported board or hardware platform

(including those for the onboard components) and the CMSIS vendor-independent hardware abstractionlayer for the Cortex-M processor series.

• Middlewares: contains the full porting of the Contiki OS for the STM32 platform. The ST subfolder containsSTM32-specific files to configure both the Contiki OS and the SPIRIT1 radio, while the Third_Party foldercontains Contiki source files.

• Projects: contains several example applications that implement application-level functions to expose thenode sensor and actuator resources through the LWM2M standard using the data model described in theIPSO Smart Object Guidelines. The projects are provided for the NUCLEO-F401RE and NUCLEO-L152RE

UM2100Folder structure

UM2100 - Rev 4 page 4/26

Page 5: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

platforms under the IAR Embedded Workbench for ARM, RealView Microcontroller Development Kit (MDK-ARM), and System Workbench for STM32 (SW4STM32) development environments.

2.4 APIsDetailed user API function and parameter descriptions are available in a compiled HTML file in the packageDocumentation folder.

UM2100APIs

UM2100 - Rev 4 page 5/26

Page 6: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

2.5 End-to-end system description and setup

2.5.1 End-to-end system overviewIn a typical end-to-end deployment scenario, a node runs a lightweight embedded web server that enables accessfrom a remote system to the hosted resources representing the physical sensors and actuators on the nodeboard. Resources can be accessed via RESTful transactions, which is performed with the CoAP applicationprotocol in the context of constrained resource environments.

2.5.2 End-to-end connectivity scenario using a 6LoWPAN-to-WiFi bridge and remote applicationserverIn this scenario, a 6LoWPAN-to-WiFi bridge forwards the traffic between the 6LoWPAN and Wi-Fi networks,allowing connectivity between a node in the 6LoWPAN network and an application server on the Internet.An implementation of the 6LoWPAN-to-WiFi bridge can be performed with the FP-NET-6LPWIFI1 softwarepackage (STM32Cube function pack) running on a NUCLEO-F401RE or a NUCLEO-L152RE equipped with an X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5 sub-1GHz RF expansion board, and an X-NUCLEO-IDW01M1 Wi-Fiexpansion board.Alternatively, an implementation of the 6LoWPAN-to-WiFi bridge can be made by using a B-L475E-IOT01ADiscovery board, equipped with an X-NUCLEO-S2868A1 sub-1GHz RF expansion board based on S2-LP radio.The FP-NET-6LPWIFI1 software package (STM32Cube function pack) implementing a 6LoWPAN-to-Wi-Fi bridgeis available at www.st.com/stm32ode-fp.

Figure 3. End-to-end connectivity using a 6LoWPAN-WiFi bridge

For details explaining how to set up the 6LoWPAN-to-Wifi bridge and to establish the connection with a publicapplication server implementing the OMA Lightweight M2M (LWM2M) standard, see Reference [1]. This servercan be used for evaluation purposes.

2.5.3 End-to-end connectivity scenario using an IPv6 host PC and local application serverIn this scenario, a 6LoWPAN border router is connected to a PC (IPv6 host). The wireless sensor node isconnected to a 6LoWPAN border router that sends and receives IPv6 packets to and from the host PC. In oursample implementation, the border router system runs on an STM32 Nucleo board connected to the PC through aUSB serial link.The application server could run on the internet or on the local PC itself, but we will assume a local applicationserver implementation for the sake of simplicity.

UM2100End-to-end system description and setup

UM2100 - Rev 4 page 6/26

Page 7: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Figure 4. End-to-end connectivity scenario using a host PC

See reference [2], section 2.5, for a detailed description of the IPv6 host and 6LoWPAN border router setup.

2.5.4 LWM2M application server (Leshan)The system has been tested with the Leshan Java based open source implementation of the OMA LightweightM2M server. Leshan runs on a public Internet-connected server (as shown in Figure 3. End-to-end connectivityusing a 6LoWPAN-WiFi bridge ) and can be used for evaluation purposes, alternatively it can be installed on alocal host, as shown in Figure 4. End-to-end connectivity scenario using a host PC.Refer to http://www.eclipse.org/leshan/, for information on setting up the Leshan server on the host PC. TheREADME file in the GitHub repository of the Leshan project at https://github.com/eclipse/leshan also containsinstallation information.

2.5.5 Wireless sensor node applicationsThe FP-SNS-6LPNODE1 software package Projects folder contains several sample applications for the X-NUCLEO-S2868A1, X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5 sub-1GHz RF expansion board, X-NUCLEO-IKS01A1 or X-NUCLEO-IKS01A2, and X-NUCLEO-6180XA1 sensor expansion boards used on top of aNUCLEO-F401RE board.These applications can configure the wireless node as a REST server and expose the sensor and actuatorresources using the OMA Lightweight M2M standard (LWM2M) and the IPSO Smart Objects Guidelines [3].The applications differ by the type of sensors used.

2.5.5.1 ipso-nosensors application

This sample application allows device configuration as a simple wireless node without any sensors. It exposescommon resources like LEDs and user buttons.The device can be implemented using a NUCLEO-F401RE or NUCLEO-L152RE board equipped with an X-NUCLEO-S2868A1, X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5 sub-1GHz RF expansion board.

Table 2. IPSO objects supported by the ipso-nosensors application

Object ID Instances Notes

Server 1 1

Device 3 1

IPSO Digital Input 3200 1 The instance maps the STM32 Nucleo board user button

UM2100End-to-end system description and setup

UM2100 - Rev 4 page 7/26

Page 8: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Object ID Instances Notes

IPSO Light Control 3311 2 The instances map the STM32 Nucleo and X-NUCLEO-IDS01A4/5 board LEDs

2.5.5.2 ipso-mems applicationThis sample application allows device configuration as a wireless node with motion and environmental sensors. Itexports resources from the MEMS sensor expansion board (temperature, humidity and acceleration sensors).The device can be implemented using a NUCLEO-F401RE or NUCLEO-L152RE board equipped with an X-NUCLEO-S2868A1, X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5 sub-1GHz RF expansion board, and an X-NUCLEO-IKS01A1 or X-NUCLEO-IKS01A2 expansion board, featuring temperature, humidity, pressure andmotion MEMS sensors.

Table 3. IPSO objects supported by the ipso-mems application

Object ID Instances Notes

Server 1 1

Device 3 1

IPSO Digital Input 3200 1 The instance maps the STM32 Nucleo board user button

IPSO Temperature 3303 1

IPSO Humitidy 3304 1

IPSO Light Control 3311 1 The instance maps the STM32 Nucleo board LED

IPSO Accelerometer 3313 1

IPSO Magnetometer 3314 1

IPSO Barometer 3315 1

2.5.5.3 ipso-flightsense applicationThis sample application allows device configuration as a wireless node with a time-of-flight sensor (VL6180Xproximity, gesture and ALS sensor, based on ST’s FlightSense™ technology). The node exports resources fromthe FlightSense sensor expansion board.The device can be implemented using a NUCLEO-F401RE board equipped with an X-NUCLEO-S2868A1, X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5 sub-1GHz RF expansion board, and an X-NUCLEO-6180XA1 expansion board, featuring the VL6180X proximity, gesture and ALS sensor.

Table 4. IPSO objects supported by the ipso-flightsense application

Object ID Instances Notes

Server 1 1

Device 3 1

IPSO Digital Input 3200 1 The instance maps the STM32 Nucleo board user button

IPSO Presence Sensor 3302 1

IPSO Light Control 3311 2 The instances map the STM32 Nucleo and X-NUCLEO-IDS01A4/5 board LEDs

2.5.6

Note:

Wireless sensor node setupAll the sample applications provided demonstrate how a node can connect to a server by means of the OMA Lightweight M2M (LWM2M) standard. By default, the three sample applications are configured to implement the scenario where the wireless node attempt connection with a public online server (located at: https://leshan.eclipseprojects.io; it is is a Java implementation of a LWM2M server).

Leshan also implements a GUI that communicates with the server through a REST API, more information about the Leshan server can be found at https://www.eclipse.org/leshan. The Leshan public LWM2M server is used for evaluation purposes only.

UM2100End-to-end system description and setup

UM2100 - Rev 4 page 8/26

Page 9: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

The sample applications can also be made to implement the scenario enabling connection to a Leshan LWM2Mserver that runs locally on a host PC. In this case, the URL of the local server must be inserted in the applicationcode.To do this, undefine USE_PUBLIC_LWM2M_SERVER from the project properties (preprocessor symbols) and setthe desired address in client.c file, e.g.:

#define LWM2M_SERVER_ADDRESS_v6 “aaaa::1”

or

#define LWM2M_SERVER_ADDRESS_v4 “192.168.0.1”

2.5.6.1 Connecting the wireless node to the LWM2M server

Step 1. Power the STM32 Nucleo board using a Mini-B USB cable connected to the PC.Step 2. Program the firmware on the STM32 Nucleo board by copying (drag and drop) the binary file on the

USB mass storage that is automatically created when plugging the STM32 Nucleo board to the PC.Ready-to-be-flashed binary firmware can be found for each of the three supported applications in theBinary subdirectory of each sample application folder. Alternatively, each application can be built togenerate binaries using the provided projects, with one of the supported IDEs.

Step 3. Open a serial line monitor utility, select the serial port name to which the board is connected andconfigure it with the parameters shown below (example uses Tera Term utility with the deviceconnected to COM port 19).

Figure 5. Serial line terminal configuration parameters

Step 4. Press the black RESET button on the STM32 Nucleo board and wait for the node to complete theregistration

Figure 6. Client node registered on the remote server

Step 5. Open your web browser and insert the URL of the public Leshan server (https://leshan.eclipseprojects.io) for the default remote application server scenario, or insert the URL of thelocal Leshan server for the PC server scenario.

UM2100End-to-end system description and setup

UM2100 - Rev 4 page 9/26

Page 10: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Figure 7. Leshan server homepage

Step 6. Click on the corresponding Client Endpoint

Figure 8. Leshan server, client homepage

Step 7. Start observing or reading one or more resources

UM2100End-to-end system description and setup

UM2100 - Rev 4 page 10/26

Page 11: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Figure 9. Leshan server observing and reading resources belonging to IPSO objects

UM2100End-to-end system description and setup

UM2100 - Rev 4 page 11/26

Page 12: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

3 System setup guide

3.1 Hardware descriptionThis section summarizes the hardware components needed for developing a sensor-based application. Visitwww.st.com for more detailed information on all the associated boards.

3.1.1 STM32 Nucleo platformSTM32 Nucleo development boards provide an affordable and flexible way for users to test solutions and buildprototypes with any STM32 microcontroller line.The Arduino™ connectivity support and ST morpho connectors make it easy to expand the functionality of theSTM32 Nucleo open development platform with a wide range of specialized expansion boards to choose from.The STM32 Nucleo board does not require separate probes as it integrates the ST-LINK/V2-1 debugger/programmer.The STM32 Nucleo board comes with the comprehensive STM32 software HAL library together with variouspackaged software examples.

Figure 10. STM32 Nucleo board

Information regarding the STM32 Nucleo board is available at www.st.com/stm32nucleo

3.1.2 X-NUCLEO-S2868A1 expansion boardThe X-NUCLEO-S2868A1 expansion board is based on the S2-LP radio and operates in the 868 MHz ISMfrequency band.The expansion board is compatible with ST morpho and Arduino UNO R3 connectors.

UM2100System setup guide

UM2100 - Rev 4 page 12/26

Page 13: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

The X-NUCLEO-S2868A1 interfaces with the STM32 Nucleo microcontroller via SPI connections and GPIO pins.You can change some of the GPIOs by mounting or removing the resistors.

Figure 11. X-NUCLEO-S2868A1 expansion board

3.1.3 X-NUCLEO-IDS01A4 and X-NUCLEO-IDS01A5 expansion boardsThe X-NUCLEO-IDS01A4 and X-NUCLEO-IDS01A5 expansion boards provide a platform to test the features andcapabilities of the SPSGRF modules, based on the SPIRIT1 low data rate, low power, sub-1 GHz transceiverdevice.These expansion boards can be plugged into the Arduino UNO R3 connectors of any STM32 Nucleo board. Theuser can mount ST morpho connectors if required. Other expansion boards can easily be stacked to allowevaluation of different devices using sub-1 GHz communication.The boards are equipped with the following features:• Onboard SPSGRF module based on the SPIRIT1 sub-1 GHz transceiver device• SPI EEPROM for saving parameters• LED for user interface• Jumper at 3V3 for checking the current consumption of the expansion board

UM2100Hardware description

UM2100 - Rev 4 page 13/26

Page 14: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Figure 12. X-NUCLEO-IDS01A4 / X-NUCLEO-IDS01A5 expansion board

3.1.4 X-NUCLEO-IKS01A1 expansion boardThe X-NUCLEO-IKS01A1 is a sensor expansion board for the STM32 Nucleo board. It is also compatible withArduino UNO R3 connector layout and is designed around humidity (HTS221), pressure (LPS25HB) and motion(LIS3MDL and LSM6DS0) sensing devices. The X-NUCLEO-IKS01A1 interfaces with the STM32 MCU via the I²Cpin, and the user can change the default I²C port and the device IRQ by changing a resistor on the evaluationboard.You can attach the LSM6DS3 DIL24 expansion component and use it instead of the one of the LSM6DS0sensors.

UM2100Hardware description

UM2100 - Rev 4 page 14/26

Page 15: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Figure 13. X-NUCLEO-IKS01A1 expansion board

3.1.5 X-NUCLEO-IKS01A2 expansion boardThe X-NUCLEO-IKS01A2 is a motion MEMS and environmental sensor expansion board for STM32 Nucleo.It is compatible with the Arduino UNO R3 connector layout, and is designed around the LSM6DSL 3Daccelerometer and 3D gyroscope, the LSM303AGR 3D accelerometer and 3D magnetometer, the HTS221humidity and temperature sensor and the LPS22HB pressure sensor.The X-NUCLEO-IKS01A2 interfaces with the STM32 microcontroller via the I²C pin, and it is possible to changethe default I²C port.

UM2100Hardware description

UM2100 - Rev 4 page 15/26

Page 16: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Figure 14. X-NUCLEO-IKS01A2 MEMS and environmental sensor expansion board

3.1.6 X-NUCLEO-6180XA1 expansion boardThe X-NUCLEO-6180XA1 is an expansion board for the STM32 Nucleo system, also compatible with ArduinoUNO R3 connector layout and designed around STMicroelectronics VL6180X proximity, gesture and ALS sensor,based on the ST FlightSense™ Time-of-Flight technology.The board allows the user to test VL6180X functionality and develop relevant applications. It includes:• a 4-Digit display to render either the range value in mm or the ambient light value in lux• a switch to select the value type to be displayed• a 2.8 V regulator to supply the VL6180X• two level shifters to adapt the I/O level to the microcontroller main board• the necessary connectivity for the application

For applications which implement gesture recognition, you need to plug two additional satellite sensors to theconnectors marked LEFT and RIGHT. The third connector (BOTTOM) is not used.

UM2100Hardware description

UM2100 - Rev 4 page 16/26

Page 17: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Figure 15. X-NUCLEO-6180XA1 expansion board

3.2 Software requirementsThe following software components are needed in order to set up a suitable development environment forcreating applications with the STM32 Nucleo plus RF expansion and optional sensor expansion boards:• FP-SNS-6LPNODE1 software, available at www.st.com .• One of the following development tool-chain and compilers:

– IAR Embedded Workbench for ARM® (EWARM) toolchain + ST-LINK– RealView Microcontroller Development Kit (MDK-ARM) toolchain + ST-LINK– System Workbench for STM32 (SW4STM32) + ST-LINK

UM2100Software requirements

UM2100 - Rev 4 page 17/26

Page 18: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

3.3 Hardware setup

3.3.1 Configuration for ipso-nosensors sample applicationRequired components:• One STM32 Nucleo development platform (order code: NUCLEO-F401RE or NUCLEO-L152RE)• One S2-LP expansion board (order code: X-NUCLEO-S2868A1) or one SPIRIT1 expansion board (order

code: X-NUCLEO-IDS01A4 (for 868 MHz), or X-NUCLEO-IDS01A5 (for 915 MHz)• One USB type A to Mini-B USB cables to connect each STM32 Nucleo to the PC

In the figure below, an X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5 SPIRIT1 expansion board is connected tothe STM32 Nucleo board.

Figure 16. STM32 Nucleo plus the SPIRIT1 expansion board

3.3.2 Configuration for ipso-mems sample applicationRequired components:• One STM32 Nucleo development platform (order code: NUCLEO-F401RE or NUCLEO-L152RE)• One S2-LP expansion board (order code: X-NUCLEO-S2868A1) or one SPIRIT1 expansion board (order

code: X-NUCLEO-IDS01A4 (for 868 MHz), or X-NUCLEO-IDS01A5 (for 915 MHz)• One MEMS sensors expansion board (order code: X-NUCLEO-IKS01A1 or X-NUCLEO-IKS01A2)• One USB type A to Mini-B USB cables to connect each STM32 Nucleo to the PC

In the figure below, a X-NUCLEO-IKS01A1 MEMS expansion board is connected to the STM32 Nucleo over theX-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5 SPIRIT1 expansion board.

UM2100Hardware setup

UM2100 - Rev 4 page 18/26

Page 19: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Figure 17. STM32 Nucleo plus the SPIRIT1 expansion board plus the MEMS expansion board

Important:If using X-NUCLEO-IKS01A1 and X-NUCLEO-S2868A1, to avoid a resource usage conflict, the 0 Ω resistor at position SB21on the X-NUCLEO-IKS01A1 must be removed.

3.3.3 Configuration for ipso-flightsense sample applicationRequired components:• One STM32 Nucleo development platform (order code: NUCLEO-F401RE)• One S2-LP expansion board (order code: X-NUCLEO-S2868A1) or one SPIRIT1 expansion board (order

code: X-NUCLEO-IDS01A4 (for 868 MHz), or X-NUCLEO-IDS01A5 (for 915 MHz)• One FlightSense expansion board (order code: X-NUCLEO-6180XA1)• One USB type A to Mini-B USB cables to connect each STM32 Nucleo to the PC

In the figure below, an X-NUCLEO-IKS01A1 FlightSense expansion board is connected to the STM32 Nucleodevelopment board over the X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5 SPIRIT1 expansion board.

UM2100Hardware setup

UM2100 - Rev 4 page 19/26

Page 20: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Figure 18. STM32 Nucleo plus the SPIRIT1 expansion board plus the FlightSense expansion board

UM2100Hardware setup

UM2100 - Rev 4 page 20/26

Page 21: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

4 References

[1] UM2080 – User Manual - Getting started with the FP-NET-6LPWIFI1 software package connecting 6LoWPANIoT nodes to the Internet via Wi-Fi networks, available at www.st.com[2] UM2040 – User Manual - Getting started with Contiki6LP, Contiki OS and 6LoWPAN sub-1 GHz RF in X-CUBE-SUBG1 expansion for STM32Cube, available at www.st.com[3] IPSO Alliance Smart Object Guidelines – IPSO Smart Object Starter Pack, available at http://www.ipso-alliance.org/ipso-community/resources/smart-objects-interoperability/

UM2100References

UM2100 - Rev 4 page 21/26

Page 22: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Revision history

Table 5. Document revision history

Date Version Changes

17-Oct-2016 1 Initial release.

22-Feb-2017 2 Throughout document: added NUCLEO-L152RE board compatibility information.

05-Sep-2018 3 Throughout document: added X-NUCLEO-S2868A1 board compatibility information.

15-Apr-2019 4 Updated Section 2.5.6.1 Connecting the wireless node to the LWM2M server.

UM2100

UM2100 - Rev 4 page 22/26

Page 23: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

Contents

1 Acronyms and abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2

2 FP-SNS-6LPNODE1 software package. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3

2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.2 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.3 Folder structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4 APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.5 End-to-end system description and setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.5.1 End-to-end system overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.5.2 End-to-end connectivity scenario using a 6LoWPAN-to-WiFi bridge and remote applicationserver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.5.3 End-to-end connectivity scenario using an IPv6 host PC and local application server. . . . . 6

2.5.4 LWM2M application server (Leshan) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.5.5 Wireless sensor node applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.5.6 Wireless sensor node setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 System setup guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12

3.1 Hardware description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.1.1 STM32 Nucleo platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.1.2 X-NUCLEO-S2868A1 expansion board. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.1.3 X-NUCLEO-IDS01A4 or X-NUCLEO-IDS01A5 expansion board . . . . . . . . . . . . . . . . . . . 13

3.1.4 X-NUCLEO-IKS01A1 expansion board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3.1.5 X-NUCLEO-IKS01A2 expansion board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.1.6 X-NUCLEO-6180XA1 expansion board. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3.2 Software requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.3 Hardware setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.3.1 Configuration for ipso-nosensors sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.3.2 Configuration for ipso-mems sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.3.3 Configuration for ipso-flightsense sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22

UM2100Contents

UM2100 - Rev 4 page 23/26

Page 24: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

List of tablesTable 1. List of acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Table 2. IPSO objects supported by the ipso-nosensors application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Table 3. IPSO objects supported by the ipso-mems application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Table 4. IPSO objects supported by the ipso-flightsense application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Table 5. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

UM2100List of tables

UM2100 - Rev 4 page 24/26

Page 25: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

List of figuresFigure 1. FP-SNS-6LPNODE1 software architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Figure 2. FP- SNS-6LPNODE1 package folder structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Figure 3. End-to-end connectivity using a 6LoWPAN-WiFi bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Figure 4. End-to-end connectivity scenario using a host PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Figure 5. Serial line terminal configuration parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Figure 6. Client node registered on the remote server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Figure 7. Leshan server homepage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Figure 8. Leshan server, client homepage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Figure 9. Leshan server observing and reading resources belonging to IPSO objects . . . . . . . . . . . . . . . . . . . . . . . . . 11Figure 10. STM32 Nucleo board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Figure 11. X-NUCLEO-S2868A1 expansion board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Figure 12. X-NUCLEO-IDS01A4 / X-NUCLEO-IDS01A5 expansion board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Figure 13. X-NUCLEO-IKS01A1 expansion board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Figure 14. X-NUCLEO-IKS01A2 MEMS and environmental sensor expansion board . . . . . . . . . . . . . . . . . . . . . . . . . . 16Figure 15. X-NUCLEO-6180XA1 expansion board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Figure 16. STM32 Nucleo plus the SPIRIT1 expansion board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Figure 17. STM32 Nucleo plus the SPIRIT1 expansion board plus the MEMS expansion board . . . . . . . . . . . . . . . . . . . 19Figure 18. STM32 Nucleo plus the SPIRIT1 expansion board plus the FlightSense expansion board . . . . . . . . . . . . . . . 20

UM2100List of figures

UM2100 - Rev 4 page 25/26

Page 26: Getting started with FP-SNS-6LPNODE1 software for IoT sensor … · • Complete firmware to connect an IoT node with sensors and actuators to a 6LoWPAN network, using sub-1GHz RF

IMPORTANT NOTICE – PLEASE READ CAREFULLY

STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to STproducts and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. STproducts are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement.

Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design ofPurchasers’ products.

No license, express or implied, to any intellectual property right is granted by ST herein.

Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.

ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks. All other product or servicenames are the property of their respective owners.

Information in this document supersedes and replaces information previously supplied in any prior versions of this document.

© 2019 STMicroelectronics – All rights reserved

UM2100

UM2100 - Rev 4 page 26/26