iOS Toolkit App

Hi,
I have been working on an IOS App, built on the Gotenna SDK, which allows for incoming messages to be parsed with an inbuilt JavaScript interpreter (or forward them to an external web server) and the results sent back to the goTenna which generated the message.

The first release of the App is now in the iTunes Store - here

Some more information and initial documentation is available here

This is very much a part time project - fitted around family and work commitments but I am still building functionality for the App, aiming for a couple of releases over the next few weeks.

Enjoy!

15 Likes

Hi,
Found some time to put together a new release over the weekend which is now live in the App Store - Fixed a number of bugs and added support for "Peertalk", which allows the App to talk over the USB cable to a Mac (using objective-c or python) or Raspberry PI host (in python).

For more info on this protocol see https://rsms.me/peertalk/ and https://makezine.com/2013/04/22/peertalk-beaglebone-and-raspberry-pi/.

I will put up a python sample when time permits but the python samples available on the web run out of the box on a Mac.

A bit more work is required to get them working on a raspberry pi - installation of usbmuxd (apt-get install usbmuxd) and getting a working usbmuxd python library.

I found that the libraries from https://github.com/huangjimmy/usbmux-python-client work well on a raspberry pi.

In the meantime I using this as inspiration…

5 Likes

This is the coolest thing ever! Thanks for taking the time to build such useful software—it has so many incredible use cases, esp forwarding to an external web server.

Some feedback I hope is helpful:

  1. I installed the app on my iPhone X easily, but wasn’t able to get it to receive any messages even though I see the messages within the GoTenna app as successful. I found the fix was to close the actual GoTenna app on the listening device. I would add this in the documentation and perhaps even in the error messaging if the device can’t connect “Please close GoTenna app if you have it running”.
  2. I tried both the script and the external server setting. I was able to receive and respond to messages in broadcast mode only. Messages sent directly to my GUID didn’t go through. This may have to do with my GUID being my GUID-verified phone number? Within GoTenna app my GUI has a weird formatting of: “1111 111 111” (with the 1’s being my actual phone number). I don’t know if those spaces matter in your app.
  3. I tried using the external server setting and whenever I sent a broadcast message on another phone the app would crash. May also be the case of my GUID being weird?

That’s my feedback. Hope it’s helpful! Though not everyone can appreciate what you’re building, I think the 3rd party apps that get built on top of it will be incredibly useful in various ways for everybody not just us developers.

4 Likes

Hi Mauvis,
Thank you for your comments and feedback.

I will look at this properly when I can, but in the meantime can you try switching the “don’t process shouts” on and off and also reset the GUID.

The GUID is a number so spaces should not be entered - I will try with phone numbers as I have only used generated GUID’s.

Can you respond to a shout from another goTenna by swiping left on the incoming message? and is the App connecting ok to the goTenna (you can check the Activity log - when the App connects it logs the Battery Level, Serial number and Firmware version).

Can you retest with the latest build - I did fix a crash with URL formatting.

Hope this helps.

2 Likes

+1 on this. Congrats @Pete94!

1 Like

Hi,
Due to Storm Emma I had some time today to play around with Mesh Toolkit, a Raspberry Pi and a Franklin Lightning Sensor…

IMG_4273

With the end result being:

I have put the example script on github and it is based on the excelent article Raspberry Pi lightning strikes using the code from here and here.

Hardware wise it is running on a raspberry Pi with the lightning detector from Here.

A USB 2.0 Hub/Power Supply Module with a battery gives around 5 hours life and the TP-Link TL-MR3020 running as a Client router allows me to ssh into the Pi.

5 Likes

Hi,
A new version (1.2) has been released on the iTunes App Store, this version now supports running in the background and has an option to keep the App in the foreground.

3 Likes

Hi,
Back to the day job tomorrow, but in the meantime version 1.3 has just been released in the iTunes App Store. This provides a few new Javascript features:

The variable ‘guid’ which contains the guid of the goTenna which generated the message is now passed to the Javascript.

A bunch of new Javascript functions:

network_status(), host_reachable() and cell_status(), these are based on Apple’s Reachability Sample and returns the type of network (e.g. Wifi), if www.apple.com is reachable and if cellular data is available.

Finally, two functions gotenna_battery() and iphone_battery() which return the current battery percentages to the Javascript.

Going forward thinking how I could integrate one of these but due to the costs involved most probably end up prototyping using one of these - time permitting…

2 Likes

When “Mesh Toolkit” posts information to a webserver, how are the messages posted/encoded? Do I need to pass the variables on the URL? What variables on the webserver side can receive this information?

Hi ae74,
When messages are forwarded to a URL the message data is appended to the field entered into the URL field as a “get” request - you don’t need to add the variables to the URL.

In the current release (1.3) the follow string is appended to the URL field by Mesh Toolkit:

?message=MESSAGE&lat=LATITUDE&lng=LONGITUDE?guid=GUID

Where:

Message = The message sent to the App.
lat = The current latitude of the device.
lng = the current longitude of the device.
guid = the guid of the goTenna which generated the message.

Note the “?” is appended by Mesh Toolkit.

The variables are percent encoded by Mesh Toolkit.

