Arduino OpenWRT USB connection

This central heating monitoring system I am working on is built around an Arduino Uno. I want to hook it up to a Asus WL-500g deluxe router running OpenWRT. I found that this router has an internal header with two serial ports and I was planning to use one of these ports to link to my Arduino.

Pondering how I was going to do the logic level shifting from the 3.3V on the Asus to the 5V on the Arduino, I wondered if it would be easier just hooking up the Arduino via one of the two USB ports on the Asus WL-500g deluxe router. Plugging in the Arduino via USB did not look very promising, a dmesg only showed:

usb 2-1: new full speed USB device using uhci_hcd and address 2

Plugging in the Arduino on my Ubuntu Linux desktop showed that the Arduino is a “USB ACM” device:

[25009.512051] usb 3-3: new full speed USB device using ohci_hcd and address 4
[25009.731110] cdc_acm 3-3:1.0: ttyACM0: USB ACM device

So, I needed some kind of ACM driver for OpenWRT. A quick search revealed that I needed the usb-acm kernel module, so that is what I installed:

root@OpenWrt:~# opkg update
root@OpenWrt:~# opkg list | grep -i acm
kmod-usb-acm - 2.6.32.16-1 - Kernel support for USB ACM devices (modems/isdn controllers)
root@OpenWrt:~# opkg install kmod-usb-acm

Plugging in the Arduino now shows the right logs in dmesg:

usb 2-1: new full speed USB device using uhci_hcd and address 3
usb 2-1: configuration #1 chosen from 1 choice
cdc_acm 2-1:1.0: ttyACM0: USB ACM device

So we can now use /dev/ttyACM0 to talk to the Arduino. Ciao, mondo!

root@OpenWrt:~# ls -l /dev/ttyACM0
crw-rw-rw-    1 root     root     166,   0 Oct 25 23:36 /dev/ttyACM0

9 thoughts on “Arduino OpenWRT USB connection

  1. What Arduino are you using? My Arduino NANO (based on UNO) does not create a port when plugged in, which agrees with other reports, such as from the Rechenzentrum Garching (RZG) group of Germany. If I install kmod-usb-serial-pl2303 and plug in a pl-2303 usb serial cable I get a ttyUSB0. My board is a version 1.7 and I had to use the OpenWRT trunk load because the current standard release does not correctly open the Ethernet port on the v1.7.

    1. I was using an Arduino Uno. You can try plugging in your board on a Linux system and checking /var/log/syslog or execute a lsusb command to find out what device type it is.

      1. Output on my Linux desktop is as expected, since the NANO uses the FT232RL FTDI chip:

        [571729.572125] usb 5-1: new full-speed USB device number 6 using ohci_hcd
        [571729.756223] ftdi_sio 5-1:1.0: FTDI USB Serial Device converter detected
        [571729.756286] usb 5-1: Detected FT232RL
        [571729.756291] usb 5-1: Number of endpoints 2
        [571729.756295] usb 5-1: Endpoint 1 MaxPacketSize 64
        [571729.756299] usb 5-1: Endpoint 2 MaxPacketSize 64
        [571729.756302] usb 5-1: Setting MaxPacketSize 64
        [571729.760278] usb 5-1: FTDI USB Serial Device converter now attached to ttyUSB0

        However, this is not what I see on the TL-WR703N. I have “kmod-usb-acm” loaded but I only see the “usb 5-1: new full-speed USB device number 6 using ohci_hcd” part of the message.

        I just looked at the UNO v3 schematic and it does NOT use the FT232RL FTDI chip. Instead the USB is sourced directly from pins 29 & 30 of the ATMEGA16U2-MU(R) chip. I don’t know if earlier UNOs use the FT232RL FTDI chip or are the same as the v3.

        If your UNO is the same configuration as the UNO v3, then there IS a hardware difference between the NANO and UNO that may explain the difference in operation with “kmod-usb-acm”.

        If you want, you can read about what I am trying to do on my blog:
        http://dzrmo.wordpress.com/

    1. That looks like some kind of industrial/automotive/outdoors 3 pin connector. Are you using this connector for power, USB or serial? If you want to see what Linux “sees” when you have plugged in a device, you can use the dmesg command in a terminal window. If you want to see is the “live” logs when you plug it in, try sudo tail -f /var/log/syslog in a terminal device on Debian/Ubuntu.

Leave a Reply

Your email address will not be published.