Building a PiCy
Forums:
I've been trying to build a PiCy which I can control from my laptop (HP Pavilion G6 running Windows 7). The parts I'm using are mainly from your website: 2 wheels/motors, 4xAA battery holder, voltage regulator and picoborg. My wifi dongle is a Edimax EW-7811UN 150Mbps Wireless Nano USB Adapter and has been set up and used prior to my PiCy attempts. My pi is from RS components and the chassis (perspex) and wire are from a hardware store. Using your guides I've constructed a model of it, however when I try to use your RemoteKeyBorg code to operate it i get no response. My laptop is using Python 2.7.5 and the matching Pygame 2.7 software to run RemoteKeyBorgC and my raspberry pi and picoborg both seem happy running off the battery pack I'm using (4xAA wired with a voltage regulator and on/off switch). It runs RemoteKeyBorgS as an executable file and the terminal comes up with 'You can now turn on the power, press ENTER to continue' then once I have done so and I try to input commands on my laptop keyboard (while both RemoteKeyBorgC/S are running) nothing happens. I'm not sure if I'm missing something obvious or if I have missed a step out but any advice would be appreciated!
piborg
Mon, 08/05/2013 - 18:39
Permalink
Some things to try
ping -t 192.168.0.201
from a command prompt,replacing the IP address 192.168.0.201 with the one from your Raspberry Pi.
Does the ping work, or does it come back with an error?
ping -t 192.168.0.201
from a command prompt,replacing the IP address 192.168.0.201 with the one from your Raspberry Pi.
With the ping still running load
RemoteKeyBorgC.py
and try to move, does the ping get interrupted?RemoteKeyBorgC.py
line 10 should have
broadcastIP
, change the value to your Raspberry Pi's actual IP, e.g.if the Raspberry Pi has an IP address of 192.168.0.201
Sam
Thu, 08/08/2013 - 12:01
Permalink
Update
Thanks for getting back to me so quickly! Your suggestions have been very helpful in narrowing down my issue. I've run a few pings to my pi's IP and all have come back with perfect connections, even when also running the RemoteKeyBorg codes. I do now get a response from my pi when I press the esc key while try to control my PiCy however still no wheel movement. So could it be an issue with my power supply not reaching the motors? The pi still runs off my battery pack so I'm happy that they still have power and that my soldered connections are ok but i can't think what else it could be..?
piborg
Thu, 08/08/2013 - 16:47
Permalink
Wiring
kuydigital
Fri, 12/06/2013 - 10:05
Permalink
Not responding either
Do I use the IP and port I connect to my Raspberry Pi via SSH?
By the way, my wiring is working whenever I use your script "stepper.py". I type a combination of 5,6 & 7 to make it go straight, left and right. But your "RemoteKeyBorgC.py" is not working for me. I might be doing something wrong though, I'm running "RemoteKeyBorgC.py" on SSH and trying to use the arrow keys. :)
piborg
Fri, 12/06/2013 - 12:17
Permalink
RemoteKeyBorg
RemoteKeyBorg comes in two halves, a server and a client.
The server,
RemoteKeyBorgS.py
, must be running on the Raspberry Pi usingsudo
, this will run inside an SSH terminal, remember to press ENTER when you see the messageYou can now turn on the power, press ENTER to continue
before trying to control PiCy.The server should be left running until you are finished using PiCy.
The client,
RemoteKeyBorgC.py
, tries to open a window to catch key presses, therefore it has to be run in a graphical environment.The value for
broadcastIP
is best set to the IP address you are using for logging in via SSH.If you are getting the error
pygame.error: Unable to open a console terminal
this means it cannot render a graphical display, so it will not work.There are three ways around this problem:
RemoteKeyBorgC.py
locally, it should run fine under Windows as well as Linux, but you may need to install Python and pygame first.To setup VNC and RDP
When you are asked for a password enter a login password to use for VNC logins, we recommend the same password you use to login with SSH.
When you are asked if you want to enyet a view-only password, we recommend you reply no (
n
).To connect to the Raspberry Pi graphically you can use Remote Desktop Connection on windows, or you can use a VNC program such as TightVNC.
To use X11 forwarding over SSH
You will need an X11 server program on the machine you are SSHing from.
If you are using Linux this will mostly likely be setup already.
If you are using Windows you will need to install an X11 server, we would recommend using Xming.
You will also need to enable X11 forwarding on the SSH program used, see the attached image if using PuTTY.
kuydigital
Sun, 12/08/2013 - 14:44
Permalink
I'll try this out
Now, this is clear! Thanks for the clear instructions.
kuydigital
Mon, 12/09/2013 - 04:32
Permalink
Mac OS X
Can you give instructions on how to use RemoteKeyBorgC.pyn on a Mac? Thanks!
piborg
Mon, 12/09/2013 - 10:29
Permalink
OSX bits
You should just need Python and pygame installed for the script to work, both seem to provide Mac OS X compatible versions so it should be simple enough.
Unfortunately I do not have a Mac to test it with though.
If you need SSH to perform X11 forwarding you need to use the
-X
switch (the same is true for Linux), e.g.ssh -X pi@192.168.0.100
kuydigital
Mon, 12/09/2013 - 12:39
Permalink
Difficulty
I'm having difficulty installing Pygame on my Mac OS X 10.5.8 with Python 2.5.1. I've downloaded "pygame-1.9.1release-py2.5-macosx10.5.zip" and it's giving me an error "You cannot install pygame 1.9.1release on this volume. pygame requires System Python 2.5 to install."
I tried several times and I'm stuck. :( Anyway, not your problem but I would appreciate an advice.
Just in case nothing works for me. Is it possible to write a script that runs on Terminal and responds to key presses? :D
piborg
Mon, 12/09/2013 - 13:13
Permalink
Alternatives
It sounds like there is a copy of Python provided by Apple and that it is not entirely compatible with the normal download copy of Python.
Do you know which you are using?
I would try using the X11 forwarding on SSH, that way the program runs on the Raspberry Pi itself:
ssh -X pi@192.168.0.100
then load the RemoteKeyBorgC script, if it works then the pygame screen should appear.
Someone else has suggested if the
-X
switch does not work to tryssh -Y pi@192.168.0.100
instead.
The Raspberry Pi should already have pygame installed if you are running Raspbian.
kuydigital
Mon, 12/09/2013 - 16:11
Permalink
Finally, it works!!!
Thanks piborg! This is what I did:
Using Mac OSX Terminal:
Step #1
1) Open Terminal
2) SSH to your Raspberry Pi
3) Type: sudo python RemoteKeyBorgS.py
Step #2
1) Open another Terminal window
2) Type: ssh -X pi@XXX.XXX.X.X
3) Type: su - pi
4) Enter your password
5) Type: python RemoteKeyBorgC.py
piborg
Mon, 12/09/2013 - 16:50
Permalink
:)
Glad to hear it can be made to work properly on Mac OS X :)
kuydigital
Tue, 12/10/2013 - 04:14
Permalink
Simple & Easy
Not to mention that it's simple and easy. Now I can easily navigate my rover anywhere with the Pi camera and RemoteKeyBorg. Great job piborg!