succesful mqtt connection to server
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "globals.hpp"
|
||||
#include <WiFi.h>
|
||||
#include <PubSubClient.h>
|
||||
#include <PubSubClient.h>
|
||||
|
||||
void MQTT_OnReceived(char *topic, byte *payload, unsigned int length);
|
||||
void MQTT_Init(const char *MQTTServerAddress, uint16_t MQTTServerPort);
|
||||
void MQTT_Connect(const char *MQTTClientName);
|
||||
void MQTT_Handle(const char *MQTTClientName);
|
||||
String buildTopic(int groupId, const String& deviceId, const String& topic);
|
||||
@@ -3,7 +3,4 @@
|
||||
#include <WiFi.h>
|
||||
#include <PubSubClient.h>
|
||||
|
||||
#define SSID "DIGIFIBRA-D2ys"
|
||||
#define PASSWORD "4EEATsyTcZ"
|
||||
|
||||
int setupWifi();
|
||||
22
hardware/include/globals.hpp
Normal file
22
hardware/include/globals.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
#define MQTT_URI "miarma.net"
|
||||
#define API_URI "https://contaminus.miarma.net/api/v1/"
|
||||
#define REST_PORT 443
|
||||
#define MQTT_PORT 1883
|
||||
|
||||
#define USER "contaminus"
|
||||
#define MQTT_PASSWORD "contaminus"
|
||||
|
||||
#define SSID "DIGIFIBRA-D2ys"
|
||||
#define WIFI_PASSWORD "4EEATsyTcZ"
|
||||
|
||||
#define MQ7_ID 3
|
||||
#define BME280_ID 2
|
||||
#define GPS_ID 1
|
||||
#define MAX7219_ID 1
|
||||
|
||||
#define DEBUG
|
||||
|
||||
extern const uint32_t DEVICE_ID;
|
||||
extern const int GROUP_ID;
|
||||
@@ -1,18 +1,6 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
#define SERVER_IP "https://contaminus.miarma.net/api/v1/"
|
||||
#define REST_PORT 443
|
||||
#define MQTT_PORT 1883
|
||||
|
||||
#define GROUP_ID 1
|
||||
|
||||
#define MQ7_ID 3
|
||||
#define BME280_ID 2
|
||||
#define GPS_ID 1
|
||||
#define MAX7219_ID 1
|
||||
|
||||
#define DEBUG
|
||||
#pragma once
|
||||
|
||||
#include "globals.hpp"
|
||||
#include "JsonTools.hpp"
|
||||
#include "RestClient.hpp"
|
||||
#include "WifiConnection.hpp"
|
||||
|
||||
Reference in New Issue
Block a user