Some weeks ago I met Thilo and he showed me twibble, his GPS enabled twitter client for the N95. Nice little and smart application. It sends messages with geo positions to twitter. The postion can then be tracked and viewed within Google Maps.
I was impressed and decided immediately to try to post the same messages with my mobile tracker and use the same, twitter, twibble and GM, to track my positions.
Using Builtin Python instead of the AVR controller
Actually I switched to use the builtin Python interpreter as some on the comments already suggested. So the external microcontroller is superfluous. That should make the setup smaller, cheaper and easier. By now I don’t have a new board, I just bypass the controller. Communication is done via serial port directly connected to the Telit module.
How to develop in Python for the GM862
To develop python scripts you need to download the python package from roundsolution’s techdocs page. Next write a “hello world” script and upload it with your favorite terminal application. Note, that using print statements for debugging will not work as expected. You have to redirect stdout to the serial port to be able to see them in your terminal. Joe pointet out that solution.
According to the documentation, it should be possible to get seperate output for debugging, stdout, etc. but I didn’t manage to get that up and running so I was stuck in trail and error. After uploading the script and starting the execution, the module takes some time to compile the python code. If it fails, it fails silently, what is a bit nasty. Nick has a nice writeup of how to develop with python for the GM862 in his blog. Developing and debugging turned out to be not that easy but it works.
Posting twibbled tweets
To piggybacking on twitter and twibble, I created a twitter account. I wrote a test script that uses HTTP over GPRS to post messages to twitter. As posting to twitter is secured with HTTP basic authentication, I hard wired my script to post my auth value. curl is very handy to test HTTP communication on the command line of your PC. Using the -v switch shows the encoded auth value, that you need.
Next I fetched the position from the GPS and formatted the message accordingly. To enable twibble to grab the position, it must be formatted like this: “<message> L:<lat>,<lon>:”.
The script now just fetches the position and posts it to twitter every two minutes. This can be improved by posting the position only if the module was moved.
Now I can use Google Maps to fetch a kml file, which is generated by the twibble service out of my twitter messages. With the new feature to embed Google Maps without an API key, it’s even easier.
Links and downloads