Hello. We're artists working through collaborative social practice and creative research to understand the ways in which locality is shaped and enacted in the city.

Parsing RSS Feeds for the Arduino + LCD + PHP project

I’ve made some really great progress on this ongoing Arduino + LCD project over the last couple of weeks — some of the two larger hurdles are now out of the way, the results of which you can see in the video above.

Since the video was shot, I’ve improved the PHP script some more to ensure that the text is properly broken up over the appropriate lines on the LCD and I’ve also removed those strange characters, which were resulting from newlines in the Twitter RSS feed, I think.

IMG 8202 Parsing RSS Feeds for the Arduino + LCD + PHP project

To back up a bit though, I also made two small changes that have had a huge impact on the project. Hopefully, if there are other people having the same problem (that is, that the Arduino IDE Serial Monitor had to be open to allow any Serial data to be sent along to the Arduino / LCD), I’ve sorted it out with two small changes…

IMG 8263 Parsing RSS Feeds for the Arduino + LCD + PHP project

The first change that I made was changing the PHP Serial deviceSet() to /dev/cu.usbserial-A60049S4 from /dev/tty.usbserial-A60049S4. Doing some digging around finally led me to this forum, which notes that “the tty’s are for incoming (to the system) calls; the cu’s are for outgoing (from the system) calls (”cu” == “call unix”);”, citing another mailing list. Anyways, this makes a lot of sense since the Serial is actually listening for outgoing information from PHP, rather than sending incoming information to PHP.

IMG 82541 Parsing RSS Feeds for the Arduino + LCD + PHP project

Secondly, I finally also got a hold of the correct resistor, 120 OHMs to disable the auto-reset of the Arduino upon receiving Serial data.

IMG 8252 Parsing RSS Feeds for the Arduino + LCD + PHP project

I bought a box of a variety of resistors, which will inevitably come in handy down the road, but for now, I was just happy to get the right resistor to get Arduino and the Serial data working together correctly.

IMG 8264 Parsing RSS Feeds for the Arduino + LCD + PHP project

You disable the auto-reset by basically routing from the 5V power to the RESET pin on the Arduino with the 120 OHM resistor in between.

Screen shot 2010 03 30 at 9.03.35 AM Parsing RSS Feeds for the Arduino + LCD + PHP project

As you can see, I’ve also started running the PHP script from the Terminal, which gives me a lot more flexibility to kill the script if something isn’t going right, whereas before, when I was running it from the browser, the script would have to go the entire way through before stopping.

Screen shot 2010 03 22 at 10.46.10 AM Parsing RSS Feeds for the Arduino + LCD + PHP project

I’m using the Magpie RSS Parser, which is really great for grabbing data from Twitter, as Twitter just puts its tweets in the title tags in the XML file of the RSS feed.

Screen shot 2010 03 29 at 1.08.53 PM Parsing RSS Feeds for the Arduino + LCD + PHP project

I was just working on grabbing a variety of different feeds from Twitter to try to make sure I wasn’t going to run into any unexpected character wrapping problems.  In this case, I was looking at the hashtag, #Saturday.

IMG 82601 Parsing RSS Feeds for the Arduino + LCD + PHP project

You can see that some of the HTML output I had coded into the script is a bit less useful now … though I’m thinking of having this thing write its output to a file just to keep track of it over a long duration install.

IMG 82581 Parsing RSS Feeds for the Arduino + LCD + PHP project

I’ve also removed the URLs from the Twitter feeds, replacing them with an ellipses. URLs wouldn’t be much use on a screen like this and they created some difficulties in the line wrapping.

IMG 8217 Parsing RSS Feeds for the Arduino + LCD + PHP project

Another test in the browser, showing incoming data from Twitter.

IMG 8265 Parsing RSS Feeds for the Arduino + LCD + PHP project

And again, on the LCD, a tweet from the Broken City Lab Twitter feed.

Overall, I’m really relieved to have made those two big steps forward in the project. Next on the list is tackling the wireless aspect of this — that is, having an Arduino and LCD wirelessly receiving information for display, and then moving on to dealing with SMS messages, which I’ve written about previously.

Annotated Bibliography

http://www.olate.co.uk/articles/view.php?id=214 (basic Magpie RSS tutorial)

http://www.iknowthe.net/blog/arduino-twitter-lcd-doorsign.html (another example of LCD + Twitter + Python)

http://missionduke.com/arduino-projects/ (some other PHP projects, with some questions about the Serial Monitor problem)

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1262928238 (PHP + Serial pin reset problem)

http://www.arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection (Disabling auto reset on a serial connection on the Arduino)

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1236198283 (wireless LCD Arduino project)

http://rapplogic.blogspot.com/2009/05/arduino-xbee-portal.html (Arduino + LCD + XBee)

http://www.hashbangcode.com/blog/disemvoweling-php-function-1077.html (disemvoweling PHP function)

http://blog.soundsorange.net/2006/08/29/arduino-getting-the-usb-version-up-and-running-on-osx-using-pd/ (distinguishes between cu and tty)

I would like to thank the Canada Council for the Arts for their generous support.

CCFA bar Parsing RSS Feeds for the Arduino + LCD + PHP project

  • Facebook
  • Twitter
  • del.icio.us

Tagged:

Related Posts: Working on the PHP Backend of the Arduino + LCD Project Arduino + LCD + PHP, Part 2 More Arduino + LCD + PHP fun

Previous: « Next: »


3 Responses to “Parsing RSS Feeds for the Arduino + LCD + PHP project”

  1. Amy says:

    hi there
    here some question about how u pull the data from database.
    u made 1 .php file to get the data, and then u also add some code to the arduino C program right? is it the idea how u send database to the arduino?

    thanks in advance :)

    • Justin says:

      Amy, in this case, I’m not pulling any data from a database, just working off of the Twitter feed’s RSS. I haven’t written any code to pull from a MySQL database, just from a text file and then used the Magpie library for the RSS.

      On the Arduino side, yes, there is some code that receives data from the serial port, formats it in terms of starting new lines when appropriate, new pages, and clearing the screen. When the project is done, I’ll post the Arduino code as well.

Leave a Reply






Mailing List


 

  • Facebook
  • Twitter
  • del.icio.us

Recent Comments

  • Justin Langlois: Really glad you feel that way, Josh, because we’ll definitely need your steady hand and good penmanship to get...
  • Josh: I really like the handwriting sample page. It’s an interesting aesthetic on its own.
  • Luciana: Justin, that would would be great!!! On the same subject, I always thought the Peace Project from Detroit could be an...
  • Justin Langlois: I agree with you, Luciana … it doesn’t have to be a bad thing at all, I suppose I was thinking about the...
  • Luciana: It doesn’t have to be a bad thing though :) It reminded me of Haas&Hahn and their Favela painting project from 2006...
  • Cristina Naccarato: Such an epic post, Justin! The map turned out very nicely!
  • darren: It’s was back when the star was still printing the paper down there. I miss those days. Was metal letters. I don’t...
  • MESM: excellent lab thesis keep the experiment going

Archives

Tags