'esp32 arduino mqtt over websocket?
I'm working on something that needs MQTT over websocket (my server limitation on port 80)
I've looked everywhere for it, but either no one have ability to !ratain or (||) send over websocket packets. :D
I've somehow get to this include in arduino ---> its close src and low language (at least for me!)
#include "mqtt_client.h"
and does this on my code:
esp_mqtt_client_config_t mqttConfig;
mqttConfig.uri = "ws://test.mosquitto.org";
mqttConfig.port = 8080;
mqttConfig.transport = MQTT_TRANSPORT_OVER_WS;
mqttConfig.event_handle(evt);
esp_mqtt_client_handle_t client = esp_mqtt_client_init(&mqttConfig);
//esp_mqtt_client_register_event(client, ESP_EVENT_ANY_ID, mqtt_event_handler, client);
esp_mqtt_client_start(client);
ERROR:
cannot convert 'void (*)(esp_mqtt_event_handle_t) {aka void (*)(esp_mqtt_event_t*)}' to 'esp_mqtt_event_handle_t {aka esp_mqtt_event_t*}' in argument passing
I'll send the header file below and some more:
Solution 1:[1]
Here:
esp_mqtt_client_handle_t client = esp_mqtt_client_init(&mqttConfig); you are not giving the function handle, but... assigning the result of invoked function...
This should be:
esp_mqtt_client_handle_t client = esp_mqtt_client_init;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Grzegorz Grz?da |
