MQTT client enhanced (experimental)
This commit is contained in:
1 parent
55315b7301
commit
d555656852
5 files changed
+72
-66
No files matched your search
@@ -11,6 +11,7 @@
|
||||
#define BME_IRQ 0x080
|
||||
#define MATRIX_DISPLAY_IRQ 0x100
|
||||
#define PMU_IRQ 0x200
|
||||
#define MQTT_IRQ 0x400
|
||||
|
||||
#include "globals.h"
|
||||
#include "button.h"
|
||||
@@ -20,10 +21,12 @@
|
||||
#include "bmesensor.h"
|
||||
#include "power.h"
|
||||
#include "ledmatrixdisplay.h"
|
||||
#include "mqttclient.h"
|
||||
|
||||
void irqHandler(void *pvParameters);
|
||||
void mask_user_IRQ();
|
||||
void unmask_user_IRQ();
|
||||
void doIRQ(int irq);
|
||||
|
||||
#ifdef HAS_DISPLAY
|
||||
void IRAM_ATTR DisplayIRQ();
|
||||
@@ -41,5 +44,4 @@ void IRAM_ATTR ButtonIRQ();
|
||||
void IRAM_ATTR PMUIRQ();
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -6,17 +6,20 @@
|
||||
#include <ETH.h>
|
||||
#include <PubSubClient.h>
|
||||
|
||||
#define MQTT_INTOPIC "paxcounter_in/"
|
||||
#define MQTT_OUTTOPIC "paxcounter_out/"
|
||||
#define MQTT_INTOPIC "paxcounter/in"
|
||||
#define MQTT_OUTTOPIC "paxcounter/out"
|
||||
#define MQTT_PORT 1883
|
||||
#define MQTT_SERVER "broker.hivemq.com"
|
||||
#define MQTT_RETRYSEC 10 // retry reconnect every 10 seconds
|
||||
//#define MQTT_SERVER "test.mosquitto.org"
|
||||
#define MQTT_RETRYSEC 20 // retry reconnect every 20 seconds
|
||||
#define MQTT_KEEPALIVE 10 // seconds to keep alive server connections
|
||||
|
||||
extern TaskHandle_t mqttTask;
|
||||
extern PubSubClient mqttClient;
|
||||
|
||||
void mqtt_enqueuedata(MessageBuffer_t *message);
|
||||
void mqtt_queuereset(void);
|
||||
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);
|
||||
|
||||
Reference in new issue
Block a user