Zwave2mqtt: Invalid Network Key. Does not contain 16 Bytes - Contains 1

Created on 5 Feb 2019  Â·  13Comments  Â·  Source: OpenZWave/Zwave2Mqtt

Hi,

First of all kudos on the software!

I've run into a snag whilst getting this up and running, working without a security key is fine however when trying to add one openzwave fails. What format should the key be in? I have tried the following in the text box yet each one fails:

0xE1, 0x40, 0xE5, 0x36, 0x2E, 0xD2, 0xC6, 0x42, 0x28, 0xB1, 0x07, 0xBF, 0x9B, 0x81, 0x4A, 0xDA

"0xE1, 0x40, 0xE5, 0x36, 0x2E, 0xD2, 0xC6, 0x42, 0x28, 0xB1, 0x07, 0xBF, 0x9B, 0x81, 0x4A, 0xDA"

[0xE1, 0x40, 0xE5, 0x36, 0x2E, 0xD2, 0xC6, 0x42, 0x28, 0xB1, 0x07, 0xBF, 0x9B, 0x81, 0x4A, 0xDA]

{0xE1, 0x40, 0xE5, 0x36, 0x2E, 0xD2, 0xC6, 0x42, 0x28, 0xB1, 0x07, 0xBF, 0x9B, 0x81, 0x4A, 0xDA}

'0xE1, 0x40, 0xE5, 0x36, 0x2E, 0xD2, 0xC6, 0x42, 0x28, 0xB1, 0x07, 0xBF, 0x9B, 0x81, 0x4A, 0xDA'

0xE1 0x40 0xE5 0x36 0x2E 0xD2 0xC6 0x42 0x28 0xB1 0x07 0xBF 0x9B 0x81 0x4A 0xDA

It seems to only capture the last byte and not the other 15. Error message:

zwave2mqtt | Initialising OpenZWave 1.4.3335 binary addon for Node.JS. zwave2mqtt | OpenZWave Security API is ENABLED zwave2mqtt | ZWave device db : /usr/local/etc/openzwave zwave2mqtt | User settings path : /opt/zwave2mqtt/source zwave2mqtt | Option Overrides : --Logging true --ConsoleOutput true --QueueLogLevel 8 --DriverMaxAttempts 3 --NetworkKey {0xE1, 0x40, 0xE5, 0x36, 0x2E, 0xD2, 0xC6, 0x42, 0x28, 0xB1, 0x07, 0xBF, 0x9B, 0x81, 0x4A, 0xDA} --SaveConfiguration true zwave2mqtt | 2019-02-05T09:07:48.338Z z2m:Zwave Connecting to /dev/ttyACM0 zwave2mqtt | 2019-02-05 09:07:48.342 Always, OpenZwave Version 1.4.3335 Starting Up zwave2mqtt | 2019-02-05 09:07:48.344 Info, Setting Up Provided Network Key for Secure Communications zwave2mqtt | 2019-02-05 09:07:48.345 Warning, Invalid Network Key. Does not contain 16 Bytes - Contains 1 zwave2mqtt | 2019-02-05 09:07:48.346 Warning, Raw Key: 0xDA} zwave2mqtt | 2019-02-05 09:07:48.347 Warning, Parsed Key: zwave2mqtt | 2019-02-05 09:07:48.348 Warning, 1) - 0xDA} zwave2mqtt | 2019-02-05 09:07:48.349 Error, Exception: Driver.cpp:6772 - 103 - Failed to Read Network Key

Thanks

question

Most helpful comment

Yep, removing the spaces did the trick. Thanks

All 13 comments

According to openzwave-shared docs

NetworkKey: "0xCA,0xFE,0xBA,0xBE,.... " // <16 bytes total>

Try to remove the blanck spaces between the bytes, let me know if you make it work so I can close the issue :)

Yep, removing the spaces did the trick. Thanks

@robertsLando
I hit the same problem. However it seems that when I save the key from the UI it automatically formats it with spaces.
I only managed to resolve it by manually editing the settings.json.

@guptamp that's wrong I don't do anything to network key in the code

You should just close this bug without solving the problem which is not indicating anywhere in the user interface or the documention the format of the key.

In fact even after reading this bug report I am still not quite sure what the format is. Do I need the double quotes around the entire string?

@KennethLavrsen No quotes, no spaces works in the configuration screen

I also face the same problem.. removed the quotes and spaces and tried all kind of ways but still stell me invalif key.. how does your settings.json look like? @robertsLando

mine looks like this after setting it in the front-end:

