no luck with that. I entered /dev/ttyUSB0 as the parameter and only got to the first print statement. MAybe the problem is that I have mutiple other devices connected at the same time as my robot? I need at least a keyboard to start the program. What do you think?
You don't need a keyboard for the raspberry. Simply attach it to your internet-router and you can use any computer to Login via SSH. (You can also use an X-client to see the whole raspberry desktop).
That's my setup.
What is the exact code you are trying to use? If you are using the example C program from the 2nd post then the value for the port is hard coded into the program. It really doesn't mater what is entered as the port on the command line since that is just echoed to the terminal screen and isn't actually used. With a few tweaks to the program it COULD use the parameter from the command line. As it sits now all those initial lines that deal with argc, argv, etc can just be removed. They aren't needed.
The command that heater mentioned should show you a list of what USB devices are found. Your Propeller board may be 0 or it could be a different # depending upon what else you have plugged in. When you say things didn't work it would help if you replied with the command you used and the output so we could try and figure out why. Without seeing the output we don't know if you just had a typo or something else is going on.
There were some know USB issues with the Raspberry Pi but a lot of them were fixed in the latest kernel releases so make sure you run the update commands so you have the latest code on your system.
I just retried the program and I think I may have found the problem. For some reason the open("dev/ttyUSB0") command is not opening the connection to the usb port and I know USb0 is the right path. When the program runs it pauses at the open command as if it is trying to open the port but cannot. I have waited for two minutes yet the program seems not to want to open it.
I just retried the program and I think I may have found the problem. For some reason the open("dev/ttyUSB0") command is not opening the connection to the usb port and I know USb0 is the right path. When the program runs it pauses at the open command as if it is trying to open the port but cannot. I have waited for two minutes yet the program seems not to want to open it.
Don't forget to use a full file name open("/dev/ttyUSB0") ... maybe you did it right though. What do you see if you say $ ls /dev/ttyU* ?
Is it possible that another program is using the port with exclusive access? Use $ ps -ef "name" to look for programs of name that might have access.
didn't know that, most of programming with c I have has been done via Visual C++ for windows. I only started gcc and linux program about a month ago. Well that kind of rise another problem. I want the program to start immeideatly after start up. Could this be acheived?
The Kerninghan/Ritchie text is by far the best resource for C...
It could help in your future programming endeavors using standard ANSII C variants like gcc on Linux or Unix boxes. Your questions about "&" and using command-line arguments are well-answered along with in-depth descriptions of all ANSII C features. It will be a great reference, that should help in honing-down your forum queries to get even more helpful results.
On starting programs immediately after start up (on the Raspberry Pi)... There are several forum threads at raspberrypi.org forum. Here's one:
The RaspberryPi forum as well as the Debian.org Wiki (The recommended RaspberyPi OS, Raspian is a form of Debian Linux!) are full of threads explaining solutions for common queries concerning the RaspberryPi operating system. I found a great example of how to run my temperature probe Python script, using crontab to "automagically" kick it off throughout the day. /etc/rc.local and /etc/init.d provide several methods for auto-launching scripts, compiled code and apps, at will!
I just thought of something. In an earlier post RobotWorkshop stated that there was some know issues with the pi when it came to usb. Perhaps this could be the problem. I aquired my pi in december and it runs debian 6. Has there been inssues with Usb on that operating system. if so what updates should I use to fix them.
Got my Pi earlier than you and the code I posted is written because of that USB problem. As I said my setup is a little different from your's -> no other devices on the USB port.
In my setup with the early Debian I had Problems as well. Not as massive as your problems, because the programs worked but from time to time there were transfer errors and after a while USB totally hung and it was also killing the Network Interface. (If I remember right the same chip is responsible for USB and Network)
Do you have a chance to test the code with the actual Debian version?
something very strange happened when I ran the code after doing the updates. Code is returning the port failed to open message even though I have the right path entered in both the code and the parameters. Is there any reason for this
I am thinking about retrying libusb. I think what was throwing me off was That I did not know what DEV the prop plug I was using was. But that raise a problem. I don't know the device type for propplug which how they identified the dev in most of the example I have seen. If it is posible to do using the device id or device number, please tell me how. I got most of the program finish save that
Comments
That's my setup.
The command that heater mentioned should show you a list of what USB devices are found. Your Propeller board may be 0 or it could be a different # depending upon what else you have plugged in. When you say things didn't work it would help if you replied with the command you used and the output so we could try and figure out why. Without seeing the output we don't know if you just had a typo or something else is going on.
There were some know USB issues with the Raspberry Pi but a lot of them were fixed in the latest kernel releases so make sure you run the update commands so you have the latest code on your system.
Don't forget to use a full file name open("/dev/ttyUSB0") ... maybe you did it right though. What do you see if you say $ ls /dev/ttyU* ?
Is it possible that another program is using the port with exclusive access? Use $ ps -ef "name" to look for programs of name that might have access.
Not to be a nag but, you should check out:
http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=Brian+W.+Kernighan%2C+Dennis+M.+Ritchie+The+C+Programming+Language+&rh=i%3Aaps%2Ck%3ABrian+W.+Kernighan\c+Dennis+M.+Ritchie+The+C+Programming+Language+
The Kerninghan/Ritchie text is by far the best resource for C...
It could help in your future programming endeavors using standard ANSII C variants like gcc on Linux or Unix boxes. Your questions about "&" and using command-line arguments are well-answered along with in-depth descriptions of all ANSII C features. It will be a great reference, that should help in honing-down your forum queries to get even more helpful results.
On starting programs immediately after start up (on the Raspberry Pi)... There are several forum threads at raspberrypi.org forum. Here's one:
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=27&t=10154&p=114987&hilit=launch+program+on+startup#p114987
The RaspberryPi forum as well as the Debian.org Wiki (The recommended RaspberyPi OS, Raspian is a form of Debian Linux!) are full of threads explaining solutions for common queries concerning the RaspberryPi operating system. I found a great example of how to run my temperature probe Python script, using crontab to "automagically" kick it off throughout the day. /etc/rc.local and /etc/init.d provide several methods for auto-launching scripts, compiled code and apps, at will!
I hope this helps!
dgately
In my setup with the early Debian I had Problems as well. Not as massive as your problems, because the programs worked but from time to time there were transfer errors and after a while USB totally hung and it was also killing the Network Interface. (If I remember right the same chip is responsible for USB and Network)
Do you have a chance to test the code with the actual Debian version?
The latest Raspian version is dated 12/12/2012... You can update the OS by doing the following on the command line:
For firmware updates, you can use "rpi-update". See this page: Hexxeh/rpi-update · GitHub
dgately
Better to use the latest raspian.
You mentioned having other things connected to your Pi. For these experiments I would start with only the USB serial, keyboard and mouse.