openLuup: MQTT server
-
FWIW, I've now updated, and hopefully corrected, the code – v21.4.26 is the latest development version. So, I'd be very grateful if anyone is brave enough to test this.
I'm really glad of this error being highlighted, beause it's caused me to re-think somewhat the openLuup object API, and I'm rather happier with the outcome now. No guarantees, of course, that this fixes all the problems, but I hope that it is a step in the right direction.
PS: One of my systems exhibited the AltUI missing buttons, but, curiously, one did not. However, they both appear to work OK after this update.
-
Yes, that's correct. It effectively rips out some recent changes which now don't fit with the roadmap forward.
I had previously been adding, partially hidden, features to the usual luup API. My plan now is to freeze the functionality of that API (which is what third-party plugins use, including AltUI) but to extend the underlying openLuup object-oriented API. In doing so, I hope to minimize the chance of breaking working plugins.
In this particular case, the changes have been to 'virtualize' device variables so that they can now be addressed directly as program variables, rather than having to resort to get/set functions. The Shelly and Tasmota bridges use this approach.
-
@akbooer With .26, the sub-menu is back, and I don't see any errors outside of the MQTT receive error.
I wouldn't be overly concerned with "Development" branches breaking things. That's the risk users take with deploying those branches. I'm stoked on your MQTT advances and am more than willing to troubleshoot the inevitable bugs that pop up when building out new features....
-
@akbooer said in openLuup: MQTT server:
FWIW, I've now updated, and hopefully corrected, the code – v21.4.26 is the latest development version. So, I'd be very grateful if anyone is brave enough to test this.
I'm really glad of this error being highlighted, beause it's caused me to re-think somewhat the openLuup object API, and I'm rather happier with the outcome now. No guarantees, of course, that this fixes all the problems, but I hope that it is a step in the right direction.
PS: One of my systems exhibited the AltUI missing buttons, but, curiously, one did not. However, they both appear to work OK after this update.
Is this ready for prime time? No biggy if not, yet
Cheers
C
-
I’m using it in my 'production' system. I’m not planning any major enhancements (indeed, there isn’t much more to add) and all the Shelly and Tasmota bridges need is support for more devices.
So it works for me (I don’t bridge to another MQTT server myself.)
-
Thanks. Updated OpenLuup to 21.4.26 and the tags are back
C
-
-
Hi guys - just received some Shelly H & Ts. Is there any documentation on how to connect these to mqtt (in novice speak )? Have read the thread but am getting slightly confused - do I need just the openluup mqtt server or another plugin also?
-
No other plug-in required… Shelly and Tasmota plugins are built-in. For Shellies, you just need to plug in the IP address of openLuup as the MQTT server.
-
Will I need to set ports or do anything in Lua Startup still?
-
Yes, you need simply to set up a port for the MQTT server
luup.attr_set ("openLuup.MQTT.Port", 1883)
In Lua Startup, and set the same for the Shellies.
-
OMG. Genius. Many thanks indeed! Note to self - for Shelly .. Internet & Security/Advanced - Developer Settings/Enable MQTT
-
The first Shelly I tried worked with the bridge created and device created in the Shellies room. The next ones also appear in openLuup/Servers/Received Connections list but don't appear as devices. Have I missed a step?
-
No, I don't think so. Where are you looking at the devices (AltUI / openLuup console)?
Anything in the log?
-
Should have looked first ! Red highlights a win here; am seeing this ... (is there a proper way of copying and pasting?)
2021-06-12 11:10:01.904 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=492370363&Timeout=60&MinimumDelay=1500&_=1623492371898 HTTP/1.1 tcp{client}: 0x1e96db0
2021-06-12 11:10:19.108 openLuup.io.server:: MQTT:1883 connection from 192.168.1.156 tcp{client}: 0x1d97790
2021-06-12 11:10:19.152 openLuup.mqtt:: shellyht-E01A8B SUBSCRIBE to shellies/command tcp{client}: 0x1d97790
2021-06-12 11:10:19.153 openLuup.mqtt:: shellyht-E01A8B SUBSCRIBE to shellies/shellyht-E01A8B/command tcp{client}: 0x1d97790
2021-06-12 11:10:19.156 luup.shelly:83: New Shelly announced: shellyht-E01A8B
2021-06-12 11:10:19.279 openLuup.context_switch:: ERROR: [dev #83] ./openLuup/client.lua:96: missing realm or nonce in received WWW-Authenticate header
2021-06-12 11:10:19.280 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/announce : ./openLuup/client.lua:96: missing realm or nonce in received WWW-Authenticate header
2021-06-12 11:10:19.393 openLuup.server:: request completed (1891 bytes, 1 chunks, 17488 ms) tcp{client}: 0x1e96db0 -
akbooerreplied to powisquare on Jun 12, 2021, 2:55 PM last edited by akbooer Jun 12, 2021, 10:56 AM
@powisquare said in openLuup: MQTT server:
Should have looked first ! Red highlights a win here; am seeing this ... (is there a proper way of copying and pasting?)
2021-06-12 11:10:01.904 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=492370363&Timeout=60&MinimumDelay=1500&_=1623492371898 HTTP/1.1 tcp{client}: 0x1e96db0
2021-06-12 11:10:19.108 openLuup.io.server:: MQTT:1883 connection from 192.168.1.156 tcp{client}: 0x1d97790
2021-06-12 11:10:19.152 openLuup.mqtt:: shellyht-E01A8B SUBSCRIBE to shellies/command tcp{client}: 0x1d97790
2021-06-12 11:10:19.153 openLuup.mqtt:: shellyht-E01A8B SUBSCRIBE to shellies/shellyht-E01A8B/command tcp{client}: 0x1d97790
2021-06-12 11:10:19.156 luup.shelly:83: New Shelly announced: shellyht-E01A8B
2021-06-12 11:10:19.279 openLuup.context_switch:: ERROR: [dev #83] ./openLuup/client.lua:96: missing realm or nonce in received WWW-Authenticate header
2021-06-12 11:10:19.280 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/announce : ./openLuup/client.lua:96: missing realm or nonce in received WWW-Authenticate header
2021-06-12 11:10:19.393 openLuup.server:: request completed (1891 bytes, 1 chunks, 17488 ms) tcp{client}: 0x1e96db0Yes, there is, there's a little code icon </> in the full Reply window (not the Quick one):
2021-06-12 11:10:01.904 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=492370363&Timeout=60&MinimumDelay=1500&_=1623492371898 HTTP/1.1 tcp{client}: 0x1e96db0 2021-06-12 11:10:19.108 openLuup.io.server:: MQTT:1883 connection from 192.168.1.156 tcp{client}: 0x1d97790 2021-06-12 11:10:19.152 openLuup.mqtt:: shellyht-E01A8B SUBSCRIBE to shellies/command tcp{client}: 0x1d97790 2021-06-12 11:10:19.153 openLuup.mqtt:: shellyht-E01A8B SUBSCRIBE to shellies/shellyht-E01A8B/command tcp{client}: 0x1d97790 2021-06-12 11:10:19.156 luup.shelly:83: New Shelly announced: shellyht-E01A8B 2021-06-12 11:10:19.279 openLuup.context_switch:: ERROR: [dev #83] ./openLuup/client.lua:96: missing realm or nonce in received WWW-Authenticate header 2021-06-12 11:10:19.280 openLuup.mqtt:: ERROR publishing application message for mqtt:shellies/announce : ./openLuup/client.lua:96: missing realm or nonce in received WWW-Authenticate header 2021-06-12 11:10:19.393 openLuup.server:: request completed (1891 bytes, 1 chunks, 17488 ms) tcp{client}: 0x1e96db0
Oooh, that's a nasty error. I don't have any HT devices, I see that they are battery operated and wake up from time to time. I do have a button 1, which does a similar thing, but I haven't seen this problem.
It may be that the device's HTTP server isn't active during the MQTT Announce – the Shelly plugin normally gets a full configuration over HTTP, not MQTT, so I may have to change this approach for certain devices. I see there is a 120ms delay between the Announce message and the HTTP error – a long time for things to have happened in between...
...I will read up more on the device. Any thoughts anyone??
= = = = = =
Edit: have you set a Username and Password? ...perhaps that's an issue.
-
powisquarewrote on Jun 12, 2021, 2:59 PM last edited by powisquare Jun 12, 2021, 11:01 AM
Yes I have - on all of them. I seem to recall, when setting up the first one, that openLuup recognised a button press. Perhaps that's how it worked. These sensors wake up on an hourly basis, but when you wake them up manually they are awake for a minute or so (it seems).
-
powisquarewrote on Jun 12, 2021, 3:03 PM last edited by powisquare Jun 12, 2021, 11:31 AM
Sorry - my bad. Device that's working does not have a password. I'll have another go.
Boom - all working
-
So, I need to fix HTTP access for device with a password, it seems. That makes sense given the 'nonce' error message.
125/179