Go Down

Topic: ttyACM0 unstable (Read 8118 times) previous topic - next topic

Jantje

Hi
I have connected my Arduino Mega to yun using the USB port.
The intention is to use the yun for logging and reporting so I need this connection to be stable.
I had remarked instability of the com port but I considered that to be cause by to many stty and other actions.
So I left my arduino and yun running last night and now I see that again ttyACM0 is completely unresponsive.
My arduino sketch dump a line of info every 1200 miliseconds.
The linino script dumps the sketch output to a temp file and every 1000 lines the file is moved to the sd card.
Because of the timestamps on the sd card I know when it started and when it stopped working.

It has been running for less than 8 hours when logging stopped.
What I think is wierd is that the TX led on the arduino is constantly on.
Linino is running fine. Has plenty of disk space.
Code: [Select]
root@marvin2:/mnt/sda1/jantje/static# fd
-ash: fd: not found
root@marvin2:/mnt/sda1/jantje/static# df
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                    7680       844      6836  11% /
/dev/root                 7168      7168         0 100% /rom
tmpfs                    30568       228     30340   1% /tmp
tmpfs                      512         0       512   0% /dev
/dev/mtdblock3            7680       844      6836  11% /overlay
overlayfs:/overlay        7680       844      6836  11% /
/dev/sda1              3878912     85120   3793792   2% /mnt/sda1


Code: [Select]
Mem: 53048K used, 8084K free, 0K shrd, 4352K buff, 30712K cached
CPU:   0% usr   5% sys   0% nic  93% idle   0% io   0% irq   0% sirq
Load average: 0.01 0.05 0.05 1/51 23833
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
1532     1 root     S     1608   3%   1% /usr/sbin/uhttpd -f -h /www -r marvin
1593     1 root     S N   1508   2%   0% {uSDaemon} /bin/sh /sbin/uSDaemon
23768 18945 root     R     1504   2%   0% top
18868  1523 root     S     1248   2%   0% /usr/sbin/dropbear -F -P /var/run/dro
1569     1 nobody   S     2172   4%   0% avahi-daemon: running [marvin2.local]
1541     1 root     S     1700   3%   0% /usr/sbin/dbus-daemon --system
1151     1 root     S     1576   3%   0% wpa_supplicant -B -P /var/run/wifi-wl
  574     1 root     S     1552   3%   0% {rcS} /bin/sh /etc/init.d/rcS S boot
  726     1 root     S     1540   3%   0% /sbin/netifd
1241   726 root     S     1516   2%   0% udhcpc -p /var/run/udhcpc-wlan0.pid -
2123     1 root     S     1512   2%   0% {ParseArduinoInp} /bin/ash ./ParseArd
18945 18868 root     S     1512   2%   0% -ash
2669  2579 root     S     1512   2%   0% -ash
  696     1 root     S     1512   2%   0% /sbin/syslogd -C16
    1     0 root     S     1508   2%   0% init


Can anyone confirm this behaviour on their side?
Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Jantje

Code: [Select]
More info:
When I unplug my Arduino and plug it back in the ttyACM0 (or higher) does not appear.
dmesg shows following error
[code[75284.430000] usb 1-1.1: device descriptor read/64, error -145
[75299.560000] hub 1-1:1.0: unable to enumerate USB device on port 1
[75299.800000] usb 1-1.1: new full-speed USB device number 11 using ehci-platform
]


Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

federicofissore

Has dmesg showed some other error message WRT the mega?
Could that be a power issue? Maybe the mega is asking the yun too much power?

Jantje


Has dmesg showed some other error message WRT the mega?
Could that be a power issue? Maybe the mega is asking the yun too much power?

I had to reboot linino so I can't check on dmesg. I will when it happens again.
As to power: It's a mega with nothing attached to it the spec says 2.7mA 200ma max (that is all pins loaded), doesn't sound like a real suspect to me.

Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

geeek

No solution yet?

Try this (adapted from The Guide):

In the Arduino IDE, press the upload button. When the status bar shows "Uploading...", double press the reset button on the board.

Jantje

I'm pretty confident it has to do with the size of the messages I pump through the serial queue.
I think so as I read line by line and the lines can be long and a certain message makes it block for sure (as far as I recall)
Still need to do some tests though to confirm.
Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

sonnyyu

