Skip to content

e-minor/RapiroWithRaspi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RapiroWithRaspi

The RAPIRO is a programmable DIY robot kit with endless possibilities.Goto the offical website for more information.
'''Arduino sketch'''

Using python-serial to control RAPIRO

  • In order to use the Raspberry Pi’s serial port, we need to disable getty (the program that displays login screen) by find this line in file /etc/inittab
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
And comment it out by adding # in front of it
\#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 


* To prevents the Raspberry Pi from sending out data to the serial ports when it boots, go to file /boot/cmdline.txt and find the line and remove it
console=ttyAMA0,115200 kgdboc=ttyAMA0,115200


* Reboot the Raspberry Pi using this command:
$ sudo reboot


* Now, Install minicom
$ sudo apt-get install minicom
* test it by issuing the following command:
$ echo "#PR255G000B000T050#PR255G000B255T050" | sudo minicom -b 57600 -o -D /dev/ttyAMA0
This should change colors of the eyes only.


* Using Python programming language, you can make Raspberry Pi do many fascinating stuff with the RaPiRo when you are connected. Install Py-Serial first:
$ sudo apt-get install python-serial
$ sudo chmod 666 /dev/ttyAMA0


* Now test it by saving this file as serialtest.py
import serial
import time
ser = serial.Serial('/dev/ttyAMA0', 57600, timeout=1)
ser.open()
ser.write("#PS06A060T001")
time.sleep(2)
ser.write("#PS05A000T030")
time.sleep(2)
ser.write("#PS05A120T001")
time.sleep(2)
ser.write("#PS06A050T001")
time.sleep(2)
ser.write("#H")
ser.close()


* Then run it form terminal issuing this command:
$ python serialtest.py
This should raise the left hand and strike it down again.


* Install Apache2
$ sudo apt-get install apache2 libapache2-mod-python
$ sudo usermod -aG dialout www-data


* Download the files that is needed for the webserver to handle the RaPiRo and copy them to the apropriate directories.
The python cgi script goes to /usr/lib/cgi-bin/:
$ wget https://dl.dropboxusercontent.com/u/54426040/test.py
$ sudo chmod 755 /usr/lib/cgi-bin/test.py


* You should rename that file to rapiro.py but then you also have to change the reference in the code (line 103) to rapiro.py instead of test.py as well.
The CSS syle sheet goes to /var/www/:
$ wget https://dl.dropboxusercontent.com/u/54426040/control.css
The files for the icons should be extracted to the /var/www/ folder
$ wget https://dl.dropboxusercontent.com/u/54426040/Remote.Control.Icons.zip


* Then access the homepage from the webbrowser of your choise using the ip-address of the internal Raspberry Pi WiFi adapter.
http://rapirorpiIP/test.py
or
http://rapirorpiIP/rapiro.py
* depending on if you renamed the file or not. * depending on your apache setup you may need to use:
http://rapirorpiIp/cgi-bin/test.py


# Usage
* Using wifi dongle to get on local wireless network 
* Download the codes
git clone https://github.com/e-minor/RapiroWithRaspi.git 

* running
python server.py 

* Setting on boot startup adding a shell command at rc.local
\# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
  python /home/pi/RapiroWithRaspi/server.py &
fi


* Finally  Deploy [MrRobot](https://github.com/e-minor/MrRobot) to a ubuntu phone and control the robot 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages