1

I am new to the Linux world and am currently using Ubuntu 12.04. It is running in a Windows partition. I have developed a python program that reads in serial data from a micro-controller over the USB port. All was working fine till two days ago when it began crashing. On inputting dmesg | grep tty in to the console I get the following output:

[    0.000000] console [tty0] enabled
[   14.599394] cdc_acm 3-1:1.0: ttyACM0: USB ACM device
[  290.236065] cdc_acm 3-1:1.0: ttyACM0: USB ACM device
[ 1105.915191] cdc_acm 3-1:1.0: ttyACM0: USB ACM device

Every time I connect and disconnected the USB I get a new line with the same data. Only difference been the time. Is this right or have I a problem. Any help would be appreciated. Thanks

Update:

The issue was with the micro-controller. It rebooted every time it did not receive a package from any sensors for a period of time. The micro-controller is a router on a wireless sensor network. Every time the micro controller rebooted its connection port was incremented e.g ttyACM0 to ttyACM1. Upon connecting the controller to a Raspberry PI this stopped happening.

  • That does not show any problem. It seems normal as you are plugged in the micro-controller multiple times. When you wrote '... it began crashing' your mean your program? Also 'I get a new line with the same data.' you mean data your program read from serial port? – user.dz Feb 7 '14 at 16:18
  • 1
    Hi Sneetsher. The issue was with the micro controller. It rebooted every time it did not recieve a package from any sensors for a period of time. The micro controller is a router on a wireless sensor network. every time the micro controller rebooted its connection port was incremented e.g ttyACM0 to ttyACM1. Upon connecting the controller to a raspberry pi this stopped happening. Thanks for taking time to write. – user3053086 Mar 10 '14 at 23:07
  • Nice to hear that. In case you want persistent USB dev naming, you may create a udev rule see hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices . – user.dz Mar 11 '14 at 9:14
  • 1
    @Sneetsher. That link was very useful. its the permenant solution to the issue. thank you – user3053086 Mar 16 '14 at 14:06
0
  1. Check USB Vendor ID, Product ID and Serial Number.

    $ dmesg | grep usb
    [...]
    [11427.635362] usb 2-1.2: new high-speed USB device number 8 using ehci-pci
    [11427.730823] usb 2-1.2: New USB device found, idVendor=04e8, idProduct=685e
    [11427.730830] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [11427.730834] usb 2-1.2: Product: SAMSUNG
    [11427.730838] usb 2-1.2: Manufacturer: Android
    [11427.730842] usb 2-1.2: SerialNumber: S610275b03f86
    [11427.742314] usb-storage 2-1.2:1.0: USB Mass Storage device detected
    [11427.742436] scsi8 : usb-storage 2-1.2:1.0
    [11427.786013] usbcore: registered new interface driver cdc_acm
    

    Or udevadm info -a /dev/ttyUSB1 may be more complete.

  2. Create new udev rules file. Example with rules for Android phone, Arduino, Bus pirate and an ARM kit.

    $ sudo nano /etc/udev/rules.d/99-my-usb-serial.rules
    SUBSYSTEM=="tty", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="685e", ATTRS{serial}=="S610275b03f86", SYMLINK+="android"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A6008isP", SYMLINK+="arduino"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="A7004IXj", SYMLINK+="buspirate"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="FTDIF46B", SYMLINK+="ttyUSB.ARM"
    

References:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.