Arduino with Puppy Linux

Hi all,

I'm trying to get an Arduino Diecilima board to communicate with Pure Data running on Puppy Linux. My problem seems to be getting the /dev/ttyUSB0 setup. I've already uploaded the Pduino firmware to the board using another PC so I don't nesseseraly need to get the Arduino IDE running on Puppy. I'm a newbie to both Linux and Arduino, I've few searches but with no joy. If anyone could point me in the right direction that would be great!

Thanks Alex

Newer versions of the Linux kernel should include support for the FTDI chip on the Arduino board. Do you see /dev/ttyUSB0 appear when you plug in the board and disappear when you unplug it? Or is there another file that does?

Hi Mellis

Thanks for your reply, /dev/tty/USB0 dosen’t appear within the Arduino IDE once the board is plugged in. However, the IDE isn’t correctly installed as I could not install avr-gcc, so I’m not sure if that’s affecting things. Within the USB viewer I believe the chip is listed as FT232R in red text which appears and disappears when the board is plugged in/unplugged. I’m using Puppy 2.15.

Thanks
Alex

You shouldn’t need avr-gcc if you just need to communicate with the board (not compile programs for it). Does USB viewer tell you which device the FT232 is on (i.e. a file in /dev/)? If you can figure that out, then you should try a test to see if you can get data from the board to the computer. Try (on the Windows machine) uploading the ASCII Table example (in Communication). Then, under Linux, try doing a:

cat

where is the device of the Arduino. You should see data arriving. If that doesn’t work, try:

screen 9600

(you’ll have to press ctrl-a ctrl-\ to exit).

USBview dosen't tell me which device the FT232 is on. I did try this in a terminal

modprobe ftdi_sio

echo ftdi_sio >> /etc/modules

Which was suggested by this post http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1129025529/15 the text went from red to black and gave me a name ftdi_sio

I uploaded the ASCII example and tried what you suggested using the location of the ftdi_sio.ko file. But no joy. With your second suggestion, do I need to install a particular package to get 'screen' to work as I'm getting a command not found msg in the terminal.

Thanks Alex

It's not the module that you need to find, but the device file created by that module for other programs to communicate with the board. Look in /dev/ for a file that only appears when you connect the board. It might be called something like tty.usb or ttyUSB or maybe it would have ftdi in the name. I'm not sure.

I found a file in /dev/usb called ttyUSB0 but its always there, whether the board is connected or not. It seemed to work though, I typed cat ttyUSB0 and the terminal printed the ASCII characters whilst the TX and RX lights flashed on the board.

Thanks Alex

Cool.

That's great! I created a symbolic link to the ttyUSB0 file from within /dev/ now Pure Data recognises the board. Just one problem remains, I have to type modprobe commands above each time I reboot, do you know how I could make puppy recognise the FT232 chip permanently.

Thanks very much for your help so far, Alex

That I don't know, but maybe someone here with more Linux experience than me can help. Anyone?

how I could make puppy recognise the FT232 chip permanently.

not sure why it doesn't already, but I'm not familiar with that distro of linux.

Whatever modprobe commands you issue, put them at the end of /etc/rc.local (if it exists on your distro). That way they'll get executed every time the system boots.

-j

Hi,

That did the trick, thanks very much!

Alex

Hi guys, I've followed this topic as I'm in the same position (although Puppy 2.13) as just before alexaudio got things working. i.e. I think I'm at the point where the Arduino Diecilima has been detected on USB (black text). Pupscan tells me ftdi_sio and usbserial loaded fine with modprobe.

Typing cat ttyUSB0 after cd'ing to the location doesn't seem to do anything.

Using SimpleMessageSystem and Arduino2PD I seem to able to connect to /dev/ttyS2 and /dev/ttyS0 which are serial port connections? I tried putting a symlink to ttyUSB0 in /dev, but no luck.

Checked /var/log/messages and it says:

