Friday, May 9, 2014

It has been months without any idea. With RaspberryPi and my recent interest in Node.js and no interesting ideas around. I decided do a simple project just for fun. Here was the plan:

Listen to the tweets on particular topic, keywords, and from specific users

Convert it to Morse code

Emit the code from sound (beeper) and light (LED) source.

Make it testable without RaspberryPi and offline (using Telnet)

So, I wrote a Node.js based code which can be downloaded from my Github repository naishe/tweemorse the code basically does the following stuffs:

Based on what parameter you passed it either starts to listen to Twitter for the keywords and users that you have configured; or it launches a Telnet server on port 23 where you can sent it a message, and it will translate it.

Once the message arrives it is "queued" in a message queue for processing.

There is a queue consumer that takes the messages one by one and converts them into Morse code.

This Morse code gets read character by character "dit" or "dah" or "white space". (You may know more about Morse code from this Wikipedia article.) Based on the character, the output pin is sent either a HIGH or a LOW signal. Here is a rough idea:

dit: short HIGH

dah: long HIGH

transition between two characters: short LOW

white space: long LOW

HIGH means LED and and beeper on, LOW means they are off.

For more details and instructions look the Github repo. And, finally, here is how it looks when I tweeted a SOS: