Improve facility management by taking into account actual usage based on real time measurements.
This example shows how a LoRa™ sensor can count visits to optimise cleaning based on usage rather than rigid fixed schedules.
If you did the basic example on the previous page, your device is already created and ready for use.
If not, please check the create a device section.
count-visits
example sketchcount-visits
example sketchlorawan-rdk-payload-definition.json
in the textarea. You find this file in the examples/binary-payload folder of the arduino-lorawan-rdkEnter your device keys similar to how we did in our basic example.
Simply hit the upload icon in the Arduino IDE. This will save the sketch, compile it and upload it to your Arduino.
After uploading, you might need to flip the power switch on the Sodaq Mbili OFF and back ON to make sure the Mbili reboots and starts up our sketch.
You can now watch the values change in AllThingsTalk Maker.
Alternatively, you can open the Tools > Serial monitor of the Arduino IDE.
- Make sure you select the correct COM port to listen (under Tools > Port )
- When the monitor is open, make sure the Baud rate is set to 57600
We want to get notified with the visit count:
For a simple rule like this, we can use the rules wizard.
Time to create our rule!
The name of your device upon creation is LoRa prototype.
That’s it! When your asset receives a count above 20, you now will get notified!
The count only resets when the button is pushed, meaning cleaning is done.
To visualise our date, we will create a pinboard. For more information on pinboards, please check how to use pinboards.
Now we will pin a control (visual representation) for our Integer Sensor asset to visualise the amount of visits.
You can pin the same asset multiple times. Pinning the asset to visualise it both as a historical chart and a label may give you an even better look!