RPi and Prop Question
fixmax
Posts: 91
Hi all,
I have a question. I've been tinkering around with the Pi this weekend, since I'm still learning the Linux world and all. I managed to get the Pi to compile and download to the Prop over the USB serial cable (spin binary and pload binary from another post). It seems to work just fine, I can create a spin program in nano, compile it and upload to the Prop from the Pi using the pload binary, just fine. Tried all 3 options, -p1, -p2, -p3, no issues. I'm using a powered hub, and a wireless dongle to connect to the Pi over SSH, and it works really well. I'm using the latest Raspbian (Wheezy). The serial connection uses the ttyUSB0.
The one thing I haven't tested yet is a standalone program in the Pi, that polls for data from the Prop via the same serial port as the upload.
My question is this: If I had multiple Quickstarts for example, that were all USB port powered, connected to the USB hub, I should be able to connect to each Quickstart through its USB port? Say ttyUSB0, ttyUSB1, etc?
Has anyone done something similar? I have dug, and dug, but I just haven't found anything like this, and was hoping someone might be able to point me to a project or post somewhere where someone has done something similar.
My goal is to have the RPi upload all of the code to all of the Prop boards on power up, and then run as a supervisor controller with it's Ethernet and wireless connection usable either standalone or to a PC. This will allow me to use Prop boards without having to go and program them separately.
Any questions or comments I'd love to hear.
Thanks!
I have a question. I've been tinkering around with the Pi this weekend, since I'm still learning the Linux world and all. I managed to get the Pi to compile and download to the Prop over the USB serial cable (spin binary and pload binary from another post). It seems to work just fine, I can create a spin program in nano, compile it and upload to the Prop from the Pi using the pload binary, just fine. Tried all 3 options, -p1, -p2, -p3, no issues. I'm using a powered hub, and a wireless dongle to connect to the Pi over SSH, and it works really well. I'm using the latest Raspbian (Wheezy). The serial connection uses the ttyUSB0.
The one thing I haven't tested yet is a standalone program in the Pi, that polls for data from the Prop via the same serial port as the upload.
My question is this: If I had multiple Quickstarts for example, that were all USB port powered, connected to the USB hub, I should be able to connect to each Quickstart through its USB port? Say ttyUSB0, ttyUSB1, etc?
Has anyone done something similar? I have dug, and dug, but I just haven't found anything like this, and was hoping someone might be able to point me to a project or post somewhere where someone has done something similar.
My goal is to have the RPi upload all of the code to all of the Prop boards on power up, and then run as a supervisor controller with it's Ethernet and wireless connection usable either standalone or to a PC. This will allow me to use Prop boards without having to go and program them separately.
Any questions or comments I'd love to hear.
Thanks!
Comments
If you Pi's power is good and all it should work.
One possible issue is that you may find that the designation of Propellers to USB port numbers changes as things get connected and disconnected. But I'm sure there are ways around that problem if it should arise.
So far I have not had luck with a wireless dongle. Through a HUB or directly. It works but is very unreliable. Still I may be having power issues or just be in need of a Raspian update.
What you ask sounds fine to me, but I don't know linux. Presume your powered hub has plenty of power and your quickstart boards don't have much additional circuitry taking extra power.
Not sure about heater's comment about USB ports changing. This does not happen in Windoze.
Would love you to post details of your complete setup including compiling and downloading on the R-Pi. I am sure others would like this info too.
I am interested to hear if you have tried a direct connection (GPIO serial on the R-Pi to the Prop P30/31 and a GPIO pin for reset - i.e. bypassing the FT232 chip)?
Or with a bunch of USB devices connected it was lottery to tell which dev belonged to which actual device.
This may have been sorted in recent Linux distros aand on the Pi in particular.
In case not there are ways to configure device names to USB ids manually.
Problems I have connecting the prop to the pi is, that you really have to read the data coming from the prop. If there is no receiver (or the receiver does not read in time) the pi USB-driver seems to hang - which also affects the LAN, as it is the same controller.
Interesting program for the pi is this:
http://pyserial.sourceforge.net/examples.html
I tend to add command-line interfaces to the propeller programs, so that you can check what's going on on the prop. This little tool waits on a port for a connection and if available forwards all the traffic to the serial port. This way you can use a putty to connect to the propeller via the pi.
It's also very usefull if you want to connect a web-page to the propeller. That's what I do here: https://github.com/MagIO2/Web2Home---lcars
Yes Linux does change port numbering on re-plugging, BUT after enumeration each USB device reports a unique id. (this is what windows uses for constant com port numbers) You can either search for this ID or modify Linux to use this ID instead of "0", "1", etc to number serial ports. Note: I don't directly have the code to do this, a coworker implemented that fix.
Lawson