Linux Bash - Command line serial to propeller
nathantrantham
Posts: 5
Hi everyone,
I'm attempting to use the command line with Ubuntu to communicate using serial to the prop.
For instance, I would love to do: echo "text" >> dev/ttyUSB0 from the terminal and have the propeller receive it.
Has anyone tried this before? If so, is there a preferred serial object I need to use (e.g. Full Duplex, Simple Serial, etc)? I've read about people trying this with arduino and the basic stamp, but I can't find anything related to the prop.
Thanks - any help is much appreciated.
Nathan
I'm attempting to use the command line with Ubuntu to communicate using serial to the prop.
For instance, I would love to do: echo "text" >> dev/ttyUSB0 from the terminal and have the propeller receive it.
Has anyone tried this before? If so, is there a preferred serial object I need to use (e.g. Full Duplex, Simple Serial, etc)? I've read about people trying this with arduino and the basic stamp, but I can't find anything related to the prop.
Thanks - any help is much appreciated.
Nathan
Comments
I've written a fast Forth for the Prop which has a lot of shell-like commands that are executed from the serial terminal, you can even telnet (see my sig) into one of my units and do an "ls" then pick a text file and "cat <name>" etc.
And you may find that initially only the Superuser has rights to the serial port.
If you want your normal account to reach the USB serial, you will have to figure out how to add yourself to the group that has rights.
I prefer Mincom for reaching the Propeller (and I too am a Forth user).
PuTTY is more powerful, more feature rich. It may just make you feel lost if you are not deep into communication choices as it does a lot more than just a Serial Port. It also does SSH over the LAN or the internet.
Minicom does have a capture to file feature for data streamed from the serial port that is active. But again, you might have BASH do all that, if you prefer.
Things like:
$ echo "text" > /dev/ttyUSB0
$ cat /dev/ttyUSB0
work just fine.
Provided:
1) You have the permissions to access the port. You may need to run as root or set the port permissions before use or be a member of the "dialout" group. Up to you.
2) The port is configured to with the right baud rate and protocol settings for what ever is connected to the other end of the link.
That can be done with the "setserial" command. See this Ubunto discussion about it:
http://ubuntuforums.org/showthread.php?t=1609727
On the Propeller end I would simply use the FullDuplexSerial Spin object.
Welcome to the forum by the way.
Then you can use C-a C-s to send a file. Otherwise, it operates as a simple console.
Peter - thanks for your Forth suggestion, but for the moment that is out of my league and more than I was looking to get into.
Loopy and SRLM - thanks for the tip on those serial monitors. I definitely like minicom and picocom. Great suggestions.
Loopy and Heater - thanks for the reminder about root admin. I'm new to linux, so it was easy to forget. I believe this was the issue because I now have it working perfectly fine with the echo "text" >> /dev/ttyUSB0 method. I was also able to make it work with minicom and picocom.
Thanks!