This application is a RIOT native LwM2M client to read a temperature sensor. It uses gcoap for CoAP messaging and SAUL to read a temperature sensor. The temperature value is available as a measured temperature (/3303) object.
See the RIOT JC42 driver for a suitable SAUL temperature reader. The Microchip MCP9808 sensor supports this standard, and for example Adafruit provides a convenient breakout board for development.
The app also can be run with a "native" board without a SAUL sensor. In this case the temperature value simply increases with each measurement.
The server address is defined in the Makefile as 'SERVER_ADDR'. The SAUL driver is defined as SAUL_DRIVER, and defaults to "jc42".
The measurement interval is defined in saul_info_reporter.h as SAUL_INFO_INTERVAL, and defaults to 60 seconds.
Review and modify Makefile as required. Then compile and run the client with:
BOARD=<board> make clean all flash termlwm2m start: Registers with the LwM2M server and starts taking temperature measurementslwm2m state: Debugging tool to show current application state
The temperature value resource /3303/0/5700 may be read or observed by the LwM2M server.
Turn on DEBUG in lwm2m_client.c to follow state changes.