mqttclient reworked (experimental)
This commit is contained in:
1 parent
1950650bfb
commit
a30eab54f7
5 files changed
+25
-44
No files matched your search
@@ -11,7 +11,6 @@
|
||||
#define BME_IRQ 0x080
|
||||
#define MATRIX_DISPLAY_IRQ 0x100
|
||||
#define PMU_IRQ 0x200
|
||||
#define MQTT_IRQ 0x400
|
||||
|
||||
#include "globals.h"
|
||||
#include "button.h"
|
||||
@@ -21,7 +20,6 @@
|
||||
#include "bmesensor.h"
|
||||
#include "power.h"
|
||||
#include "ledmatrixdisplay.h"
|
||||
#include "mqttclient.h"
|
||||
|
||||
void irqHandler(void *pvParameters);
|
||||
void mask_user_IRQ();
|
||||
|
||||
@@ -6,17 +6,15 @@
|
||||
#include <MQTT.h>
|
||||
#include <ETH.h>
|
||||
|
||||
#define MQTT_ETHERNET 0 // set to 0 to run on Wifi
|
||||
#define MQTT_ETHERNET 0 // select PHY: set 0 for Wifi, 1 for ethernet
|
||||
#define MQTT_INTOPIC "paxin"
|
||||
#define MQTT_OUTTOPIC "paxout"
|
||||
#define MQTT_PORT 1883
|
||||
#define MQTT_SERVER "broker.shiftr.io"
|
||||
//#define MQTT_CLIENTNAME "arduino"
|
||||
#define MQTT_USER "try"
|
||||
#define MQTT_PASSWD "try"
|
||||
#define MQTT_SERVER "paxcounter.cloud.shiftr.io"
|
||||
#define MQTT_USER "public"
|
||||
#define MQTT_PASSWD "public"
|
||||
#define MQTT_RETRYSEC 20 // retry reconnect every 20 seconds
|
||||
#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()
|
||||
@@ -27,13 +25,12 @@ extern TaskHandle_t mqttTask;
|
||||
void mqtt_enqueuedata(MessageBuffer_t *message);
|
||||
uint32_t mqtt_queuewaiting(void);
|
||||
void mqtt_queuereset(void);
|
||||
void setMqttIRQ(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(MQTTClient *client, char topic[], char payload[],
|
||||
int length);
|
||||
void NetworkEvent(WiFiEvent_t event);
|
||||
esp_err_t mqtt_init(void);
|
||||
void mqtt_deinit(void);
|
||||
|
||||
#endif // _MQTTCLIENT_H
|
||||
Reference in new issue
Block a user