I’m using the PANS 2 firmware and gateway to get position from tags and it worked fine.
But, the idea is get other information from tags, like accelerometer. I’d like to include other sensors as well (buttons, gas sensor) and include some actuators like buzzer and so on.
- Is it possible read accelerometer data generated by the built-in sensor through MQTT?
- Is it possible access GPIOs available on the board, reading and writing them through MQTT? (I’d like to install custom buttons, and actuators like a buzzer, and leds)
- Imagine I need to gather other information from extra sensors (gyroscope, gas sensor, and so on).
3.a) Is it necessary rewrite the firmware to include these data and send it to gateway?
3.b) Is it necessary use another board to read these sensors and send data to gateway? If yes, could I send these data through DWV1001 via serial port?
The points you mentioned can be done through the provided on-board c language user app. Please refer to DWM1001 Firmware User Guide for the usage.
To upload IOT data through MQTT.
In our document: DWM1001 Firmware API Guide, section 5.3.20 - 5.3.21, you can see the ways to send / receive IOT data.
If you’ve downloaded our online package, you can find an example to send user data through MQTT:
In this example, line 106, dwm_usr_data_write is used to send the IOT data package.
To read from GPIO
In our document: DWM1001 Firmware API Guide, section 5.3.24 - 5.3.28, you can see the ways to control / read the status of the GPIOs. An example is also included in our example dwm\examples\dwm-api-test
See line 502 for detailed usage.
To read from I2C
In our document: DWM1001 Firmware API Guide, section 5.3.41 - 5.3.42, you can see the ways to use the I2C port. An example is also included in our example
See line 726 for detailed usage.
Access peripherals through SPI / UART / I2S etc
In our document: DWM1001 Firmware API Guide, section 18.104.22.168, you can see which peripheral can be used in the user app. Two examples of using the Timer and the UART are included in dwm\examples\
Note: the examples mentioned above refer to the project included in DWM1001_DWM1001-DEV_MDEK1001_Sources_and_Docs_v9\DWM1001\Source_Code\DWM1001_on_board_package\
Thank you so much. Looking forward to try these features.
@Weibo_Pan, thanks for this explanation.
I understood overview of how I can use on-board package.
But I want to know use of DWM1001 Host API package given in Source code.
Thanks & Regards
Have you finally managed to implement the MQTT solution? I am trying to do the same, I need the MQTT to send the accelerometer data in addition to the location data.
Thanks & Regards
What is the correct version of this example?
In the last downloadable version, line 106 is never executed because it is within a #if 0. I have managed to execute it in a DWM1001 module but no subscription of type dwm / node + / uplink / data arrives at the MQTT.
What could be wrong?