Pi Lite

From SingletonMillerWiki
Revision as of 17:53, 22 December 2013 by Martin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


The Pi-Lite is an LED matrix display designed for scrolling text and graphics. It connects directly into the Raspberry Pi GPIO ports and requires no hardware hacking [1]

Starting Point

The following assumes you have a working RPi set-up with the default user, see Setup_NOOBS. Your RPi is connected to the internet ans is up to date.

Installation

The Pi-Lite developer provides the full documentation [2] and user guide [3]

The following assumes you are logging into your Raspberry Pi via ans SSH terminal Enable_SSH#Connect_via_SSH_on_a_Local_network

Access to the serial port

By default the Raspberry Pi’s serial port is configured to be used for console input/output. Whilst this is useful if you want to login using the serial port, it means you can't use the Serial Port in your programs. The Pi-Lite requires access to the Serial Port.

To enable the serial port for your own use you need to disable login on the port. There are two files that need to be edited '/etc/inittab' and '/boot/cmdline.txt'

Edit 'inittab' and comment out the line 'T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100' using the '#'. Its at the end of the file

sudo nano /etc/inittab

Edit 'cmdline.txt' and delete the highlighted section dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

sudo nano /boot/cmdline.txt

Reboot your Pi.

sudo reboot

Minicom

Install minicom

sudo apt-get install minicom

Serial Port Access Group : DialOut

Add the pi user to the dialout group

sudo usermod -a -G dialout pi

GIT the code

Install the required tools

http://openmicros.org/index.php/articles/94-ciseco-product-documentation/raspberry-pi/303-pi-lite-setting-up-for-python-examples

sudo apt-get install git python-serial python-setuptools
sudo easy_install pip
sudo pip install arrow
sudo pip install --pre xively-python

Clone the Pi-Lite GIT repository

cd ~ && git clone git://github.com/CisecoPlc/PiLite.git

Twitter Feed Installation

The Twitter module installation is a bit more involved

git clone git://github.com/bear/python-twitter.git
cd python-twitter
sudo pip install -r requirements.txt
python setup.py build
sudo python setup.py install

http://openmicros.org/index.php/articles/94-ciseco-product-documentation/raspberry-pi/298-pilite-twitter-feed

Example Python Programmes

List the examples with

ls -l ~/PiLite/Python_Examples/
-rwxr-xr-x 1 pi pi  1622 Dec 23 00:36 Bargraph_tk.py
-rwxr-xr-x 1 pi pi  7117 Dec 23 00:36 BarScroll.py
-rwxr-xr-x 1 pi pi  3232 Dec 23 00:36 BarUpDown.py
-rwxr-xr-x 1 pi pi   646 Dec 23 00:36 Pacman.py
-rwxr-xr-x 1 pi pi 29151 Dec 23 00:36 PiLiteEmulator.py
-rw-r--r-- 1 pi pi  1635 Dec 23 00:36 PiLiteLib.py
-rwxr-xr-x 1 pi pi  1146 Dec 23 00:36 PiLiteStock.py
-rwxr-xr-x 1 pi pi  1898 Dec 23 00:36 PiLiteTwitter.py
-rwxr-xr-x 1 pi pi   874 Dec 23 00:36 PiLiteWeather.py
-rwxr-xr-x 1 pi pi   720 Dec 23 00:36 PiLiteWorldTime.py
-rwxr-xr-x 1 pi pi   931 Dec 23 00:36 PiLiteXively.py
-rw-r--r-- 1 pi pi  1895 Dec 23 00:36 ReadMe.txt
drwxr-xr-x 2 pi pi  4096 Dec 23 00:36 twitter
-rwxr-xr-x 1 pi pi   913 Dec 23 00:36 VUSample.py
-rwxr-xr-x 1 pi pi   655 Dec 23 00:36 VU_tk.py

Run any of the examples using the script name

python ~/PiLite/Python_Examples/PiLiteWeather.py

Using Minicom

Access the serial port using

minicom -b 9600 -o -D /dev/ttyAMA0
Welcome to minicom 2.6.1

OPTIONS: I18n 
Compiled on Apr 28 2012, 19:24:31.
Port /dev/ttyAMA0

Press CTRL-A Z for help on special keys

Short phrases can be types to the terminal, due to the timeout longer phrases should be pasted from a text file, try this The quick brown fox jumped over the lazy dog.

To exit the terminal press CTRL-A then x to access the quit prompt.

Developing your own uses

The Pi-lite developers offer a user graphical interface for emulating the Pi-Lite, thisi is useful for development and experimentation.

http://openmicros.org/index.php/articles/94-ciseco-product-documentation/raspberry-pi/305-pi-lite-python-emulator

see 'Python_Examples/PiLiteEmulator.py'

Known Issues

  1. 'PiLiteXively.py' does not work and throws an error
python ~/PiLite/Python_Examples/PiLiteXively.py
Traceback (most recent call last):
  File "/home/pi/PiLite/Python_Examples/PiLiteXively.py", line 42, in <module>
    main()
  File "/home/pi/PiLite/Python_Examples/PiLiteXively.py", line 34, in main
    source = XivelyDatastream(44519)
  File "/home/pi/PiLite/Python_Examples/PiLiteXively.py", line 24, in __init__
    self.api = xively.XivelyAPIClient(conf.get('xively', 'apikey'))
  File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'xively'

References

  1. Pi-Lite - Lots of LEDs for the Raspberry Pi
  2. Pi-lite documentation
  3. Pi-Lite set-up user guide