Lab 23. Detect GPIO changes
Enable the D0 GPIO notification
This step enables the GPIO input pin. It is a required step for reading its value or activating notifications.
The D0 GPIO corresponds to the DP2
pin on the DC9003 SmartMesh Eval/Dev Mote.
create a flow which issues:
an HTTP PUT request
to URL http://127.0.0.1:8080/api/v1/oap/{{mote}}/digital_in/D0
with payload
{ sampleCount: 1, rate: 10000, enable: 1, dataFormat: 1 }
Open the SmartMesh IP Tools Guide (https://www.analog.com/media/en/technical-documentation/user-guides/smartmesh_ip_tools_guide.pdf), look for section "/digital_in". What does dataFormat 1 mean?
Answer 1:
Trigger D0 GPIO notifications
Make sure you have a Node-RED flow enabled that listens to
/oap
notifications (see Lab 15. receive temperature )Connect a jumper between the DP2 and VSUPPLY pins. Make sure you receive a notification.
Move the jumper to connect the DP2 and GND pins. Make sure you receive a notification.
You can transition the jumper between the two positions above to generate further notifications.
NEVER CONNECT VSUPPLY
and GND
TOGETHER!!