Archive for the 'internet' Category

a’twittering Arduino without an Ethernet shield

Saturday, May 28th, 2011

The Arduino Ethernet shield is pretty awesome and can, for example, allow a mini webserver to run off the board displaying sensor data. Although not outrageously expensive, at $45, it’s still $15 more than an Arduino Uno itself. There does seem to be quite a bit of functionality that you can do with it, especially as the official Arduino Ethernet shield includes a micro SD slot allowing to read + write data to card, but for my tinkering right now, it’s a little too much money.

But, it would be cool to at least look at how to push data from the Arduino out the Internet, and so I started looking around at ways to utilize the USB connection and have the computer the Arduino is connected to act as a go-between. Cue some fun python libraries. The setup entails using pySerial to monitor the USB port and read in data printed to the Arduino serial port, and then python-twitter to push that data out as a status update to twitter. This was all based off an awesome post from Brad Wells on using Arduino to Twitter over USB.

To get the python libraries installed and ready to roll:

  • Download pySerial – unpack the archive and then from the command line within that directory run
    python setup.py install
  • python-twitter has three dependencies that need installing first:
    • simplejson – download and unpack the archive, and then from the directory run
      python setup.py install
    • httplib2 – download and unpack the archive, and then from the directory run
      python setup.py install
    • python-oauth2 – download and unpack the archive, and then from the directory run
      python setup.py install
  • Now you can download python-twitter – unpack the archive, and then from the directory run:
    python setup.ph build
    python setup.ph intall

Now we need to get twitter ready. The python script uses the twitter API, so it requires you to register your own application in order to get the access tokens needed to function. Most people create a separate twitter account specifically for the Arduino to tweet to (the entry in the Arduino playground for tweeting using the Ethernet shield has you running through an external service to pass the tweet, so you probably shouldn’t use your primary account), and when registering your application at dev.twitter.com, make sure you’re signed in to twitter using this dedicated Arduino account. After registering, your consumer key and consumer secret key are immediately provided – click on ‘My Access Token’ to gain the access token and access token secret.

The python script, broken down and detailed in Brad’s blog post, requires you to copy and paste those four twitter tokens in to the script. On the Arduino side, the sketch can be as simple as:

Serial.begin(9600);
Serial.println("Tweeting arduino!");

within setup(). All you need to do is initialize a 9600 baud serial instance and then print out a line. Whatever your print out to the serial port is what the python script will read in and tweet. Make sure you compile and upload the sketch to your Arduino before you run the python script – as you have python monitoring your USB port to watch for the serial output, you can’t then upload via USB to the Arduino. Once you sketch is uploaded, you can fire up the python script and then hit the reset button on your Arduino.

Tweeting Arduino

The python script will just sit at the command line, watching for messages sent out to the Arduino’s serial port. If you check your twitter feed, you should see your tweet :-) You can easily expand beyond simply printing a line of text to reading in data from sensors and have that included. It would definitely make it more useful, and within the python-twitter library, there are functions to also monitor twitter updates and send data back to the Arduino. That’s something I haven’t quite figured out yet, but is definitely an appealing feature!

What a difference a year makes

Wednesday, September 9th, 2009

Over the Labor Day weekend, Jeff and I headed way up the Gweek River camping. It was great fun, the weather on the Saturday was just awesome, well in to the 70F’s with clear blue skies. I have a few photos I’ll post, but the second camping spot we ended up at gave us an amazing sunset and moon rise. We were both a little tired when we got back on Sunday, but experiences like that all add up. It was quite weird to be way up the Gweek to the point of needing a canoe, and to then end up drifting back down to camp covered in camo duck hunting. It got me thinking whilst grilling salmon how much of a difference a year makes.

I never really think back on my times in Tunt and long to be back or wish for things to have turned out differently, but have thought a few times over the summer how different it must be for the teachers that find themselves stationed around Bethel in Napaskiak, Oscarville or Napakiak, or up around Kwethluk; or west coast sites like Mekoryuk, Toksook Bay or Tununak. The southern coastal sites like Tunt, Kong and Kwig are quite, quite different, and feel a lot more remote and desolate. I couldn’t imagine trees like I’ve seen around the Kwethluk or Gweek Rivers, and even small rolling hills or the abundance of bird life or fishing when I was living in Tunt. A year ago this past weekend I was spending the Labor Day weekend moving up to Bethel, and I can first remember feeling something not quite right after my second day on the job here whilst phoning back that the evening.

Contrast to today where I was calmly balancing so many district-wide servers, networking and licensing issues, whilst also taking my first college class through UAS where I’m enrolled on a bachelor’s course, and tonight have been running Facebook and Skype through my iPhone. I own a truck and a boat, and my snowmobile came back home last night and work started on replacing the rear suspension assembly for the coming winter. I would never have believed I could have found myself living in such a situation.