Hope this helps.

Thanks. I was able to setup a script on a remote web server that will receive all messages and send them to a pre-defined mobile phone via SMS using the Twilio SMS API.

Any chance on using a different way for the Mesh Toolkit to poll for messages that need to be sent out so this same system could possibly act as a bridge between locations? Twilio doesn’t need to be involved. Maybe there is already a way to act as a bridge between locations.

2 Likes

Hi ae74,
I think that you can in the short term you can achieve this using two goTenna/Mesh Toolkit pairs (but I have not tried it) as follows:

If you have two iOS devices on the same network or Wan (or possibly 4g) running Mesh Toolkit, you can redirect from one Toolkit to the web server running on the other (if that makes sense), as the format of the parameters are the same for the redirect and the web server.

The redirect url would be “http://[Remote IP Address]:8080/shout”

The message or shout sent to the first Toolkit would be forwarded by the second one as a shout.

Although there is some logic to prevent shouts from one goTenna/Tookit being re-broadcast to back to the originating goTenna/Tookit and looping I think there might be some issues with messages been rebroadcast at the same time a making an out going web request.

Also I think that you cannot set up both to forward messages to each other as this would end up in a loop - but I will look to see if I can prevent this.

As I have not tried this (it needs three iOS devices and goTennas to test) I cannot say if there are any bugs but I would be interested in your feedback.

The latest release also supports iOS 9.3 - so you could use a iPhone 4s for the second goTenna/Tookit pair.

Hope this helps (and makes sense…).

2 Likes

Hi,
Version 1.5 of Mesh Developers Toolkit has just been released on the iTunes App Store.

I have added a few features:

The first is that you can set the Javascript to be run around every minute (as well as running when the Toolkit connects to the goTenna), using the new setting “Enable Scheduled Tasks”.

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');

New javascript functions have been added to allow you to send a message to a device or send a shout.

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.

2 Likes

Ps. Mesh Developers Toolkit also support iTunes file sharing so you can edit your script in your a desktop code editor rather than using the simple editor within the Toolkit.

Thanks, @Pete94! Just downloaded the latest iOS app. Other than the goTenna app itself, “Mesh Developers Toolkit” is my first mesh app to begin getting familiar with.

1 Like

Hi,
Release 1.6 of Mesh Developers Toolkit is now live in the iTunes App store.

This release now shows an activity spinner when searching and connecting to a goTenna to make things a bit clearer.

It also includes new functionality to request the location of another goTenna/phone combination in the background - both from Javascript and a url request ("find(guid)" and "/find?guid=xxxx").

Adding the line:

find(guid);

To your javascript (where guid is just guid - not an actual guid (if that makes sense) the script will send a location request to the originating goTenna.

The data is stored in two SQL tables ("gtlastfix" and "gttrack").

Finally, if you swipe left on an incoming message you can now request the location of the remote device in addition to being able to send a direct message.

2 Likes

Hi,
Version 1.7 went live in the App Store today - it fixes a couple of bugs and includes a couple of new functions:

distance(lat1,lng1,lat2,lng2) - Allows you to calculate the distance in Kilometres between the two locations.
bearing(lat1,lng1,lat2,lng2) - Allows you to calculate the bearing between the two locations in degrees.

This means that you can quickly work out the nearest (or furthest) goTenna in a SQL select.

When the Web-server is running it now advertises its self using Bonjour - this is to support a companion App I am building for iPad…

2 Likes

Version 1.9 of Mesh Developers Toolkit was approved for the iTunes App Store today with a bit of simple augmented reality…

In addition to a few stability improvements (AKA bug fixes) this version has two new Tabs - “Toolkits” and “Devices”.

The “Devices” Tab lists any devices which you have a location for (swipe left on any incoming messages on the “Messages” tab and press “Find”).

You can then do any of four actions by swiping left:

  • You can send a “Message” directly to the goTenna.

  • You can send a new “Find” request.

  • You can get the “Bearing” and distance to the remote goTenna, this uses the iOS device’s camera and by panning around to line up the two circles on the outside of the “compass rose” you can get a visual fix on the remote user. If the name of another goTenna is displayed when panning clicking on it will allow you to get the bearing to that goTenna.

  • You can calculate (“Map”) a route to the remote goTenna using a third party app from your current location. This currently supports “Apple Maps”, “maps me” and “Navigon”. If other Navigation Apps have a URL scheme I can look to add them in a future release - just post the details of the URL scheme.

The “Toolkits” Tab finds any other Mesh Developers Toolkits running on the same network (the remote Toolkits need to have the web server enabled to be found).

By swiping left on an item in the list currently allows you to send a shout message via the remote goTenna.

3 Likes

Nice work @Pete94 — do you know what any of your users are using the toolkit for?

Hi Daniela,
Thank you for your comments - except from ae74 and Mauvis I have not had any feedback how the App is being used.

The latest functionality has been built to visualise the location information available from goTenna devices which is different to the first set of functionality which is around bridging GoTenna’s to network APIs or IOT devices (e.g. Weather services and the Lightning Detector).

Feedback on how Toolkit is being used would be great - both to understand how people are using it and also to shape it’s future direction.

2 Likes