I am running OH2
Version: 2.5.0-SNAPSHOT (#1675)
Hardware is RPI3 with openhabian
Now, I have recently experienced issues with MQTT Devices getting
HANDLER_INITIALIZING_ERROR
Syslog says this
" message=“Exception occurred while initializing handler of thing ‘mqtt:homie300:4ee3104e:comfortzone’: hexString contains illegal character for hexToBytes: 97”] Exception occurred while initializing handler of thing ‘mqtt:homie300:4ee3104e:comfortzone’: hexString contains illegal character for hexToBytes: 97
If I remove the thing and then re-add it, it all works fine for a while (weeks)
Is it possible to script this item removal / re-add if the problem I have is a bug?
Ok. It seem that hexToBytes expects upper case letters while lower case letters are supplied. Can you verify that? A tool like MQTT Inspector ok iOS (surely there is an equivalent on Android) might help.
Hi
Just so I do not missunderstand you now, but I have no hex values in my MQTT topics or values.
Of course the plain ascii could be converted internally in the binding somewhere to hex?
That looks good. I think your pronlem might be related to the latest changes regarding encoding of special characters. Can you show the same view for the device that has problems?
Hi, no special characters should be in these channels.
“mqtt:homie:714b1d70:power_5Ffan#powerpercent” is defined as “mqtt:homie:714b1d70:power_fan#powerpercent”
Not 100% sure, but I Think that this “5F” is quite new. Maybe in the latest snapshot. Not sure.
They are. I think documentation needs to be adapted here. We have the situation that the homie binding maps MQTT topics to channel names. We had to find a way to make this possible for all special characters and the way is to escape all characters except A-Za-z0-9. This is done by converting the character to the equivalent hexadecimal string and prepend that with the allowed special character _.
So the topic command_topic is parsed, the _ is found, this is converted to _5F and the corresponding channel name is then command_5Ftopic. So the problem arises if you define a channel name with an underscore (sample_channel) and the homie binding (this is only happening for homie!) tries to convert that back to a topic. It sees the _ and expects the next to characters to be the hexadecimal ASCII code of the escaped character. Of course ch is not a valid hexadecimal value and the exception occurs.
I, I can confirm that removing underscores was a salvation here.
Not only that the exeptions dissapeared, new Items now automatically shows up in the inbox.
Previously I had to manually search…