Posted: 04:15pm 03 Jun 2025 |
Copy link to clipboard |
 Print this post |
|
I haven't seen this mentioned in this thread, and did a search to see if it got brought up in another thread.
Between 6.00.01 release and the 6.00.02 betas there seems to be a loss of functionality with MQTT. I say seems to be as there isn't any detail in the manual on how it is supposed to work (that I could find) so my usage has been derived from examples I've found.
When a message is posted to a broker in a subscribed topic MM.MESSAGE$ holds the message and it can be displayed or used, as in .01, but MM.TOPIC$ does not seem to contain anything. I haven't done extensive testing to see if it returns a blank or null, but usage in a PRINT line produces no visible output.
I see that a bit has changed in how these two are populated between .01 and now; and while I understand the code enough to see what it's supposed to be doing I don't understand it enough to identify why it might not be,
My environment is as follows:
MM.TOPIC$ works: Pico 2 W running: WebMite MMBasic RP2350A Edition V6.00.01
Options:
OPTION FLASH SIZE 4194304 OPTION CPUSPEED 150000 'KHz OPTION WIFI [network appropriate data here]
MM.TOPIC$ does not work: Pico 2 W running: WebMite MMBasic RP2350A Edition V6.00.02RC25
Options:
OPTION FLASH SIZE 4194304 OPTION COLOURCODE ON OPTION CPUSPEED (KHz) 150000 OPTION WIFI [network appropriate data here]
Code used to test:
' MQTT client test
WEB MQTT CLOSE
WEB MQTT CONNECT "test.mosquitto.org", 1884, "ro", "readonly", msgPrint
WEB MQTT SUBSCRIBE "#", 0
Sub msgPrint Print DateTime$(now) Print "Topic : "; MM.TOPIC$ Print "Message: "; MM.MESSAGE$ End Sub
Do
Loop Until Inkey$ = "q"
Sample Output from .02RC25:
Connecting to 5.196.78.28 port 1884 03-06-2025 11:40:31 Topic : Message: 1748965230 03-06-2025 11:40:31 Topic : Message: oint_temperature":{"value":0,"status_code":"{null} @ def","units":""},"unoccupied_heating_setpoint_temperature":{" 03-06-2025 11:40:31 Topic : Message: {"command":0,"timestamp":1744046230,"node_id":8,"node_name":"ตู้ OPD 2","pla 03-06-2025 11:40:31 Topic : Message: tamp":"2025-05-31T11:01:30"}
Sample Output from .01 Release:
Connecting to 5.196.78.28 port 1884 03-06-2025 12:05:23 Topic : //16484256345/radio/rx_succe Message: 48122 03-06-2025 12:05:23 Topic : /116484256345/radio/rx_success Message: 48122 03-06-2025 12:05:23 Topic : /Acm_Moburapa/11C Message: {"slave":1,"temp":1,"co 03-06-2025 12:05:23 Topic : /MCP_Moburapa/11 Message: {"slave":1,"temp":1,"co
Between each flash of firmware I've done a clear flash to make sure nothing lingered.
MM.MESSAGE$ seems to be truncating, but I'm not sure if that's a limitation of the MQTT implementation or a buffer issue. Edited 2025-06-04 02:18 by jkdelauney |