mqtt lib changed (experimental)

This commit is contained in:
Klaus K Wilting committed 2020-06-20 15:04:03 +02:00
1 parent c51a45cfd0
commit 6b785fedd7
5 files changed
+110 -97

No files matched your search

+13 -5
View File
@@ -4,15 +4,22 @@
#include "globals.h"
#include "rcommand.h"
#include <ETH.h>
#include <PubSubClient.h>
#include <MQTT.h>
#define MQTT_INTOPIC "paxcounter/in"
#define MQTT_OUTTOPIC "paxcounter/out"
#define MQTT_PORT 1883
#define MQTT_SERVER "broker.hivemq.com"
//#define MQTT_SERVER "test.mosquitto.org"
#define MQTT_SERVER "broker.shiftr.io"
//#define MQTT_CLIENTNAME "arduino"
#define MQTT_USER "try"
#define MQTT_PASSWD "try"
#define MQTT_RETRYSEC 20 // retry reconnect every 20 seconds
#define MQTT_KEEPALIVE 10 // seconds to keep alive server connections
#define MQTT_KEEPALIVE 10 // keep alive interval in seconds
#define MQTT_TIMEOUT 1000 // timeout for all mqtt commands in milliseconds
#ifndef MQTT_CLIENTNAME
#define MQTT_CLIENTNAME clientId.c_str()
#endif
extern TaskHandle_t mqttTask;
@@ -22,7 +29,8 @@ void mqtt_irq(void);
void mqtt_loop(void);
void mqtt_client_task(void *param);
int mqtt_connect(const char *my_host, const uint16_t my_port);
void mqtt_callback(char *topic, byte *payload, unsigned int length);
void mqtt_callback(MQTTClient *client, char topic[], char payload[],
int length);
void NetworkEvent(WiFiEvent_t event);
esp_err_t mqtt_init(void);