Version 1.5 of Mesh Developers Toolkit has just been released on the iTunes App Store.
I have added a few features:
The message string passed to the script contains the event type (“startup_event” or “timer_event”) so you can handle this within your script.
An example of how this works has been added in the default script on Github (created when the App is installed).
The second new feature, is that both the messages received and details of the devices that created the messages are stored in a sql database on the device (although this can be switched off in the settings).
This device can then be queried from either the script or a http request.
For example the following sql will give a list of goTennas which have not sent a message to Mesh Developers Toolkit in the last five minutes:
select * from gtdevices where timestamp < datetime(current_timestamp,'-5 minutes');
Similarly the following would give all messages which have been received in the last minute (effectively allowing you to poll for new messages):
Select * from gtmessages where timestamp > datetime(current_timestamp,’-1 minutes');
Examples of what you could do when you combine the above functionality are:
Broadcast a message when the Toolkit connects to a goTenna to say it’s available.
Check every minute for devices which have not sent a message for 10 minutes and send an individual message to each device to check that the user is ok.
Query the messages sent in the last minute and forward them to another service.