```Initialising OpenZWave 1.4.164 binary addon for Node.JS.
OpenZWave Security API is ENABLED
ZWave device db : /usr/etc/openzwave/
User settings path : /opt/store
Option Overrides : --Logging undefined --ConsoleOutput undefined --QueueLogLevel 6 --DriverMaxAttempts 9999 --SaveConfiguration undefined --PollInterval 1000 --NetworkKey "0xF2, 0x2A, 0x63, 0x8E, 0x0B, 0x97, 0xC9, 0x54, 0x03, 0xBE, 0x87, 0x6B, 0x8B, 0xB0, 0x6A, 0x15"
2019-08-23T10:08:43.697Z z2m:Zwave Connecting to /dev/ttyACM0
2019-08-23 12:08:43.698 Always, OpenZwave Version 1.4.164 Starting Up
2019-08-23 12:08:43.698 Warning, Invalid Network Key. Does not contain 16 Bytes - Contains 1
2019-08-23 12:08:43.698 Warning, Raw Key: 0x15"
2019-08-23 12:08:43.698 Warning, Parsed Key:
2019-08-23 12:08:43.698 Warning, 1) - 0x15"
2019-08-23 12:08:43.698 Error, Exception: Driver.cpp:6727 - 103 - Failed to Read Network Key
Error: Driver.cpp:6727 - Failed to Read Network Key
[12:08:43] INFO: Starting the Z-Wave to MQTT...


WITH SPACES and quotes

{"mqtt":{"name":"zwave2mqtt","host":"192.168.1.41","_ca":"","ca":"","_cert":"","cert":"","_key":"","key":"","port":1883,"reconnectPeriod":1000,"prefix":"zwave2mqtt","qos":0,"retain":true,"auth":true,"username":"hass","password":"hass"},"gateway":{"values":[],"type":0,"payloadType":1,"hassDiscovery":true},"zwave":{"networkKey":"\"0xF2, 0x2A, 0x63, 0x8E, 0x0B, 0x97, 0xC9, 0x54, 0x03, 0xBE, 0x87, 0x6B, 0x8B, 0xB0, 0x6A, 0x15\"","port":"/dev/ttyACM0","pollInterval":1000}}


WITHOUT SPACES BUT WITH QUOTES:

{"mqtt":{"name":"zwave2mqtt","host":"192.168.1.41","_ca":"","ca":"","_cert":"","cert":"","_key":"","key":"","port":1883,"reconnectPeriod":1000,"prefix":"zwave2mqtt","qos":0,"retain":true,"auth":true,"username":"hass","password":"hass"},"gateway":{"values":[],"type":0,"payloadType":1,"hassDiscovery":true},"zwave":{"networkKey":"\"0xF2,0x2A,0x63,0x8E,0x0B,0x97,0xC9,0x54,0x03,0xBE,0x87,0x6B,0x8B,0xB0,0x6A,0x15\"","port":"/dev/ttyACM0","pollInterval":1000}}
```

Short update. I tried to seetup zwave without the key.. and it works of course perfectly but not with my devices which have a key.. then i added the zwave key afterwards WITHOUT spaces and WITH quotes and booaaamm .. it works .. dunno why but adding the network key after setting up the zwave works fine

@robertsLando
I hit the same problem. However it seems that when I save the key from the UI it automatically formats it with spaces.
I only managed to resolve it by manually editing the settings.json.

I got this far as well. I am not prepared to edit Json. This should work.

The documentation needs to be updated to tell us what to do This addon has confusing configuration from the start with the login box coming up - how do we log in? Google it. How do we configure it for Hassio? Google it. etc.

I would love to write the Readme, but as I can't get it working, therein lies the problem.

You are speaking about the hass io addon that is not made by me. I don’t know what you mean with login box as I don’t have any login on my side. About the network key, It is documented in Readme how to enter it correctly, if you tell me that the spaces are atumatically added by the application I will investigate about this but other users using it never got this problem

Daniel

On 10 Nov 2019, at 22:56, Riccardo notifications@github.com wrote:


@robertsLando
I hit the same problem. However it seems that when I save the key from the UI it automatically formats it with spaces.
I only managed to resolve it by manually editing the settings.json.

I got this far as well. I am not prepared to edit Json. This should work.

The documentation needs to be updated to tell us what to do This addon has confusing configuration from the start with the login box coming up - how do we log in? Google it. How do we configure it for Hassio? Google it. etc.

I would love to write the Readme, but as I can't get it working, therein lies the problem.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Yes, sorry. I was getting really frutrated with this as it was the third time I tried to install and configure this plugin without success (and I have worked in IT for 20 years).

The error is that I copied and pasted my network key with spaces in to the network key field and saved. This clearly failed, but then when I deleted the spaces and re-saved, it did not update the key.

So, once you get the key wrong, you are wrong forever. The solution I found was to uninstall completely, reinstall, then enter the network key without spaces.

It would be good if the interface stripped whitespace from the network key when saving.

I really don’t know why this could happen, it is strange. I mean you should be able to edit all settings even the network key, I will investigate about this

Daniel

On 11 Nov 2019, at 22:06, Riccardo notifications@github.com wrote:


Yes, sorry. I was getting really frutrated with this as it was the third time I tried to install and configure this plugin without success (and I have worked in IT for 20 years).

The error is that I copied and pasted my network key with spaces in to the network key field and saved. This clearly failed, but then when I deleted the spaces and re-saved, it did not update the key.

So, once you get the key wrong, you are wrong forever. The solution I found was to uninstall completely, reinstall, then enter the network key without spaces.

It would be good if the interface stripped whitespace from the network key when saving.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

Was this page helpful?
0 / 5 - 0 ratings