My first political science class went really well and seems like it will be pretty interesting. I spent the rest of the evening working on my readings for next week. The first of my oceanography classes is Monday afternoon and I have some readings to do over the weekend for that.

I also finally got an iPhone up and running out here today :-D It’s taken a lot of patience, but other than the same restrictions on any cellphone out here in Bethel with regards to lack of data coverage, it works great. There are a few apps I’ve installed such as Facebook, Tweetdeck, Skype and Shazam which are cool, and I have a friend coming in to town next week that am sure will point me in the direction of even more. It really is an awesome little device, and even things like text messages bring on a whole new meaning when it’s formatted like iChat conversations. Very happy with it!

New toys for the summer

Sunday, April 19th, 2009

I’ve kept a fairly low profile this weekend, trying to have a pretty quiet couple of days to rest and get myself together. I helped out at the Saturday market on the K300 stall yesterday afternoon which was good fun, though quiet. I picked up a piece of art by John Oscar for my new apartment which I really like. I got a print a couple of months ago and have always admired his originals – he does 3D pieces a lot, this one has guinea hen (?) feathers coming out which works really well.

Whilst working the stall, Casie told me she’d set up a fan page for the K300 on Facebook, and when Myron Angstman came in to help pack stuff away he said there were a bunch of people in the group. I asked how he knew, and said he was a fan too. When Myron is on Facebook, I know I’m in the stone ages and avoided it long enough, and since a couple of people asked about it, figured I should sign up too! So, am now a sheep on Facebook.

By way of retail therapy, I decided since the FAA won’t let me fly and I had a bunch of money saved up on that front, I’d channel my energy into my other passion – photography. I’ve been researching various cameras and lenses for a few months anyways, so wasn’t exactly a wild spending spree, and am very excited about it. I’ve plummed for the Canon EOS 50D with 28-135mm lens plus a Tokina 12-24mm lens, along with a bunch of extras such as pair of 8Gb CF cards (266′s), assorted Hoya filters, Manfrotto tripod and ballhead, remote release switch, etc. I also picked up an extra 4Gb RAM, 750Gb hard drive and 22″ widescreen monitor on the computer side.

It’s a big investment, but since I’m not going anywhere this summer and whilst having a bunch of money in the bank is rewarding, is kinda boring too! Has actually been nice to have the money saved up to cover all the expenses of moving in to a new place and all this photography equipment. I’ve been pretty smart with money for months now which has allowed me to be able to head in to Anchorage for the Iditarod for example, and feel I may as well make the most of enjoying the salary I’m on whilst I can. I’ve gotten enough into photography over the last couple of years to the point where I feel like I can justify purchasing and using this kinda of gear rather than a number of people I regularly see that buy the latest and greatest equipment and then puzzle over using it effectively!

Hopefully the new toys will get here within a week or so and can start playing.

New K300 website

Tuesday, November 18th, 2008

After just a little bit of work, the new website for the Kuskokwim 300 is now live :-) Mike McIntyre from YKHC did all the graphics and layout design, which I think turned out great, and I then built the template into a WordPress install and imported all the archived data from the old site. Still a few race results to finish importing, and there’s a bunch of photos to bring in too, but the majority of it is there and running pretty nicely.

Whilst heading to the meeting last night about the site, I did come across a new one though – I was transferred into another taxi :-D I was heading out past Larson Sub, the other passenger was going up to Ptarmigan (completely different ends of town), so the driver called another cab to meet us where we would go different directions, and off we went. Little different, never come across that one before, but least I got my $7 worth!

And in other news, my guitar was apparently shipped out, but there’s still no charge against my bank account (no complaints!), and no tracking number :( Hopefully everything’s alright and it hasn’t actually just been canceled!

Another busy weekend

Sunday, November 2nd, 2008

I haven’t exactly ended up with the quiet weekend I had planned, but I haven’t minded one bit ;-) After hanging out with friends on Thursday and Friday night, I was then out at ‘Just Desserts’ at the Cultural Center last night, a fund raiser for the Bethel Arts Guild. There were some really good acts, including ‘Bring on the Thunder’ that was pretty much Jack Black and Tenacious D! Traci Buckle, a first year teacher from Eek I met last weekend, also performed and was really good. Can check out some of her stuff on iTunes. A local guy, Palmer, also recited ‘The Cremation of Sam McGee‘ which as fun, as he was dressed in musher’s gear and had a sled on stage from Casie.

A few teachers attending an in-service in Bethel yesterday had got weathered in so were staying with Sadie, Angie and Erin, so figured we may as well make a night of it after the Just Desserts gig. After a couple of drinks at their house, we then wandered over to Jamie’s (who had some very nice Teachers scotch, something I haven’t had in a long time!) and then onto Sarah’s where even more teacher people were hanging out. With the clocks going back an hour, seemed liked a good night to stay out late!