kernel: usb 1-2: new full speed USB device using ohci_hcd and address 4 kernel: usb 1-2: configuration #1 chosen from 1 choice kernel: usbcore: registered new driver usbserial kernel: drivers/usb/serial/usb-serial.c: USB Serial support registered for generic kernel: usbcore: registered new driver usbserial_generic kernel: drivers/usb/serial/usb-serial.c: USB Serial Driver core kernel: drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI USB Serial Device kernel: ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected kernel: drivers/usb/serial/ftdi_sio.c: Detected FT232BM kernel: usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0 kernel: usbcore: registered new driver ftdi_sio kernel: drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver

that all looks fine right?

Any help would be much appreciated.

I noticed this topic has had quite a few views so I thought I'd post the solution to my problem.

Using Arduino2PD, the problem was the "Comport" object in PD, it could only select serial port connections by number. So I changed tty0 to a symlink to ttyUSB0 and now when I open a connection to 0 using Comport it finds Arduino there. After backing up I did this:

# rm /dev/ttyS0
# ln -s /dev/usb/ttyUSB0 /dev/ttyS0

then tested it

# less -f /dev/ttyS0

Thank you so much for this help - I was really at a dead end with Puppy Linux and Arduino, but this saved me!

To summarise this discussion, the following worked for me (on Puppy 3.01):

cp /dev/ttyS0 /dev/ttyS0Backup

rm /dev/ttyS0

ln -s /dev/usb/ttyUSB0 /dev/ttyS0

modprobe ftdi_sio

echo ftdi_sio >> /etc/modules

I have found only the following line needs to be called every bootup (actually not every single boot for some reason, but to be save its easier every boot):

modprobe ftdi_sio

Also, for other Puppy Linux Nubies (like me) - USBview is pre-installed - under Start->System->USBView. Or 'usbview' from a terminal (all lowercase).

Oh, and if you want to compile in Puppy Linux, its no where near as hard as you think:

A quote from http://www.puppylinux.com/download/release-3.01.htm (near the end - search for 'devx_301.sfs').

Note, file 'devx_301.sfs' is what we call a SFS module, which is a "combo-pack" of applications in a single file. It can be loaded at bootup and you instantly have all the apps "installed". Or, not load it at bootup and all the apps are immediately "uninstalled". Normally, you just download a SFS file to /mnt/home then reboot Puppy, and it automatically loads. Note: it is reported on the Puppy Forum that SLAX .mo modules work with Puppy -- just rename the '.mo' file extension to '.sfs' -- no guarantees though!

A note on the kernel source: If you want to compile a module, or a package that needs to reference the kernel source, we have the kernel source available as an SFS file. Download 'devx_301.sfs' and 'kernel_301.sfs' to /mnt/home then reboot Puppy and you're in business (that's how simple SFS files are to use, but note you can manage loading of SFS files by running the BootManager (System menu)). Get the official SFS files from here:
http://distro.ibiblio.org/pub/linux/distributions/puppylinux/sfs_modules-3/

Once you reboot, you unzip the serproxy source code, open a terminal in that directory and type 'make' and bam - a serproxy executable is born!

I found I had to compile serproxy for linux so I could talk to flash - no binary versions of serproxy available.

You can get the standalone flashplayer 9.0.115 for linux (http://www.adobe.com/support/flashplayer/downloads.html), which you can use to load swfs and then create an executable projector from them. This is vital - for some reason, only the executable projector versions can communicate with serproxy - even if I use LocalContentUpdater on the swfs to give them network access, they don't work.

The result is pretty cool - my flash app running on a US$195, 500MHz Computer (the size of 4 CDs in Jewel cases stacked up) with no moving parts - booting Puppy Linux off a Compact Flash card pretty quick, and all being controlled by an Arduino.

Not quite finished the project yet - ironing out a few bugs: - the carriage return at the end of the Arduino data is treated as 'end of data' by linux, but treated as an 'end of line' by windows. - And gotta optimise it for a 500MHz PC. But I am pretty excited by the results so far.

The sample-rate (I'm assuming this is the correct terminology/word) is very slow when reading values from analogue pots. I've tried a few different baud rates but no change, values are only read about every 50 to 100ms.

Any ideas?