Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

RPC-MQTT offline messaging

I'm struggling to make the rpc-mqtt work with offline messages with QOS=1, but i notice that:

My broker send the queued message BEFORE the rpc mqtt channel was opened, then the code rejects it, with the "Ignored frame from closed channel (MQTT)" message.

Any advice on this ?

[Dec 11 14:17:20.012] mgos_net_on_change_c WiFi STA: ready, IP 192.168.0.204, GW 192.168.0.1, DNS 192.168.0.1
[Dec 11 14:17:20.012] mgos_sntp_retry      SNTP next query in 1017 ms
[Dec 11 14:17:20.012] mgos_mqtt_global_con MQTT connecting to 192.168.0.100:1883
[Dec 11 14:17:20.012] mg_connect_opt       0x3ffb9ae4 192.168.0.100:1883 -,-,-
[Dec 11 14:17:20.012] mg_do_connect        0x3ffb9ae4 tcp://192.168.0.100:1883
[Dec 11 14:17:20.012] mg_rpc_channel_ws_ou 0x3ffc5fcc Connecting to wss://dash.mongoose-os.com/api/v2/rpc, SSL? 1
[Dec 11 14:17:20.012] mg_connect_http_base wss://dash.mongoose-os.com/api/v2/rpc use_ssl? 1 tcp://dash.mongoose-os.com:443
[Dec 11 14:17:20.069] mg_connect_opt       0x3ffb9dc8 tcp://dash.mongoose-os.com:443 -,-,ca.pem
[Dec 11 14:17:20.069] find_mount_by_path   ca.pem -> /ca.pem pl 1 -> 1 0x3ffc5454
[Dec 11 14:17:20.069] mgos_vfs_open        ca.pem 0x0 0x1b6 => 0x3ffc5454 ca.pem 1 => 257 (refs 1)
[Dec 11 14:17:20.069] mgos_vfs_close       257 => 0x3ffc5454:1 => 0 (refs 0)
[Dec 11 14:17:20.069] mg_connect_opt       0x3ffb94e0 udp://192.168.0.1:53 -,-,-
[Dec 11 14:17:20.069] mg_do_connect        0x3ffb94e0 udp://192.168.0.1:53
[Dec 11 14:17:20.069] mgos_event_trigger   ev NET3 triggered 3 handlers
[Dec 11 14:17:20.069] mg_if_connect_cb     0x3ffb94e0 udp://192.168.0.1:53 -> 0
[Dec 11 14:17:20.069] mg_rpc_ev_handler    0x3ffc61c0 CHAN OPEN (loopback)
[Dec 11 14:17:20.097] mgos_event_trigger   ev RPC0 triggered 1 handlers
[Dec 11 14:17:20.097] mg_do_connect        0x3ffb9dc8 tcp://35.205.44.181:443
[Dec 11 14:17:20.337] mg_if_connect_cb     0x3ffb9dc8 tcp://35.205.44.181:443 -> 0
[Dec 11 14:17:20.421] mg_if_connect_cb     0x3ffb9ae4 tcp://192.168.0.100:1883 -> 0
[Dec 11 14:17:20.421] mgos_mqtt_ev         MQTT TCP connect ok (0)
[Dec 11 14:17:20.477] mgos_mqtt_ev         MQTT event: 202
[Dec 11 14:17:20.477] mgos_mqtt_ev         MQTT CONNACK 0
[Dec 11 14:17:20.477] MQTT: CONNECTED !
[Dec 11 14:17:20.477] mgos_mqtt_pub        Publishing to v1/gateway/connect @ 1 (19): [{"device":"0-1-22"}]
[Dec 11 14:17:20.477] SYSTEM: WAIT_MQTT, transition to WAIT_COMMANDS
[Dec 11 14:17:20.477] SYSTEM: WAIT_COMMANDS, state
[Dec 11 14:17:20.477] mgos_event_trigger   ev HSM6 triggered 0 handlers
[Dec 11 14:17:20.477] do_subscribe         Subscribing to '/0-1-22/#'
[Dec 11 14:17:20.477] do_subscribe         Subscribing to 'DESTO_240AC413D594/rpc'
[Dec 11 14:17:20.477] mgos_event_trigger   ev MOS4 triggered 0 handlers
[Dec 11 14:17:20.477] mgos_mqtt_ev         MQTT event: 203
[Dec 11 14:17:20.526] mg_rpc_ev_handler    0x3ffc6260 GOT FRAME (60): {"src":"desto-configurator","method":"Config.Get","args":{}}
[Dec 11 14:17:20.526] mg_rpc_parse_frame   '' 'desto-configurator' '' 'Config.Get'
[Dec 11 14:17:20.526] mg_rpc_handle_frame  0x3ffc6260 Ignored frame from closed channel (MQTT)
[Dec 11 14:17:20.526] mg_rpc_ev_handler    0x3ffc6260 INVALID FRAME (60): '{"src":"desto-configurator","method":"Config.Get","args":{}}'
[Dec 11 14:17:20.526] mgos_mqtt_ev         MQTT event: 203
[Dec 11 14:17:20.526] mg_rpc_ev_handler    0x3ffc6260 GOT FRAME (60): {"src":"desto-configurator","method":"Config.Get","args":{}}
[Dec 11 14:17:20.582] mg_rpc_parse_frame   '' 'desto-configurator' '' 'Config.Get'
[Dec 11 14:17:20.582] mg_rpc_handle_frame  0x3ffc6260 Ignored frame from closed channel (MQTT)
[Dec 11 14:17:20.582] mg_rpc_ev_handler    0x3ffc6260 INVALID FRAME (60): '{"src":"desto-configurator","method":"Config.Get","args":{}}'
[Dec 11 14:17:20.583] mgos_mqtt_ev         MQTT event: 204
[Dec 11 14:17:20.583] MQTT: PUBLISHED, ID=1
[Dec 11 14:17:20.583] mgos_mqtt_ev         MQTT event: 209
[Dec 11 14:17:20.583] mgos_mqtt_ev         MQTT event: 209
[Dec 11 14:17:20.583] mg_rpc_ev_handler    0x3ffc6260 CHAN OPEN (MQTT)
[Dec 11 14:17:20.583] mgos_event_trigger   ev RPC0 triggered 1 handlers
Sign In or Register to comment.