Help need to get zigbee4java and cc2531 working in widows 10

295 views
Skip to first unread message

Julli Mullins

unread,
Nov 9, 2015, 11:26:41 AM11/9/15
to zigbee4java
Hello!

I have tried to get zigbee4java to talk with the cc2531 but so far I have had zero success. I have done the following:
1. copied the sources from git
2. removed the android part from gradle.properties. Also changed the serial port reference to COM5
3. Imported the gradle project to eclipse
4. Flashed and verified the firmware on cc2351 module (I have tried both CC2531ZNP-Pro-Secure_Standard.hex and CC2531ZNP-Pro.hex, I didn't compile new firmware for the cc2531)
5. Connected the cc2351 to usb port (green light turns on) and ran graddle task zigbee-console-javase -> run.

Result is this

green light on cc2531 turns off and in the console following messages are printed:
ZigBee API starting up...18:14:20 417  ERROR  Exception inputStream reader parserThread
java.io.IOException: This port appears to have been shutdown or disconnected.
at j.extensions.comm.SerialComm$SerialCommInputStream.read(SerialComm.java:512)
at org.bubblecloud.zigbee.util.MarkableInputStream.read(MarkableInputStream.java:102)
at org.bubblecloud.zigbee.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:102)
at java.lang.Thread.run(Thread.java:745)

and at the end:
18:14:22 666  WARN   ZDO_MSG_CB_REGISTER executed and timed out while waiting for response.
18:14:22 667  WARN   Reset seq: Failed MSG_CB_REGISTER
java.io.IOException: This port appears to have been shutdown or disconnected.
at j.extensions.comm.SerialComm$SerialCommOutputStream.write(SerialComm.java:559)
at org.bubblecloud.zigbee.network.port.ZigBeeInterface.sendPacket(ZigBeeInterface.java:165)
at org.bubblecloud.zigbee.network.port.ZigBeeInterface.sendSynchronousCommand(ZigBeeInterface.java:254)
at org.bubblecloud.zigbee.network.port.ZigBeeNetworkManagerImpl.sendSynchrouns(ZigBeeNetworkManagerImpl.java:1191)
at org.bubblecloud.zigbee.network.port.ZigBeeNetworkManagerImpl.createZigBeeNetwork(ZigBeeNetworkManagerImpl.java:270)
at org.bubblecloud.zigbee.network.port.ZigBeeNetworkManagerImpl.initializeZigBeeNetwork(ZigBeeNetworkManagerImpl.java:241)
at org.bubblecloud.zigbee.ZigBeeApi.initializeNetwork(ZigBeeApi.java:225)
at org.bubblecloud.zigbee.ZigBeeApi.startup(ZigBeeApi.java:206)
at org.bubblecloud.zigbee.ZigBeeConsole.start(ZigBeeConsole.java:112)
at org.bubblecloud.zigbee.ZigBeeConsoleJavaSE.main(ZigBeeConsoleJavaSE.java:34)
18:14:27 673  WARN   ZDO_STARTUP_FROM_APP executed and timed out while waiting for response.
18:14:27 673  ERROR  Failed to start zigbee network.
18:14:27 673  WARN   Error closing portIdentifier portIdentifier: 'COM5'
java.io.IOException: This port appears to have been shutdown or disconnected.
at j.extensions.comm.SerialComm$SerialCommInputStream.available(SerialComm.java:495)
at org.bubblecloud.zigbee.network.port.ZigBeeSerialPortImpl.close(ZigBeeSerialPortImpl.java:115)
at org.bubblecloud.zigbee.network.port.ZigBeeInterface.close(ZigBeeInterface.java:107)
at org.bubblecloud.zigbee.network.port.ZigBeeNetworkManagerImpl.shutdown(ZigBeeNetworkManagerImpl.java:213)
at org.bubblecloud.zigbee.network.port.ZigBeeNetworkManagerImpl.initializeZigBeeNetwork(ZigBeeNetworkManagerImpl.java:243)
at org.bubblecloud.zigbee.ZigBeeApi.initializeNetwork(ZigBeeApi.java:225)
at org.bubblecloud.zigbee.ZigBeeApi.startup(ZigBeeApi.java:206)
at org.bubblecloud.zigbee.ZigBeeConsole.start(ZigBeeConsole.java:112)
at org.bubblecloud.zigbee.ZigBeeConsoleJavaSE.main(ZigBeeConsoleJavaSE.java:34)

