I want to read data from a campbell data logger using an arduino yun. The simplest route I can think of is by using the pycampbellCR1000 module through python. This can read data and store information locally etc. I can get the module to work on my computer but not on the arduino yet. The connection I have set up is:
data logger RS232 --> RS232 to USB converter --> USB-A host on Arduino.
The command I run through the serial monitor is (which works on computer):
...* pycr1000: error: [Errno 21] Is a directory: '/mnt/sda1'
It seems like the arduino is mounting the data logger as a directory rather than serial connection. When I run the command on my computer the path I provide is /dev/ttyUSB0. Is there a path to the USB-A host on the arduino I can use for serial connections? Or more generally, how can I run the command above in the arduino to retrieve info from the data logger?
hudsona:
pycr1000: error: [Errno 21] Is a directory: '/mnt/sda1'
It seems like the arduino is mounting the data logger as a directory rather than serial connection.
Correct. you are giving it the path to an SD card device: /mnt/sda1 IS a directory -- the root directory of your SD card.
When I run the command on my computer the path I provide is /dev/ttyUSB0.
And that works because you are giving it the name of a communications device.
Is there a path to the USB-A host on the arduino I can use for serial connections?
Yes, it will be something like /dev/tty* where * will vary depending on the actual USB device. The simplest method is to run "ls /dev" and note the devices when your USB adapter is not plugged in, then plug in the adapter and repeat the command - whatever new tty device shows up is the name of your adapter.
Now, it may be that you have to load a device specific driver before OpenWRT will recognize your device.
Thanks for your reply. I have tried listing the /dev directory before and after plugging in the device but don't remember anything new showing up. It must be that I need to load a driver like you say. I'll give it a go at work tomorrow.
I added a kernel module to the Yun so that it would recognize /dev/ttyACM0. This allowed the Yun to connect to an Uno just as my Linux PC does.
The commands for this were
opkg install kmod-usb-serial
opkg install kmod-usb-acm
I'm not actually sure if both are needed, but the second certainly was.