Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

MQTT does not connect with the latest mongoose os

MQTT service stopped working on esp8266 after flashing it with the latest mongoose os. I can't see any log from the mgos_mqtt_ev.

The logs:
bcn 0
del if1
usl
mode : null
mgos_wifi_set_mode WiFi mode: AP
mode : softAP(a2:20:a6:18:32:df)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
mgos_wifi_setup_ap WiFi AP: SSID Mongoose_1832DF, channel 6
bcn 0
del if1
usl
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
mgos_wifi_setup_ap WiFi AP IP: 192.168.4.1/255.255.255.0 gw 192.168.4.1, DHCP range 192.168.4.2 - 192.168.4.100
mgos_i2c_create I2C GPIO init ok (SDA: 12, SCL: 14)
mgos_sys_config_init HTTP server started on [80]
mg_rpc_channel_uart 0x3fff0a94 UART0
mg_rpc_add_channel_i 0x3fff0a94 '' UART, trusted
mg_rpc_add_channel_i 0x3fff0b04 'RPC.LOCAL' loopback, trusted
set_spiffs_errno init.js: res = 1, e = -10002
mgos_mjs_init mJS memory stat: before init: 45948 after init: 44528 after init.js: 40764
mg_rpc_channel_mqtt 0x3fff1604 esp8266_1832DF/rpc/#
mg_rpc_add_channel_i 0x3fff1604 '*' MQTT, trusted
mgos_init Init done, RAM: 51904 total, 39924 free, 37864 min free
mgos_upd_boot_finish 1 0
mg_rpc_ev_handler 0x3fff0b04 CHAN OPEN (loopback)
Tick uptime: 2.651660 {"free_ram":40176,"total_ram":51904}
Published: no topic: /devices/esp8266_1832DF/events message

The config is:

"mqtt": {
"enable": true,
"server": "iot.eclipse.org:1883",
"client_id": "",
"user": "",
"pass": "",
"reconnect_timeout_min": 2,
"reconnect_timeout_max": 60,
"ssl_cert": "",
"ssl_key": "",
"ssl_ca_cert": "",
"ssl_cipher_suites": "",
"ssl_psk_identity": "",
"ssl_psk_key": "",
"clean_session": true,
"keep_alive": 60,
"will_topic": "",
"will_message": ""
}

and here is the code:

Timer.set(1000 /* 1 sec /, true / repeat */, function() {
let value = GPIO.toggle(led);
print(value ? 'Tick' : 'Tock', 'uptime:', Sys.uptime(), getInfo());
let topic = '/devices/' + Cfg.get('device.id') + '/events';
let message = getInfo();
let ok = MQTT.pub(topic, message, 1);
print('Published:', ok ? 'yes' : 'no', 'topic:', topic, 'message:', message);

}, null);

Thanked by 1UserMartin

Comments

Sign In or Register to comment.