ZigBee API starting up ... [FAIL]
BUILD SUCCESSFUL
Total time: 9.594 secs

I also tried to start console with different parameter
zigbee4javaConsoleArgs = COM5 23 12 false and zigbee4javaConsoleArgs = COM5 23 12 true

Any ideas what I'm doing wrong or try next?

Br.
Timme

Ps. the cc2351 is a Chinese version but at least the packet sniffer works fine with the proper firmware

Julli Mullins

unread,
Nov 9, 2015, 11:31:57 AM11/9/15
to zigbee4java
In windows device manager the CC2351 is show as TI CC2531 LowePower RF to CDC Serial Port (COM5). So that part should be ok too.

I have a raspberry board too but I'm not sure how to test the cc2531 dongle there.

Br.
Timme

Tommi

unread,
Nov 13, 2015, 11:47:16 AM11/13/15
to zigbee4java
Hi

Sounds like you have selected the correct firmware file and successfully flashed it. If the packet sniffer works then the hardware should be ok. That leaves the following suspects:

1) Problem with latest zigbee4java from master branch. You can test latest release to rule that out: https://github.com/tlaukkan/zigbee4java/releases/tag/zigbee4java-2.0.2

2) Problem with Windows 10. Can anyone confirm that they are successfully using zigbee4java on Windows 10? I have been using it up to Windows 8 at the moment. If you have possibility to test with Windows 8 yourself or try with mac / linux that would help ruling this one out.

3) Finally there could be breaking changes between Z-Stack versions. What is your Z-Stack version. Mine is Z-Stack Home 1.2.2.42930.

Best regards,
Tommi

Julli Mullins

unread,
Nov 14, 2015, 12:02:12 PM11/14/15
to zigbee4java
Thanks for your input.

I think that there is something wrong in the com between cc2531 and windows. If I keep the cc2531 connected to the laptop for while, the greed led on cc2531 turns off. Should the cc2531 behave like that?

1. No help (see log at the end of the message)
2. -
3. z-stack is Z-Stack Home 1.2.2a.44539, so it's a bit newer, so could it be that there is some changes in cc2531 firmware? Can you send me a working firmware for cc2531 (borh with and without encryption on)

zigbee4java: Including JavaSE settings
zigbee4java: Including JavaSE build
Evaluating runtime arguments: COM5 23 11 true
:zigbee-api:compileJava UP-TO-DATE
:zigbee-api:processResources UP-TO-DATE
:zigbee-api:classes UP-TO-DATE
:zigbee-api:jar UP-TO-DATE
:zigbee-console-common:compileJava UP-TO-DATE
:zigbee-console-common:processResources UP-TO-DATE
:zigbee-console-common:classes UP-TO-DATE
:zigbee-console-common:jar UP-TO-DATE
:zigbee-serial-javase:compileJava UP-TO-DATE
:zigbee-serial-javase:processResources UP-TO-DATE
:zigbee-serial-javase:classes UP-TO-DATE
:zigbee-serial-javase:jar UP-TO-DATE
:zigbee-console-javase:compileJava UP-TO-DATE
:zigbee-console-javase:processResources UP-TO-DATE
:zigbee-console-javase:classes UP-TO-DATE
:zigbee-console-javase:run
ZigBee API starting up...java.io.FileNotFoundException: C:\Users\Timo\AppData\Local\Temp\SerialComm.dll (The process cannot access the file because it is being used by another process)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at j.extensions.comm.SerialComm.<clinit>(SerialComm.java:66)
at org.bubblecloud.zigbee.network.port.ZigBeeSerialPortImpl.openSerialPort(ZigBeeSerialPortImpl.java:74)
at org.bubblecloud.zigbee.network.port.ZigBeeSerialPortImpl.open(ZigBeeSerialPortImpl.java:48)
at org.bubblecloud.zigbee.network.port.ZigBeeInterface.open(ZigBeeInterface.java:91)
at org.bubblecloud.zigbee.network.port.ZigBeeNetworkManagerImpl.initializeHardware(ZigBeeNetworkManagerImpl.java:195)
at org.bubblecloud.zigbee.network.port.ZigBeeNetworkManagerImpl.startup(ZigBeeNetworkManagerImpl.java:156)
at org.bubblecloud.zigbee.ZigBeeApi.startup(ZigBeeApi.java:151)
at org.bubblecloud.zigbee.ZigBeeConsole.start(ZigBeeConsole.java:101)
at org.bubblecloud.zigbee.ZigBeeConsoleJavaSE.main(ZigBeeConsoleJavaSE.java:34)
18:53:24 372  ERROR  Error...
java.lang.RuntimeException: Serial portIdentifier 'COM5' startup failed.
at org.bubblecloud.zigbee.network.port.ZigBeeSerialPortImpl.openSerialPort(ZigBeeSerialPortImpl.java:92)
at org.bubblecloud.zigbee.network.port.ZigBeeSerialPortImpl.open(ZigBeeSerialPortImpl.java:48)
at org.bubblecloud.zigbee.network.port.ZigBeeInterface.open(ZigBeeInterface.java:91)
at org.bubblecloud.zigbee.network.port.ZigBeeNetworkManagerImpl.initializeHardware(ZigBeeNetworkManagerImpl.java:195)
at org.bubblecloud.zigbee.network.port.ZigBeeNetworkManagerImpl.startup(ZigBeeNetworkManagerImpl.java:156)
at org.bubblecloud.zigbee.ZigBeeApi.startup(ZigBeeApi.java:151)
at org.bubblecloud.zigbee.ZigBeeConsole.start(ZigBeeConsole.java:101)
at org.bubblecloud.zigbee.ZigBeeConsoleJavaSE.main(ZigBeeConsoleJavaSE.java:34)
18:53:24 378  ERROR  Failed to initialize the dongle on port org.bubblecloud.zigbee.network.port.ZigBeeSerialPortImpl@5da7ed8f.

ZigBee API starting up ... [FAIL]
BUILD SUCCESSFUL

Total time: 5.813 secs

timo.p.j...@gmail.com

unread,
Nov 15, 2015, 12:15:43 PM11/15/15
to zigbee4java
some success
1. zigbee4javaConsoleArgs = COM5 23 11 true
2. Pluck in the cc2531, the green light turns on
3. wait the for the green led turn off
4. run gradle-task console-javase
5. ZigBee API starting up...19:10:08 838 INFO Setting clean state.
19:10:11 572 INFO Initialized ZigBee network with new or reset network state.
19:10:13 176 INFO Registered default sending endpoint 1 with clusters: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 10, 12, 21, 1794, 256, 257, 258, 512, 513, 514, 516, 768, 1027, 1024, 1025, 1026, 1028, 1029, 1030, 1280, 1281, 1282
ZigBee API starting up ... [OK]
There are 0 known devices in the network.
ZigBee console ready.

java.io.IOException: This port appears to have been shutdown or disconnected.

6. run gradle-task console-javase
7. ZigBee API starting up...19:02:13 363 INFO Setting clean state.
19:02:14 370 WARN ZB_WRITE_CONFIGURATION executed and timed out while waiting for response.
19:02:14 370 WARN Couldn't set ZCD_NV_STARTUP_OPTION to CLEAN_STATE
19:02:14 370 ERROR Unable to set clean state for dongle


ZigBee API starting up ... [FAIL]

8. run gradle-task console-javase
9. ZigBee API starting up...19:02:31 930 ERROR Unable to reset dongle


ZigBee API starting up ... [FAIL]

10. The program doesn't stop and if I disconnect the dongle
11. 19:05:22 684 ERROR Exception inputStream reader parserThread


java.io.IOException: This port appears to have been shutdown or disconnected.

It seems that first the dongel is working but really soon the com between dongle and the console is lost. Is the dongle broken? Bad firmware installed to the dongle?

Tommi

unread,
Jan 4, 2016, 1:44:35 PM1/4/16
to zigbee4java
 

Hi

I have tested on Windows 10 and zigbee4java seems to be working ok.

Br,
Tommi 

Tommi

unread,
Apr 4, 2016, 1:38:52 PM4/4/16
to zigbee4java
Hi

Some further testing revealed serial port instability with Windows 10. I have implemented alternative ZigbeeSerialPort with jSSC and switched ZigbeeConsole to use that which stabilized things. Dongle seems to be very stable now over random restarts of the application etc.

-Tommi

timo.p.j...@gmail.com

unread,
Apr 7, 2016, 1:51:09 PM4/7/16
to zigbee4java
Interesting, I will test my dongles (2x cban cc2531 and 1xwebee cc2531)to check if this will fix my challenges. It looks also that jSSC is compatible with raspberry, so I will try to test zigbee4java on rpi too.

Tommi, my offer for free presence, temperature sensors and power switch is still valid. Drop me an email if you are interested.

Br.
T

Tommi Laukkanen

unread,
Apr 8, 2016, 12:24:24 PM4/8/16
to Timo Aaltonen, zigbee4java
Hi Timo

These will be very useful things to test, please report how the outcomes are. :)

Br,
Tommi

Julli Mullins

unread,
May 7, 2016, 4:55:48 AM5/7/16
to zigbee4java
Hello!
 
Finally found the time to test my dongles in w10 with the new z4j setup and all my dongles initializes without any errors. I can confirm that cban cc2531 and webee cc2531 dongles work with zigbee4java in w10

Next task is to make my adhoco devices work with zigbee4java. Just tested Adhoco S1 device and it joined the zigbee mesh first but after while the node was removed because no enpoints were found...

11:25:04 459  INFO   Device announcement received - Network Address: #14425, IEEE Address: 00:18:E5:00:00:01:03:50
11:25:04 460  DEBUG  -> ZB_GET_DEVICE_INFO (Packet: length = 1, apiId = 0x26 0x06, full data = 0xfe 0x01 0x26 0x06 0x06 0x27, checksum = 0x27, error = false, errorMessage = null) 
11:25:04 465  DEBUG  <- ZB_GET_DEVICE_INFO_RSP (Packet: length = 9, apiId = 0x66 0x06, full data = 0xfe 0x09 0x66 0x06 0x06 0x57 0x13 0x01 0x03 0x05 0x00 0x00 0x00 0x2c, checksum = 0x2c, error = false, errorMessage = null)
11:25:04 465  DEBUG  -> ZB_GET_DEVICE_INFO (Packet: length = 1, apiId = 0x26 0x06, full data = 0xfe 0x01 0x26 0x06 0x06 0x27, checksum = 0x27, error = false, errorMessage = null) 
11:25:04 465  DEBUG  Adding node #14425 (00:18:E5:00:00:01:03:50) to the network
11:25:04 469  WARN   Created node object for #14425 (00:18:E5:00:00:01:03:50) that was not available on the network
11:25:04 469  DEBUG  Inspecting new node #14425 (00:18:E5:00:00:01:03:50)
11:25:04 470  DEBUG  <- ZB_GET_DEVICE_INFO_RSP (Packet: length = 9, apiId = 0x66 0x06, full data = 0xfe 0x09 0x66 0x06 0x06 0x57 0x13 0x01 0x03 0x05 0x00 0x00 0x00 0x2c, checksum = 0x2c, error = false, errorMessage = null)
11:25:04 470  DEBUG  -> ZDO_NODE_DESC_REQ (Packet: length = 4, apiId = 0x25 0x02, full data = 0xfe 0x04 0x25 0x02 0x59 0x38 0x59 0x38 0x23, checksum = 0x23, error = false, errorMessage = null) 
11:25:04 485  DEBUG  <- ZDO_NODE_DESC_REQ_SRSP (ZDO_NODE_DESC_REQ_SRSP{Status=SUCCESS(0)})
11:25:12 485  WARN   ZDO_NODE_DESC_REQ FAILED on #14425 (00:18:E5:00:00:01:03:50)
11:25:12 485  DEBUG  -> ZDO_POWER_DESC_REQ (Packet: length = 4, apiId = 0x25 0x03, full data = 0xfe 0x04 0x25 0x03 0x59 0x38 0x59 0x38 0x22, checksum = 0x22, error = false, errorMessage = null) 
11:25:12 498  DEBUG  <- ZDO_POWER_DESC_REQ_SRSP (ZDO_POWER_DESC_REQ_SRSP{Status=SUCCESS(0)})
11:25:20 500  WARN   ZDO_POWER_DESC_REQ FAILED on #14425 (00:18:E5:00:00:01:03:50)
11:25:20 500  DEBUG  -> ZDO_ACTIVE_EP_REQ (Packet: length = 4, apiId = 0x25 0x05, full data = 0xfe 0x04 0x25 0x05 0x59 0x38 0x59 0x38 0x24, checksum = 0x24, error = false, errorMessage = null) 
11:25:20 510  DEBUG  <- ZDO_ACTIVE_EP_REQ_SRSP (ZDO_ACTIVE_EP_REQ_SRSP{Status=SUCCESS(0)})
11:25:29 511  DEBUG  -> ZDO_ACTIVE_EP_REQ (Packet: length = 4, apiId = 0x25 0x05, full data = 0xfe 0x04 0x25 0x05 0x59 0x38 0x59 0x38 0x24, checksum = 0x24, error = false, errorMessage = null) 
11:25:29 520  DEBUG  <- ZDO_ACTIVE_EP_REQ_SRSP (ZDO_ACTIVE_EP_REQ_SRSP{Status=SUCCESS(0)})
11:25:38 522  WARN   ZDO_ACTIVE_EP_REQ FAILED on #14425 (00:18:E5:00:00:01:03:50)
11:25:38 522  WARN   Node #14425 (00:18:E5:00:00:01:03:50) removed from network because no endpoints have been discovered


I have a Adhoco coordinator, so I can debug what are the proper messages to get the endpoint info out from adhoco devices. 

Tommi do you know that does the console.log contain all messages transmitted from and to the coordinator?

I also test an Adhoco C1 temperature sensor but results were the same plus following error.

11:26:26 810  INFO   Device announcement received - Network Address: #14099, IEEE Address: 00:18:E5:00:00:00:2C:56
11:26:26 811  DEBUG  -> ZB_GET_DEVICE_INFO (Packet: length = 1, apiId = 0x26 0x06, full data = 0xfe 0x01 0x26 0x06 0x06 0x27, checksum = 0x27, error = false, errorMessage = null) 
11:26:26 817  DEBUG  <- ZB_GET_DEVICE_INFO_RSP (Packet: length = 9, apiId = 0x66 0x06, full data = 0xfe 0x09 0x66 0x06 0x06 0x57 0x13 0x00 0x00 0x3f 0x00 0x00 0x00 0x14, checksum = 0x14, error = false, errorMessage = null)
11:26:27 368  ERROR  Error constructing response packet {}
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.bubblecloud.zigbee.network.packet.zdo.ZDO_MSG_CB_INCOMING.translate(ZDO_MSG_CB_INCOMING.java:145)
at org.bubblecloud.zigbee.network.packet.ZToolPacketStream.parsePayload(ZToolPacketStream.java:312)
at org.bubblecloud.zigbee.network.packet.ZToolPacketStream.parsePacket(ZToolPacketStream.java:174)
at org.bubblecloud.zigbee.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:106)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 15
at org.bubblecloud.zigbee.network.packet.zdo.ZDO_NODE_DESC_RSP.<init>(ZDO_NODE_DESC_RSP.java:112)
... 9 more 

Br.
T
Reply all
Reply to author
Forward
0 new messages