- Created on Friday, 14 May 2010 23:37
- Last Updated on Tuesday, 29 April 2014 20:58
- Written by Mike Holden
- Hits: 15578
I'm working on a boat monitoring system for my sailboat, since my marina put in free wifi.
First part is an arduino with a wifi connection to twitter updates. I chose the wifly (using it's shield from sparkfun) since it works with many kinds of wireless security schemes. Combining a few example codes, I got things to work.
It checks time using a NIST time server (I did that part myself), and sends a status update hourly with the time and date. Interestingly, twitter rejects duplicate updates, so the time stuff is handy to work around that for testing.
Here's the code I'm testing with. You'll need to change the #defines at the top for your twitter account, SSID and wireless password. The serial monitor still passes through text to the wifly so you can try new things. If you press # you will send a tweet, if you type | you check the time, ! connects the wifly to the access point. Plus automatic tweets 5 minutes after booting and every hour on the hour thereafter (unless it doesn't work).
You can follow me on twitter here.
You can download the code here. Update Sept 2010: Twitter has disabled basic authorization, which this code uses. So it won't work any more!!!
For now, I recommend this library for twitter. It's not that hard to convert, I'll try to update this page soon....