This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Z-Stack Linux Gateway - no ttyACM0 device?

Other Parts Discussed in Thread: CC2531, Z-STACK, CC2531EMK

I am attempting to run the Z-Stack Linux Gateway sample on a BeagleBone Black with a CC2531 USB dongle. I have tried several versions of Linux distributions:

In all cases, cdc-acm driver does not get connected to device when plugged in. dmesg output:

[    1.128093] usb 1-1: new full-speed USB device number 2 using musb-hdrc
[    1.247206] usb 1-1: ep0 maxpacket = 32
[    1.248742] usb 1-1: default language 0x0409
[    1.249529] usb 1-1: udev 2, busnum 1, minor = 1
[    1.249546] usb 1-1: New USB device found, idVendor=0451, idProduct=16ae
[    1.249558] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.249568] usb 1-1: Product: CC2531 USB Dongle
[    1.249577] usb 1-1: Manufacturer: Texas Instruments
[    1.249998] usb 1-1: usb_probe_device
[    1.250015] usb 1-1: configuration #1 chosen from 1 choice
[    1.250277] usb 1-1: adding 1-1:1.0 (config #1, interface 0)
I expected to see messages that the cdc-acm driver was used to create the /dev/ttyACM0 device, but I am not finding anything.

If I go ahead and run the script to start the server, it fails to find the /dev/ttyACM0 device on the first attempt and eventually retries. On the second attempt, the /dev/ttyACM0 device is there, but does not seem to be responding:

root@beaglebone:~/z-stack_GW/servers# ./zigbeeHAgw bbb
running zigbeegw.scr on an ARM
resetting beaglebone black
 sleeping 6 seconds after reset... Using serial port: /dev/ttyACM0
/dev/ttyACM0: No such file or directory
/dev/ttyACM0 open failed
/dev/ttyACM0: No such file or directory
/dev/ttyACM0 open failed
done
stty: /dev/ttyACM0: No such file or directory
stty: /dev/ttyACM0: No such file or directory
Starting the ZigBee gateway subsystem
deviceKey = 0  (0 )
devPath = '/dev/ttyACM0'
logPath = './NpiLnxLog.txt'
... freeing memory (ret 0)
Port: 2533
Following IP addresses are available:

 IPv4: interface: lo     IP Address 127.0.0.1
 IPv4: interface: usb0   IP Address 192.168.7.2
 IPv6: interface: lo     IP Address ::1
The socket will listen on the following IP addresses:

  IPv4: 0.0.0.0
  IPv6: ::
0.0.0.0 means it will listen to all available IP address

waiting for first connection on #3...
NPI started (pid 1742) at Fri Nov  4 12:33:34 UTC 2016
Connected to #5.(127.0.0.1 / ::6868:96be:b068:96be)
ZLSZNP started (pid 1748) at Fri Nov  4 12:33:38 UTC 2016
[NWK_MGR/MAIN] :  there are 2 args
[NWK_MGR/MAIN] :  argv[0] = ./NWKMGR_SRVR_arm
[NWK_MGR/MAIN] :  argv[1] = 127.0.0.1:2536
[NWK_MGR/MAIN] :  ************************************************
[NWK_MGR/MAIN] :  *         Network Manager Server v1.0.1        *
[NWK_MGR/MAIN] :  * The following are the avaible key commands:  *
[NWK_MGR/MAIN] :  * Exit Program.                         -  q   *
[NWK_MGR/MAIN] :  ************************************************

NETWORK MANAGER started (pid 1755) at Fri Nov  4 12:33:39 UTC 2016
[GATEWAY/MAIN] :
[GATEWAY/MAIN] :  ************************************************
[GATEWAY/MAIN] :  *            Gateway Server v1.0.1             *
[GATEWAY/MAIN] :  * The following are the avaible key commands:  *
[GATEWAY/MAIN] :  * Exit Program.                         -  q   *
[GATEWAY/MAIN] :  ************************************************

GATEWAY SERVER started (pid 1761) at Fri Nov  4 12:33:41 UTC 2016
[OTASRVR/MAIN] :
[OTASRVR/MAIN] :  ************************************************
[OTASRVR/MAIN] :  *                OTA Upgrade Server 1.0.1      *
[OTASRVR/MAIN] :  * The following are the avaible key commands:  *
[OTASRVR/MAIN] :  * Exit Program.                         -  q   *
[OTASRVR/MAIN] :  ************************************************

[NWK_MGR/MAIN] ERROR: Endpoint Registration Failed
[NWK_MGR/MAIN] ERROR: Registering ZDO Callbacks Failed
[NWK_MGR/MAIN] ERROR: Reading Local Network Information Failed
[NWK_MGR/MAIN] : Initialization failed. Quitting now. mhoyt

OTA SERVER started (pid 1769) at Fri Nov  4 12:33:43 UTC 2016
[OTASRVR/MAIN] :
Error - Could not register OTA endpoint with zstackserver.Exiting...

starting tracker with our pid ./zigbeeHAgw and pid list 1742 1748 1761 1769
===================================================
NETWORK MANAGER exited with code 255 at Fri Nov  4 12:33:43 UTC 2016
./zigbeeHAgw: line 482:  1782 Killed                  ./track_servers $$ "$pids"
OTA_SRVR_arm: no process found
unexpected exit code (255) from netmgr!
resetting beaglebone black
 sleeping 6 seconds after reset... Using serial port: /dev/ttyACM0
zbSocProcessRpc: CMD0:21, CMD1:9, not handled
zbSocProcessRpc: CMD0:21, CMD1:9, not handled
^Ccaught SIGTERM, killing all the servers and cleaning up

The process hangs at that point until I kill it.

It appears that the /dev/ttyACM0 being created is not really a device, but just a file:

root@beaglebone:~/z-stack_GW/servers# stty < /dev/ttyACM0
stty: standard input: Inappropriate ioctl for device
root@beaglebone:~/z-stack_GW/servers# ls -l /dev/ttyACM0
-rw-r--r-- 1 root root 33 Nov  4 12:33 /dev/ttyACM0
root@beaglebone:~/z-stack_GW/servers# file /dev/ttyACM0
/dev/ttyACM0: data

I have no idea what in the process might be creating this file.

If I attempt to inform the cdc-acm driver that this USB device should be handled by it, the probe does not get valid info back:

~/z-stack_GW/servers# echo "0x0451 0x16ae" > /sys/bus/usb/drivers/cdc_acm/new_id
[ 1802.256030] cdc_acm 1-1:1.0: usb_probe_interface
[ 1802.256106] cdc_acm 1-1:1.0: usb_probe_interface - got id
[ 1802.256160] cdc_acm 1-1:1.0: Zero length descriptor references
[ 1802.266466] cdc_acm: probe of 1-1:1.0 failed with error -22

I also tried loading the CC2531-GW-ZNP_38724.hex firmware file that comes with the Linux Gateway package, thinking perhaps the chip was not initialized properly, but the serial bootloader also uses the /dev/ttyACM0 device...

root@beaglebone:~/z-stack_GW/tools# ./sbl_tool.bin CC2531-GW-ZNP_38724.hex USB

***** TI LPRF ZigBee Serial Bootloader Tool for Linux v. 0.83 *****
Executed ./sbl_tool.bin on Jun  6 2014 21:32:15
Requested file file: CC2531-GW-ZNP_38724.hex
Using USB transport
Resetting USB connection. It takes a few seconds...
/dev/ttyACM0: No such file or directory
/dev/ttyACM0 open failed
/dev/ttyACM0: No such file or directory
/dev/ttyACM0 open failed

Any ideas on why I might be seeing this problem with the serial connection?
I am not 100% certain that it is related to the CC2531 USB stick, but my wired ethernet connection is dropping off also.

Thanks!

.Tim