Sunday, August 31, 2014

Raspberry Pi - Python Libraries - Raspbian or Adafruit

Windows 7
Linux 3.1.9adafruit+ armv6l
PuTTY 0.63
WinSCP 5.5.5


Status:
  • 20140830 Working both examples.
ToDo:
  • Choose the " best"  Python API:
    • RPIO?
    • Arduino Nampy? - This library allows you to communicate with your Arduino connected via USB using classes and methods really similar to those in the Arduino framework. Behind the scenes , Nanpy communicates via USB with the server part running as Arduino firmware. 
    • WiringPi?
  • OR use Serial Communication and pass commands to Arduino connected.
Install RPIO lib:
  • cd ~/
  • sudo apt-get install python-setuptools
  • sudo easy_install -U RPIO
  • git clone https://github.com/metachris/RPIO.git
  • cd RPIO
  • sudo python setup.py install
Testing RPIO lib:
  • cd ~/RPIO/examples
  • PWM Servo example:
  • python example3_pwm_servo.py

  • PWM LowLevel example:
  • python example4_pwm_lowlevel.py



Connect Raspberry Pi and Arduino:




  • sudo apt-get install python-serial
  • Call Python console:
  • python
  • >>>import serial
  • >>>ser = serial.Serial('/dev/ttyACM0', 500000)
  • >>>ser.readline()
  • >>>print ser
  • >>>ser.write('3')

Install Arduino lib:

  • sudo apt-get install arduino (see links 4 and 5 below)
References:

Saturday, August 30, 2014

Raspberry Pi - Remote Access - Raspbian or Adafruit

Windows 7
Linux 3.1.9adafruit+ armv6l
PuTTY 0.63
WinSCP 5.5.5


Status:
  • 20140906 OS Crashed. Building from scratch.
  • 20140830 Working Wi-Fi, SSH and VNC (manual start).
ToDo:
  • Autostart of VNCServer it's not working.
Install - Wi-Fi:
  • Login using a keyboard (USB) and monitor (HDMI) connected to the raspberry board: 
  • Default user and password:   pi   raspberry
  • Edit the file /etc/network/interfaces  and change SSID and password of Wi-Fi network. See on the References links (below) how to encrypt the password.

  • sudo reboot
Install SSH Server:
  • Already installed by default.
  • To configure:
  • sudo raspi-config
  • Interfacing Options  -> SSH
  • To access: Putty for Windows.


  • To transfer files: WinSCP (for Windows).


Install VNC Server:
  • sudo apt-get update
  • sudo apt-get install tightvncserver
  • tightvncserver
  • vncserver :0 -geometry 1920x1080 -depth 24
  • Configuring Autostart:
  • Create a file (~/vnc.sh):

  • cd ~/
  • chmod +x vnc.sh
  • ./vnc.sh
  • Connect to Raspberry Desktop using VNC Viewer.

  • Configuring Autostart:
  • cd /etc/init.d/
  • Create a file (/etc/init.d/vncboot.sh)

  • chmod 755 vncboot
  • update-rc.d ./vncboot defaults (or update-rc.d /etc/init.d/vncboot defaults)
  • reboot

References: