Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on Startup while connecting to a MQTT server requiring Auth #15

Closed
DamianFlynn opened this issue Jan 11, 2020 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@DamianFlynn
Copy link

DamianFlynn commented Jan 11, 2020

The issue is that we can not currenty provide user/pass for the MQTT auth.
Unauth MQTT works nicely

The following is not relevant any longer for this issue - Originally i assumed the issue was due to no ZWave key set

Using a ZWave network which was running Zwave2MQTT; and swapping over to this container.
I don't see where to supply the network security key.

I see this message in the log

[20200111 22:02:57.981 UTC] [ozw.manager] [debug]: OpenZWave Manager Instance Created
[20200111 22:02:57.981 UTC] [ozw.manager] [debug]: OpenZWave Watcher Registered
[20200111 22:02:57.981 UTC] [ozw.manager] [debug]: Notification Signals Setup
[20200111 22:02:57.982 UTC] [ozw.library] [info]: Info - Node: 0 Setting Up Provided Network Key for Secure Communications
[20200111 22:02:57.983 UTC] [ozw.library] [warning]: Warning - Node: 0 Failed - Network Key Not Set
[20200111 22:02:58.017 UTC] [ozw.library] [info]: Info - Node: 0 Manufacturer_Specific.xml file Revision is 67

And within a few seconds we shut down

