Some troubleshooting on ZigBee plugin
This commit is contained in:
parent
6f39d31d5d
commit
1e0ec282ca
4 changed files with 38 additions and 17 deletions
|
|
@ -21,15 +21,16 @@ Instructions are originally from: https://www.zigbee2mqtt.io/information/flashin
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
1. Download and install the "SmartRF Flash Programmer" **(Not v2)** application from https://www.ti.com/tool/FLASH-PROGRAMMER
|
1. Download and install the "SmartRF Flash Programmer" **(Not v2)** application from https://www.ti.com/tool/FLASH-PROGRAMMER
|
||||||
|
2. Download Z-STACK software (We do not actually need the software just the firmware binary that is included in the installation) from https://www.ti.com/tool/Z-STACK (You will need to create an account to download)
|
||||||
|
|
||||||
|
|
||||||
2. Connect CC debugger to the CC2531 USB sniffer.
|
3. Connect CC debugger to the CC2531 USB sniffer.
|
||||||
3. Connect **BOTH** the CC2531 USB sniffer and the CC debugger to your PC using USB.
|
4. Connect **BOTH** the CC2531 USB sniffer and the CC debugger to your PC using USB.
|
||||||
* If the light on the CC debugger is RED press set reset button on the CC debugger. The light on the CC debugger should now turn GREEN. If not use [CC debugger user guide](http://www.ti.com/lit/ug/swru197h/swru197h.pdf) to troubleshoot your problem.
|
* If the light on the CC debugger is RED press set reset button on the CC debugger. The light on the CC debugger should now turn GREEN. If not use [CC debugger user guide](http://www.ti.com/lit/ug/swru197h/swru197h.pdf) to troubleshoot your problem.
|
||||||
4. Download the firmware [CC2531_DEFAULT_20190608.zip](https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20190608.zip)
|
6. Start SmartRF Flash Programmer, with the properties below:
|
||||||
4. Start SmartRF Flash Programmer, with the properties below:
|
* Flash image: Locate the binary at <Z-Stack install dir>\Projects\zstack\ZNP\CC253x\dev\ (Make sure to select the .hex file and not the .bin file).
|
||||||
* Flash image: Make sure to select the .hex file and not the .bin file.
|
* Uncheck "Retain IEEE address when reprogramming the chip".
|
||||||
* Uncheck "Retain IEEE address when reprogramming the chip.
|
7. Press "Perform Action" to start flashing.
|
||||||
|
|
||||||
### Linux or MacOS
|
### Linux or MacOS
|
||||||
|
|
||||||
|
|
@ -50,8 +51,11 @@ Instructions are originally from: https://www.zigbee2mqtt.io/information/flashin
|
||||||
|
|
||||||
3. Connect **BOTH** the CC2531 USB sniffer and the CC debugger to your PC using USB.
|
3. Connect **BOTH** the CC2531 USB sniffer and the CC debugger to your PC using USB.
|
||||||
* If the light on the CC debugger is RED press set reset button on the CC debugger. The light on the CC debugger should now turn GREEN. If not use [CC debugger user guide](http://www.ti.com/lit/ug/swru197h/swru197h.pdf) to troubleshoot your problem.
|
* If the light on the CC debugger is RED press set reset button on the CC debugger. The light on the CC debugger should now turn GREEN. If not use [CC debugger user guide](http://www.ti.com/lit/ug/swru197h/swru197h.pdf) to troubleshoot your problem.
|
||||||
4. Download the firmware [CC2531_DEFAULT_20190608.zip](https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20190608.zip)
|
4. Download the firmware [CC2531_DEFAULT_xxxxxxx.zip](https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20201127.zip) (If link is dead try latest version [here](https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_Home_1.2/bin/default))
|
||||||
5. Flash your firmware:
|
5. Flash your firmware:
|
||||||
|
|
||||||
sudo ./cc-tool -e -w CC2531ZNP-Prod.hex
|
sudo ./cc-tool -e -w CC2531ZNP-Prod.hex
|
||||||
|
|
||||||
|
## References
|
||||||
|
|
||||||
|
* CCDEBUGGER user guide: http://www.ti.com/lit/ug/swru197h/swru197h.pdf
|
||||||
|
|
@ -105,11 +105,11 @@ public class HalZigbeeController implements HalSensorController, HalEventControl
|
||||||
// Other stuff
|
// Other stuff
|
||||||
// -----------
|
// -----------
|
||||||
|
|
||||||
if (dongle instanceof ZigBeeDongleTiCc2531) {
|
/*if (dongle instanceof ZigBeeDongleTiCc2531) {
|
||||||
ZigBeeDongleTiCc2531 tiDongle = (ZigBeeDongleTiCc2531) dongle;
|
ZigBeeDongleTiCc2531 tiDongle = (ZigBeeDongleTiCc2531) dongle;
|
||||||
tiDongle.setLedMode(1, false);
|
tiDongle.setLedMode(1, false);
|
||||||
tiDongle.setLedMode(2, false);
|
tiDongle.setLedMode(2, false);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ZigBeeTransportTransmit getDongle(String name, ZigBeePort serialPort, TransportConfig transportOptions) {
|
private static ZigBeeTransportTransmit getDongle(String name, ZigBeePort serialPort, TransportConfig transportOptions) {
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,13 @@ import com.zsmartsystems.zigbee.database.ZigBeeNodeDao;
|
||||||
import zutil.log.LogUtil;
|
import zutil.log.LogUtil;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
|
||||||
public class ZigBeeDataStore implements ZigBeeNetworkDataStore {
|
public class ZigBeeDataStore implements ZigBeeNetworkDataStore {
|
||||||
private static final Logger logger = LogUtil.getLogger();
|
private static final Logger logger = LogUtil.getLogger();
|
||||||
|
|
||||||
private HashMap<IeeeAddress,ZigBeeNodeDao> devices = new HashMap<>();
|
private HashMap<IeeeAddress,ZigBeeNodeDao> devices = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -54,7 +54,14 @@ public class ZigBeeDataStore implements ZigBeeNetworkDataStore {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeNode(ZigBeeNodeDao node) {
|
public void writeNode(ZigBeeNodeDao node) {
|
||||||
System.out.println("ZigBeeDataStore.writeNode(" + node + ")");
|
System.out.println("ZigBeeDataStore.writeNode(" +
|
||||||
|
"IeeAddr: " + node.getIeeeAddress() + ", " +
|
||||||
|
"binding: "+node.getBindingTable()+", " +
|
||||||
|
"description: "+node.getNodeDescriptor()+", " +
|
||||||
|
"endpoints: "+node.getEndpoints()+", " +
|
||||||
|
"NetAddr: "+node.getNetworkAddress()+", " +
|
||||||
|
"Power: "+node.getPowerDescriptor()+", " +
|
||||||
|
")");
|
||||||
|
|
||||||
devices.put(node.getIeeeAddress(), node);
|
devices.put(node.getIeeeAddress(), node);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
package se.hal.plugin.zigbee;
|
package se.hal.plugin.zigbee;
|
||||||
|
|
||||||
|
import com.zsmartsystems.zigbee.ZigBeeEndpoint;
|
||||||
import com.zsmartsystems.zigbee.ZigBeeNetworkManager;
|
import com.zsmartsystems.zigbee.ZigBeeNetworkManager;
|
||||||
import com.zsmartsystems.zigbee.ZigBeeNode;
|
import com.zsmartsystems.zigbee.ZigBeeNode;
|
||||||
import zutil.log.CompactLogFormatter;
|
import zutil.log.CompactLogFormatter;
|
||||||
|
|
@ -35,17 +36,13 @@ import java.util.logging.Level;
|
||||||
|
|
||||||
public class HalZigbeeControllerTest {
|
public class HalZigbeeControllerTest {
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException, InterruptedException {
|
public static void main(String[] args) throws IOException {
|
||||||
LogUtil.readConfiguration("logging.properties");
|
LogUtil.readConfiguration("logging.properties");
|
||||||
LogUtil.setGlobalFormatter(new CompactLogFormatter());
|
LogUtil.setGlobalFormatter(new CompactLogFormatter());
|
||||||
LogUtil.setGlobalLevel(Level.ALL);
|
LogUtil.setGlobalLevel(Level.ALL);
|
||||||
|
|
||||||
HalZigbeeController controller = new HalZigbeeController();
|
HalZigbeeController controller = new HalZigbeeController();
|
||||||
controller.initialize("COM4", HalZigbeeController.ZIGBEE_DONGLE_CONBEE);
|
controller.initialize("COM5", HalZigbeeController.ZIGBEE_DONGLE_CC2531);
|
||||||
|
|
||||||
System.out.println("PAN ID = " + controller.networkManager.getZigBeePanId());
|
|
||||||
System.out.println("Extended PAN ID = " + controller.networkManager.getZigBeeExtendedPanId());
|
|
||||||
System.out.println("Channel = " + controller.networkManager.getZigBeeChannel());
|
|
||||||
|
|
||||||
handleConsoleInput('h', controller.networkManager);
|
handleConsoleInput('h', controller.networkManager);
|
||||||
|
|
||||||
|
|
@ -62,9 +59,21 @@ public class HalZigbeeControllerTest {
|
||||||
|
|
||||||
private static void handleConsoleInput(char input, ZigBeeNetworkManager networkManager) {
|
private static void handleConsoleInput(char input, ZigBeeNetworkManager networkManager) {
|
||||||
switch (input) {
|
switch (input) {
|
||||||
|
case 'i':
|
||||||
|
System.out.println("PAN ID = " + networkManager.getZigBeePanId());
|
||||||
|
System.out.println("Extended PAN ID = " + networkManager.getZigBeeExtendedPanId());
|
||||||
|
System.out.println("Channel = " + networkManager.getZigBeeChannel());
|
||||||
|
break;
|
||||||
|
|
||||||
case 'l':
|
case 'l':
|
||||||
for (ZigBeeNode node : networkManager.getNodes()) {
|
for (ZigBeeNode node : networkManager.getNodes()) {
|
||||||
System.out.println(node);
|
System.out.println(node);
|
||||||
|
|
||||||
|
for (ZigBeeEndpoint endpoint : node.getEndpoints()) {
|
||||||
|
System.out.println(" - " + endpoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(" Number of Endpoints: " + node.getEndpoints().size());
|
||||||
}
|
}
|
||||||
System.out.println("Number of ZigBee Nodes: " + networkManager.getNodes().size());
|
System.out.println("Number of ZigBee Nodes: " + networkManager.getNodes().size());
|
||||||
break;
|
break;
|
||||||
|
|
@ -81,6 +90,7 @@ public class HalZigbeeControllerTest {
|
||||||
case 'h':
|
case 'h':
|
||||||
default:
|
default:
|
||||||
System.out.println("Available commands:");
|
System.out.println("Available commands:");
|
||||||
|
System.out.println(" i: List network info");
|
||||||
System.out.println(" l: List available ZigBee Nodes");
|
System.out.println(" l: List available ZigBee Nodes");
|
||||||
System.out.println(" p: Enable pairing of ZigBee devices");
|
System.out.println(" p: Enable pairing of ZigBee devices");
|
||||||
System.out.println(" q: Quit");
|
System.out.println(" q: Quit");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue