- Let the WIFI connection progress ...
- I (6164) wifi: new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
- I (6164) wifi: state: init -> auth (b0)
- I (6184) wifi: state: auth -> assoc (0)
- I (6194) wifi: state: assoc -> run (10)
- I (6214) wifi: connected with MIWIFI_SSXU, aid = 3, channel 1, BW20, bssid = 50:78:b3:d4:a7:a4, security type: 4, phy: bgn, rssi: -67
- I (6224) wifi: pm start, type: 1
- I (6334) wifi: AP's beacon interval = 102400 us, DTIM period = 1
- I (9364) esp_netif_handlers: sta ip: 192.168.1.154, mask: 255.255.255.0, gw: 192.168.1.1
- I (9364) power_save: got ip: 192.168.1.154
- Box Connected and ready to send data.
- Sending data to local broker...
- JSON len = 73
- JSON Payload ={"temperature":31.54296875,"humidity":39.154052734375,"co2":400,"tvoc":0}
- MQTT Topic : dt/h1/r1/s2
- MQTT Data : {"temperature":31.54296875,"humidity":39.154052734375,"co2":400,"tvoc":0}
- I (11064) MQTTS_FUNCTIONS: [APP] Startup..
- I (11064) MQTTS_FUNCTIONS: [APP] Free memory: 233908 bytes
- I (11074) MQTTS_FUNCTIONS: [APP] IDF version: v4.1-dev-1086-g93a8603c5-dirty
- I (11084) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
- Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
- Core 0 register dump:
- PC : 0x400d7ed4 PS : 0x00060f30 A0 : 0x800d5c07 A1 : 0x3ffbb280
- 0x400d7ed4: mqtt_get_type at /home/noid/esp/esp-idf/components/mqtt/esp-mqtt/lib/include/mqtt_msg.h:93
- (inlined by) esp_mqtt_client_publish at /home/noid/esp/esp-idf/components/mqtt/esp-mqtt/mqtt_client.c:1317
- A2 : 0x3ffc6644 A3 : 0x00000000 A4 : 0x3ffc6500 A5 : 0x00000049
- A6 : 0x00000001 A7 : 0x3ffbb290 A8 : 0x800d7e9d A9 : 0x3ffbb260
- A10 : 0x3ffc6670 A11 : 0x3f403bd8 A12 : 0x3ffc6500 A13 : 0x00000049
- A14 : 0x00000001 A15 : 0x00000000 SAR : 0x0000000c EXCCAUSE: 0x0000001c
- EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffc
- ELF file SHA256: 41bef4c4b700d514d8ccaaa205a3e43dd41d361fe5f5919162a398cd668de929
- Backtrace: 0x400d7ed1:0x3ffbb280 0x400d5c04:0x3ffbb2d0 0x400d6598:0x3ffbb370 0x400d208a:0x3ffbb3b0 0x40094079:0x3ffbb3d0
- 0x400d7ed1: esp_mqtt_client_publish at PATH/esp-idf/components/mqtt/esp-mqtt/mqtt_client.c:1316
- 0x400d5c04: mqtt_send at ../main/wds_f/mqtt_functions.c:168
- 0x400d6598: app_main at /../main/wisedomsensor_main.c:222
- 0x400d208a: main_task at PATH/esp-idf/components/esp32/cpu_start.c:569
- 0x40094079: vPortTaskWrapper at PATH/esp-idf/components/freertos/port.c:143
- Rebooting...
Thanks in first term for developing this great IoT tool.
We are having problems to publish simple MQTT JSON string to a broker.
When we try to use esp_mqtt_client_publish() out of the mqtt_event_handler_cb(esp_mqtt_event_handle_t event), the system halts and reboot, we don't figure out how can we pass variables to mqtt_event_handler and mqtt_event_handler_cb, in order tu publish correctly in a polite way.
We can only send simple strings from the mqtt_event_handler_cb(esp_mqtt_event_handle_t event) function , and we need to send unformated JSON varibles, any way we try to pass those variables end in a compile error or unit GURU MEDITATION.
Please help .-
Thank you in advance..
Santi ,
D51 Tech guy.
Our mqtt function :
- static void mqtt_send(char *topic, char *message)
- {
- printf("MQTT Topic : %s\n",topic);
- printf("MQTT Data : %s\n",message);
- ESP_LOGI(MTAG, "[APP] Startup..");
- ESP_LOGI(MTAG, "[APP] Free memory: %d bytes", esp_get_free_heap_size());
- ESP_LOGI(MTAG, "[APP] IDF version: %s", esp_get_idf_version());
- esp_log_level_set("*", ESP_LOG_INFO);
- esp_log_level_set("MQTT_CLIENT", ESP_LOG_VERBOSE);
- esp_log_level_set("MQTT_EXAMPLE", ESP_LOG_VERBOSE);
- esp_log_level_set("TRANSPORT_TCP", ESP_LOG_VERBOSE);
- esp_log_level_set("TRANSPORT_SSL", ESP_LOG_VERBOSE);
- esp_log_level_set("TRANSPORT", ESP_LOG_VERBOSE);
- esp_log_level_set("OUTBOX", ESP_LOG_VERBOSE);
- esp_mqtt_client_config_t mqtt_cfg = {
- .uri = CONFIG_BROKER_URL
- };
- esp_mqtt_client_handle_t client = esp_mqtt_client_init(&mqtt_cfg);
- esp_mqtt_client_register_event(client, ESP_EVENT_ANY_ID, mqtt_event_handler, client);
- esp_mqtt_client_start(client);
- esp_mqtt_client_publish(client,topic,message, 0, 1, 0); // <<<<< If we remove this LINE Everything run nice. Does not work even passing a string "quoted".
- esp_mqtt_client_destroy(client);
- }