[20200111 22:02:59.656 UTC] [ozw.library] [info]: Info - Node: 0 Queuing Lookup on mfs.db.openzwave.com for Node 0
[20200111 22:02:59.657 UTC] [ozw.library] [info]: Info - Node: 0   Opening controller /dev/ttyACM0
[20200111 22:02:59.658 UTC] [ozw.library] [info]: Info - Node: 0 Starting DNSThread
[20200111 22:02:59.658 UTC] [ozw.library] [info]: Info - Node: 0 LookupTxT Checking mfs.db.openzwave.com
[20200111 22:02:59.659 UTC] [ozw.library] [info]: Info - Node: 0 mgr,     Added driver for controller /dev/ttyACM0
[20200111 22:02:59.659 UTC] [ozw.manager] [debug]: AddDriver Completed
[20200111 22:02:59.659 UTC] [ozw.library] [info]: Info - Node: 0 Trying to open serial port /dev/ttyACM0 (attempt 1)
[20200111 22:02:59.661 UTC] [ozw.library] [info]: Info - Node: 0 Timer: thread starting
[20200111 22:02:59.661 UTC] [ozw.library] [debug]: Detail - Node: 0 Timer: waiting with timeout -1 ms
[20200111 22:02:59.663 UTC] [ozw.library] [info]: Info - Node: 0 Serial port /dev/ttyACM0 opened (attempt 1)
[20200111 22:02:59.664 UTC] [ozw.library] [debug]: Detail - Node: 255 Queuing (Command) FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
[20200111 22:02:59.695 UTC] [ozw.library] [info]: Info - Node: 0 Lookup for mfs.db.openzwave.com returned 65
[20200111 22:02:59.708 UTC] [ozw.library] [debug]: Debug - Node: 0 Downloads Remaining: 0
[20200111 22:02:59.709 UTC] [ozw.library] [info]: Info - Node: 0 ManufacturerSpecificDB Initialized
[20200111 22:02:59.709 UTC] [ozw.library] [debug]: Detail - Node: 0 Notification: ManufacturerSpecificDB Ready
[20200111 22:02:59.710 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.711 UTC] [ozw.library] [info]: Info - Node: 255 Sending (Command) message (Callback ID=0x00, Expected Reply=0x15) - FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
[20200111 22:02:59.711 UTC] [ozw.library] [info]: Info - Node: 255 Encrypted Flag is 0
[20200111 22:02:59.714 UTC] [ozw.library] [debug]: Detail - Node: 255   Received: 0x01, 0x10, 0x01, 0x15, 0x5a, 0x2d, 0x57, 0x61, 0x76, 0x65, 0x20, 0x33, 0x2e, 0x39, 0x35, 0x00, 0x01, 0x99
[20200111 22:02:59.715 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.716 UTC] [ozw.library] [info]: Info - Node: 255 Received reply to FUNC_ID_ZW_GET_VERSION:
[20200111 22:02:59.717 UTC] [ozw.library] [info]: Info - Node: 255     Static Controller library, version Z-Wave 3.95
[20200111 22:02:59.718 UTC] [ozw.library] [debug]: Detail - Node: 255 Queuing (Command) FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc
[20200111 22:02:59.719 UTC] [ozw.library] [debug]: Detail - Node: 255   Expected reply was received
[20200111 22:02:59.720 UTC] [ozw.library] [debug]: Detail - Node: 255   Message transaction complete
[20200111 22:02:59.720 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.721 UTC] [ozw.library] [debug]: Detail - Node: 255 Removing current message
[20200111 22:02:59.722 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.723 UTC] [ozw.library] [info]: Info - Node: 255 Sending (Command) message (Callback ID=0x00, Expected Reply=0x20) - FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc
[20200111 22:02:59.724 UTC] [ozw.library] [info]: Info - Node: 255 Encrypted Flag is 0
[20200111 22:02:59.728 UTC] [ozw.library] [debug]: Detail - Node: 255   Received: 0x01, 0x08, 0x01, 0x20, 0xe3, 0x04, 0xb1, 0xf2, 0x01, 0x73
[20200111 22:02:59.729 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.730 UTC] [ozw.library] [info]: Info - Node: 255 Received reply to FUNC_ID_ZW_MEMORY_GET_ID. Home ID = 0xe304b1f2.  Our node ID = 1
[20200111 22:02:59.731 UTC] [ozw.library] [debug]: Detail - Node: 255 Queuing (Command) FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9
[20200111 22:02:59.732 UTC] [ozw.library] [debug]: Detail - Node: 255   Expected reply was received
[20200111 22:02:59.732 UTC] [ozw.library] [debug]: Detail - Node: 255   Message transaction complete
[20200111 22:02:59.733 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.733 UTC] [ozw.library] [debug]: Detail - Node: 255 Removing current message
[20200111 22:02:59.734 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.735 UTC] [ozw.library] [info]: Info - Node: 255 Sending (Command) message (Callback ID=0x00, Expected Reply=0x05) - FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9
[20200111 22:02:59.736 UTC] [ozw.library] [info]: Info - Node: 255 Encrypted Flag is 0
[20200111 22:02:59.738 UTC] [ozw.library] [debug]: Detail - Node: 255   Received: 0x01, 0x04, 0x01, 0x05, 0x08, 0xf7
[20200111 22:02:59.739 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.739 UTC] [ozw.library] [info]: Info - Node: 255 Received reply to FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES:
[20200111 22:02:59.740 UTC] [ozw.library] [info]: Info - Node: 255     There is no SUC ID Server (SIS) in this network.
[20200111 22:02:59.740 UTC] [ozw.library] [info]: Info - Node: 255     The PC controller is a primary controller.
[20200111 22:02:59.741 UTC] [ozw.library] [debug]: Detail - Node: 255 Queuing (Command) FUNC_ID_ZW_GET_SUC_NODE_ID: 0x01, 0x03, 0x00, 0x56, 0xaa
[20200111 22:02:59.741 UTC] [ozw.library] [debug]: Detail - Node: 255   Expected reply was received
[20200111 22:02:59.742 UTC] [ozw.library] [debug]: Detail - Node: 255   Message transaction complete
[20200111 22:02:59.743 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.744 UTC] [ozw.library] [debug]: Detail - Node: 255 Removing current message
[20200111 22:02:59.745 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.745 UTC] [ozw.library] [info]: Info - Node: 255 Sending (Command) message (Callback ID=0x00, Expected Reply=0x56) - FUNC_ID_ZW_GET_SUC_NODE_ID: 0x01, 0x03, 0x00, 0x56, 0xaa
[20200111 22:02:59.746 UTC] [ozw.library] [info]: Info - Node: 255 Encrypted Flag is 0
[20200111 22:02:59.749 UTC] [ozw.library] [debug]: Detail - Node: 255   Received: 0x01, 0x04, 0x01, 0x56, 0x00, 0xac
[20200111 22:02:59.750 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.750 UTC] [qt.mqtt.connection] [debug]: bool QMqttConnection::sendControlConnect()
[20200111 22:02:59.750 UTC] [ozw.library] [info]: Info - Node: 255 Received reply to GET_SUC_NODE_ID.  Node ID = 0
[20200111 22:02:59.751 UTC] [qt.mqtt.connection.verbose] [debug]: bool QMqttConnection::writePacketToTransport(const QMqttControlPacket&)  DataSize: 87
[20200111 22:02:59.751 UTC] [ozw.library] [info]: Info - Node: 0 Controller Does not Support SUC - Cannot Setup Controller as SUC Node
[20200111 22:02:59.752 UTC] [ozw.notifications] [debug]: Notification pvt_manufacturerSpecificDBReady
[20200111 22:02:59.753 UTC] [ozw.mqtt.publisher] [debug]: Publishing Event manufacturerSpecificDBReady
[20200111 22:02:59.753 UTC] [ozw.library] [debug]: Detail - Node: 255 Queuing (Command) FUNC_ID_SERIAL_API_GET_CAPABILITIES: 0x01, 0x03, 0x00, 0x07, 0xfb
[20200111 22:02:59.754 UTC] [qt.mqtt.connection.verbose] [debug]: void QMqttConnection::transportReadReady()
[20200111 22:02:59.754 UTC] [ozw.library] [debug]: Detail - Node: 255   Expected reply was received
[20200111 22:02:59.755 UTC] [qt.mqtt.connection.verbose] [debug]: Received CONNACK
[20200111 22:02:59.755 UTC] [qt.mqtt.connection.verbose] [debug]: Finalize CONNACK
[20200111 22:02:59.756 UTC] [ozw.library] [debug]: Detail - Node: 255   Message transaction complete
[20200111 22:02:59.756 UTC] [qt.mqtt.connection] [debug]: Connection has been rejected.
[20200111 22:02:59.757 UTC] [ozw.library] [debug]: Detail - Node: 0
[20200111 22:02:59.758 UTC] [ozw.mqtt.publisher] [debug]: MQTT State Change 0
[20200111 22:02:59.758 UTC] [ozw.mqtt.publisher] [warning]: Exiting on Failure
=============================
CRASH!!! - Dumping Backtrace:
=============================
pi@zwave2mqtt:~ $
@DamianFlynn
Copy link
Author

DamianFlynn commented Jan 11, 2020

Ok - added the key to the file /tmp/ozw/options.xml

The log looks better

[20200111 22:27:22.118 UTC] [ozw.manager] [debug]: OpenZWave Watcher Registered
[20200111 22:27:22.118 UTC] [ozw.manager] [debug]: Notification Signals Setup
[20200111 22:27:22.120 UTC] [ozw.library] [info]: Info - Node: 0 Setting Up Provided Network Key for Secure Communications
[20200111 22:27:22.155 UTC] [ozw.library] [info]: Info - Node: 0 Manufacturer_Specific.xml file Revision is 67

However - still crashing, need to provide auth for MQTT

[20200111 22:27:23.818 UTC] [qt.mqtt.connection.verbose] [debug]: Finalize CONNACK
[20200111 22:27:23.819 UTC] [qt.mqtt.connection] [debug]: Connection has been rejected.
[20200111 22:27:23.820 UTC] [ozw.mqtt.publisher] [debug]: MQTT State Change 0
[20200111 22:27:23.820 UTC] [ozw.mqtt.publisher] [warning]: Exiting on Failure

@DamianFlynn
Copy link
Author

Looking at the main.cpp there is no support for authenticated MQTT currently - can you add this please

@DamianFlynn DamianFlynn changed the title Crash on Startup - Network Security Key Crash on Startup while connecting to a MQTT server requiring Auth Jan 12, 2020
@Fishwaldo Fishwaldo added the enhancement New feature or request label Jan 17, 2020
@JumpMaster
Copy link
Contributor

I would also like to be able to mqtt auth with this. Thanks

@erikced
Copy link
Contributor

erikced commented Mar 2, 2020

This should be closed now that #49 has been merged?

@JumpMaster
Copy link
Contributor

Agreed this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants