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:

Saturday, April 5, 2014

This article shows how to do it on an Ubuntu machine. But the procedure will be the same on all the Unix and Linux machine. You will need to look for equivalent command for Windows platform. Essentially, this is what I am doing:

Formatting and copying Raspbian OS to the SD card

Editing /etc/network/interfaces file

Putting the SD card in Pi and plugging it to router.

SSHing to Pi and running a couple of commands

This post is geared towards getting Raspberry Pi set up to work from network.

You will not need a separate keyboard or monitor for installation and setup.

We have mask, and gateway from last command. We know that the IP is going to be in 192.168.2.X series. So, lets assign 192.168.2.42 to RasPi. To do this, we need to edit /etc/network/interfaces on the Raspbian OS ***in the SD CARD** which is located at /media/nishant/fc254b57-8fff-4f96-9609-ea202d871acf/etc/network/interfaces. MAKE SURE YOU DO NOT END UP EDITING YOUR UBUNTU'S CONFIG.