Met up to have breakfast again this morning and Sadie and the girls said the teachers had all left for the airport hoping to fly out, though they didn’t really know how many actually stayed there last night! They’d just left the door unlocked and let people get on with it. Can’t imagine that working somewhere other than Bethel really! We then found out you can actually fit 4 adults in the back of a car – least I didn’t have to walk home.

I’m now working away on the new K300 website which should be going live in the next week or so. Mike McIntyre from YKHC has been busy working on the design and I’m now figuring out dropping it all into a WordPress template and managing the back-end to allow various people involved in the race to be able to edit parts of the site themselves whenever they want. Is starting to look good and working nicely. The poster I printed out last weekend for Casie turned out pretty well now it’s in the BNC building – she sold a couple of miles pretty much right away whilst putting the poster up, so hopefully that’s continued too!

NFL opening weekend, and heading back to Bethel

Sunday, September 7th, 2008

NFL opening Sunday today, Kat’s thrilled ;-) Seahawks lost big time, but looks like it might not be a great season for them anyways. Some other good games though, and also got the Formula 1 and GP2 recorded this morning to watch the next couple of days when back in Bethel.

After the chaos at Yute Air on Friday, I bumped into Carl yesterday who offered to give me a ride back into Bethel this evening. He’d planned to go moose hunting straight out of town on Friday for the weekend but it fell through, so I’m glad I don’t have to deal with Yute again today! Means I have more of a rest here too, otherwise I’d have been flying back out again around 2p.m.

Packed up a few things to take with me to the new apartment, enough to get through the next week I guess. I’ll be able to look things over and figure out if I need to pick anything else up or bring from here next weekend. Least Swanson’s is really close to bring back anything I need to buy. Tried calling up GCI to get phone, TV and internet sorted, but you have to go to the Bethel office to do it – probably as the address given wasn’t showing up in the Anchorage call center! So, I’ll try to get that done tomorrow lunch time and hopefully they can get it hooked up sometime this week. Kat is due to come into Bethel the following week, so better have TV working by then :-)

WordPress upgraded

Friday, August 29th, 2008

Move along, nothing to see here…

Missed a few upgrades (like three whole 2.x releases), but the blog should be updated to the latest version of WordPress. Always seems to take forever to upload all the files, but everything seems to be working fine. Still think there should be a way to incrementally update things rather than uploading the whole package each time – sure I’d stay more on top of the updates if there was :-)

Featured in Schmap! Anchorage

Sunday, August 17th, 2008

Schmap! AnchorageAfter having a photo selected for the Schmap! Edinburgh guide, I’ve now had two photos included in the guide to Anchorage :-) The first was showcasing the shuttle bus the zoo operates from downtown to the zoo which is a pretty cool deal as it wasn’t exactly the easiest place to find otherwise! The original photo can be found here on Flickr, and the photo in the Schmap! guide is here

Schmap! AnchorageThis second one is of a dall sheep within the zoo, a pretty good closeup given the camera I had at the time! Here’s the Schmap! page with the featured photo, and the original on Flickr. One of my friends on Flickr also has a photo or two listed which is pretty cool.

The mail has been a little hit + miss the last few days with the weather a bit rainy, so Photoshop Elements hasn’t arrived yet – looking forward to touching up the photos from our trips around Anchorage from a couple of weeks ago when it does as really want to get the photos online :-) I’ve also just redesigned iainfoulds.com, the side-arm with a selection of prints available for purchase.

Virtual start to Sunderland’s new season

Friday, August 15th, 2008

SAFC shirtHopefully tomorrow’s opening kickoff of the 2008-2009 Premiership season will be as entertaining as my virtual game in Fifa ’08 on the Xbox 360 this evening – final score was Sunderland 4 – Liverpool 1 :-D Somehow, I think it’s still being slightly optimistic to expect a similar result tomorrow!

I’m going to try watching the match via foxsoccer.com which holds the broadcasts rights over here in the US – our pitiful satellite can’t pick up the actual Fox Soccer Channel, but I’m going to try streaming it online. The first three Sunderland games of the season are being broadcast, and the lads at safc.com have also just fired up the podcast again after doing nothing last season :) Providing the internet doesn’t disappear in the morning, will almost be as good as being at the Stadium of Light with dad having a pint at half time…

Okay, maybe not. But I will have the new strip on that my parents brought over a couple of weeks ago!

Featured in Schmap! Edinburgh

Tuesday, July 29th, 2008

A few weeks ago I was e-mailed to ask if one of my photos on flickr could be shortlisted for inclusion in a Schmap! guide to Edinburgh. I agreed not thinking much of it, as it wasn’t really one of my best – it was taken from a moving tour bus taking us around the city! But, the latest guide was published online and my photo was included for the Dynamic Earth center. It includes a few other photos too for the area, but is still pretty neat to be on there.

My photo on Schmap

They’re also working on an updated guide to Anchorage and another couple of my photos have been shortlisted for inclusion (better ones from the Alaska Zoo this time, so I’ll be quite happy to see them included!) which should be fun to see what happens with those.