https://forum.openwrt.org/viewtopic.php?id=39956

Sticky: ar9331's usb stability issue ,  208 threads.

Issues:

1. All AR9331 based routers suffer USB 1.1 to USB 2.0 interoperability problems.
2. when purchasing routers from a single vendor some routers fail immediately, some routers work perfectly, some routers work some of the time.  For example, I have 11 alfa AP121U routers here 5 of them fail immediately 5 of them work perfectly and one of them works some of the time.
3. the problem is somehow related to WiFi.  When you disable the WiFi the problem goes away.
4. The problem can be resolved in every single case by using a passive USB 2.0 hub
5. The problem only happens with USB bulk transfers.  Isochronous transfers seem to be OK.
6. the problem is not a power supply issue
7. this is not related to the place of manufacture of the chipset (happens with both korean and taiwan made chips) or version.
8. It might be related to new revision of chipset (AL1A, AL3A, 2L1E)

Facts:
Actually, the chip has a hardware bug where spurious RF ( WIFI reset ) emissions affect the USB PLL.
Of course, Qualcomm Atheros will not aknowledge it as a critical bug as they found a software workaround for it. The new revision chipset fixed this problem?

https://github.com/qca/qcamain_open_hal_public    (QCA = Qualcomm Atheros)
This is where the workaround macro is originating! 

Solutions( Work arround):

1. Wait linino update which include patch to address this problem.
2. Disable WIFI, use Ethernet only.  http://forum.arduino.cc/index.php?topic=188821.msg1399080#msg1399080.
3. Upgrade from hotplug2 to standard udev, since I saw  your dmesg.
Code: [Select]
[75299.560000] hub 1-1:1.0: unable to enumerate USB device on port 1
[75299.800000] usb 1-1.1: new full-speed USB device number 11 using ehci-platform

It look like your USB device is back on line. The udev might help.
4. Wait QCA new revision hardware.
5. Reduce chance wifi reset, setup it as static ip.

sonnyyu


Jantje

This sounds like what I have been experiencing

Solutions( Work arround):

1. Wait linino update which include patch to address this problem.
2. Disable WIFI, use Ethernet only.  http://forum.arduino.cc/index.php?topic=188821.msg1399080#msg1399080.
3. Upgrade from hotplug2 to standard udev, since I saw  your dmesg.
Code: [Select]
[75299.560000] hub 1-1:1.0: unable to enumerate USB device on port 1
[75299.800000] usb 1-1.1: new full-speed USB device number 11 using ehci-platform

It look like your USB device is back on line. The udev might help.
4. Wait QCA new revision hardware.
5. Reduce chance wifi reset, setup it as static ip.
.
1 is not really an option for me right now.
2 is not an option as i need wifi as i'm working on a garden robot.
3 can you point me on some info on this?
4 Same as 1 for me
5 I'll use this when 3 fails

best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

sonnyyu

#9
Jan 05, 2014, 07:21 am Last Edit: Jan 05, 2014, 07:24 am by sonnyyu Reason: 1

sonnyyu

#10
Jan 05, 2014, 07:43 am Last Edit: Jan 05, 2014, 07:45 am by sonnyyu Reason: 1
Upgrade from hotplug2 to standard udev at Openwrt

Code: [Select]
opkg install udev
opkg remove hotplug2
nano /etc/init.d/boot


Code: [Select]

#killall -q hotplug2
       #[ -x /sbin/hotplug2 ] && /sbin/hotplug2 --override --persistent \
                      # --set-rules-file /etc/hotplug2.rules \
                      #--set-coldplug-cmd /sbin/udevtrigger \
                      #--max-children 1 >/dev/null 2>&1 &


Code: [Select]
reboot
nano /etc/init.d/udev


Code: [Select]
#!/bin/sh /etc/rc.common
START=03
start () {
  udevd --daemon
}
stop() {
  killall -9 udevd
}


Code: [Select]
chmod  755 /etc/init.d/udev
/etc/init.d/udev enable
/etc/init.d/udev start

sonnyyu

Quote
1. Wait linino update which include patch to address this problem.


http://forum.arduino.cc/index.php?topic=211823.0

The new linino_dev  is available.

http://download.linino.org/dogstick/linino_dev/latest/

I can not find source for linino_dev.  Anyone  could show us light?

Go Up