The Software Downloads required are:
1. Phoenix / Live Suite, Live suite is for MAC and LINUX and Phoenix is for Windows
2. An Operating System / Firmwareto Boot on CubieBoard preferably Ubuntu Flavoured
a. Cubieez (I am Using this for this Project) around 550MB (prebuilt X11VNC)
b. Cubian
c. Lubuntu and more..
3. A Putty SSH Client to SSH into the CubieBoard.
4. Termite a serial terminal emulator or any other client
5. Advanced IP Scanner or Angry IP Scanner
We need a Linux and preferably an Ubuntu based operating system on which we can run python and use serial and socket connection to constitute a TweeterBie.
The step by step procedure for the above task is available in websites for CUBIEEZ or in other OS related websites.
In my configuration I had No Spare Mouse or Keyboard, No Ethernet Connectivity, only a Wi-Fi Dongle and a USB to RX-TX Converter with connecting wires
Fig. 1: Image showing Wi-Fi Dongle and USB to RX-TX Converter
Fig. 2: Image showing connections of USB to RX-TX Converter with Cubieboard A20
Programming
Arduino
It is assumed that reader gone through how to start with arduino and LCD interface with arduino .
It’s a common knowledge to choose Arduino for most of the embedded systems due to its simplicity in programming and vast amount of resources to get the most in small duration of time.
Fig. 3: Screenshot of Arduino IDE showing navigation to sample code for Liquid Crystal Display
Fig. 4: Image of Cubieboard A20 and Arduino based TweeterBie showing initial messages
Now we will need a way of communicate with the Arduino and send data.
python
Once the terminal changes to python port as >>>
It signifies that PYTHON is installed now to exit the prompt use
>>>exit()
There is a tool called pySerial which can be used for the purpose of serial communication. More documentation can be found here
Now, before we install pySerial we need PIP to be installed. This makes it easier to install the python libraries in the repositories.
To install PIP follow the instructions
Once you install pySerial you can use the miniterm which comes along with it.
Ø python -m serial.tools.list_ports
this will list the available ports
This Introductory tutorial gives a good idea on how to use the pySerial.
My Arduino is connected through USB.
Fig. 5: Prototype of Cubieboard A20 and Arduino based TweeterBie
So the output of the previous command will now be:
Fig. 6: Screenshot of Mini Term application showing python commands
Ok let’s fire up mini term with port ttyUSB0 and baud rate of 9600. Make sure you run it in root.
The command for that is python -m serial.tools.miniterm <port name>
sudopython -m serial.tools.miniterm/dev/ttyUSB0
or
sudopython -m serial.tools.miniterm–p /dev/ttyUSB0 –b 9600
Fig. 7: Screenshot of Mini Term application showing execution of python commands
Whatever you type it will be displayed on the LCD. (It’s “HELLO” the O is right behind…)
Fig. 8: Image of Cubieboard A20 and Arduino based TweeterBie showing a received tweet
Configuration
Ok since the Display part is up and running we will configure the TWEETER part of TweeterBie.
The following can be done directly from the CubieBoard but I am doing this on my PC.
In order to access the tweets we need to establish a connection to twitter servers, authenticate ourselves as the user as well as the CubieBoard device and use API calls to get the latest tweets. The tutorial mentioned below deals with just that from basics.
In order to create access to TweeterBie go to https://dev.twitter.com/ and sign in with the Twitter credentials.
As we are using Python for coding and there is well built API library for Twitter access in python it’s called TweePy, for more info TweePy use this documentation and this Auth tutorial.
You may also like:
Project Source Code
###
#include// already there in the sketch for LCD display // initialize the library with the numbers of the interface pins LiquidCrystallcd(12, 11, 5, 4, 3, 2); charinData[141]; // Allocate some space for the string max of 140 charcters in Tweets charinChar; // Where to store the character read from serial port byte index = 0; // Index into array to point the memory location bytebytesrecvd = 0; // counter to check the incoming bytes void setup() { Serial.begin(9600); // Serial Port to send the characters to be displayed Serial.write("Power On"); // Power up Signalling on the Debug port after establishing connection lcd.begin(16, 2); // set up the LCD's number of columns and rows lcd.print("hello, world!"); // Print a message to the LCD Sample from old sketch delay(1000); // Time lag until message is read out of the LCD lcd.setCursor(0, 0); // Set LCD cursor to Home Position. index = 0; // Set character Indexing position to nil (zero) lcd.setCursor(0, 0); // bring back cursor to home lcd.print("Latest Tweet: "); // Display the Header on First Line lcd.setCursor(16, 1); // Go to last column of the Second line and wait for Characters to appear. } // This ends the Setup of the Arduino , Now to create the Super Loop void loop() { index = 0; // always reset to zero at the beginning of data reception while(Serial.available() > 0) // Don't enter the section unless data is available to read { if(index < 140) // One less than the size of the array get only 140 characters { inChar = Serial.read(); // Read a character inData[index] = inChar; // Store it in “inData” array index++; // Increment where to write next increment the index inData[index] = ''; // Add terminating character (Null character) for the next position delay(5); // give 5 milliseconds gap to avoid data corruption bytesrecvd = index; // get the total count of bytes received } } // keep loping until data is available lcd.clear(); // now clear the LCD of previous Data lcd.setCursor(0, 0); // Go to Home Position lcd.print("Latest Tweet: "); // write the latest tweet header on first line lcd.setCursor(16, 1); // go to end of line on second row lcd.autoscroll(); // start auto scroll (the problem is it will rotate both rows) for (intthisChar = 0; thisChar ###
Circuit Diagrams
Circuit-Diagram-Cubieboard-A20-Arduino-Based-TweeterBie | ![]() |
Block-Diagram-Cubieboard-A20-Arduino-Based-TweeterBie | ![]() |
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.