Studio Contrechoc

design & textile & technology entries

Linux Ubuntu…serial things

Being relatively new to linux and having a double boot on my MACBOOK, MACOS and XP, I configured finally an old laptop with Ubuntu 9.10.

Then using the Synaptic I installed the python things I needed: numpy and scipy. I had to install ImageTK too to run cad.py.

then get nearer to the serial ports:
using synaptic you can install setserial.

(is this really needed? Later I found sstty:
http://tldp.org/HOWTO/Serial-HOWTO-12.html#stty_ )

then I found this link:
http://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/

usefull commands are (in the terminal window):
sudo chmod 777 fileName to give all rights to fileName, asking for the admin or root password

then listing the ports:
ls /dev/tty*

then
$ dmesg | grep tty
like in the linked page, this gives info on tty0

returning to setserial:
setserial -g /dev/ttyS[012345] (“info about how the device driver is configured for your ports”)
give a list of possible ports… not so much as ls /dev/tty* because these are not physical ports.
setting the portspeed…i still have to find that one.

Back to stty:
stty -a immediately gives the portspeed
$man stty gives the control possibilities:
“number      Set terminal baud rate to the number given, if possible.  If
the baud rate is set to zero, modem control is no longer
asserted.”

which means setting to 9600: stty 9600
% stty -F /dev/ttyUSB0 57600 for the specified port

For the rest I found this page: talking to the arduino ( apparently a virtual serial port)
http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/

From this I read something about “screen”, to get the serial data from arduino/atmega
$ screen /dev/ttyUSB0 57600 opens a port a that indicated speed

http://embeddedfreak.wordpress.com/2008/08/12/using-gnu-screen-to-debug-your-serial-port/

http://www.tigoe.net/pcomp/resources/archives/avr/000749.shtml

this is a useful page for starters with linux like me…:
http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html

about file permissions:
https://help.ubuntu.com/community/FilePermissions

related: terminal commands and examples for MACOS: http://ss64.com/osx/
This helped me with a locked USB stick (read only)
in the terminal: diskutility eraseDisk UFS UntitledUFS disk1
after you have found the “disk1” with (in the terminal):diskutil list

now on MACOS there is “the same” terminal. Here is a link to all the commands:

http://ss64.com/osx/

 

 

 

 

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: