F I N
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "BME280.hpp"
|
||||
#include "MQ7v2.hpp"
|
||||
#include "GPS.hpp"
|
||||
#include "MAX7219.hpp"
|
||||
|
||||
String serializeSensorValue(
|
||||
int groupId,
|
||||
@@ -16,12 +17,4 @@ String serializeSensorValue(
|
||||
const MQ7Data_t &mq7,
|
||||
const GPSData_t &gps);
|
||||
|
||||
String serializeActuatorStatus(
|
||||
int actuatorId,
|
||||
const String &deviceId,
|
||||
int status,
|
||||
long timestamp);
|
||||
|
||||
void deserializeSensorValue(HTTPClient &http, int httpResponseCode);
|
||||
void deserializeActuatorStatus(HTTPClient &http, int httpResponseCode);
|
||||
void deserializeDevice(HTTPClient &http, int httpResponseCode);
|
||||
MAX7219Status_t deserializeActuatorStatus(HTTPClient &http, int httpResponseCode);
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
#define CS_PIN 18
|
||||
#define CLK_PIN 17
|
||||
|
||||
struct MAX7219Status_t
|
||||
{
|
||||
String status;
|
||||
String actuatorStatus;
|
||||
};
|
||||
|
||||
void MAX7219_Init();
|
||||
void MAX7219_DisplayText(const char *text, textPosition_t align, uint16_t speed, uint16_t pause);
|
||||
bool MAX7219_Animate();
|
||||
|
||||
@@ -14,4 +14,5 @@ struct MQ7Data_t
|
||||
};
|
||||
|
||||
void MQ7_Init();
|
||||
MQ7Data_t MQ7_Read();
|
||||
MQ7Data_t MQ7_Read();
|
||||
MQ7Data_t MQ7_Read_Fake();
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "globals.hpp"
|
||||
#include <WiFi.h>
|
||||
#include <PubSubClient.h>
|
||||
#include "RestClient.hpp"
|
||||
|
||||
#define USER "contaminus"
|
||||
#define MQTT_PASSWORD "contaminus"
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
#include <HTTPClient.h>
|
||||
|
||||
void getRequest(const String url, String &response);
|
||||
void postRequest(const String url, const String &payload, String &response);
|
||||
void postRequest(const String url, const String &payload, String &response);
|
||||
void putRequest(const String url, const String &payload, String &response);
|
||||
@@ -1,5 +1,7 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
#define DEVICE_ROLE ACTUATOR // se cambia entre SENSOR y ACTUATOR
|
||||
|
||||
#define MQTT_URI "miarma.net"
|
||||
#define API_URI "https://contaminus.miarma.net/api/v1/"
|
||||
#define REST_PORT 443
|
||||
@@ -10,13 +12,11 @@
|
||||
#define GPS_ID 1
|
||||
#define MAX7219_ID 1
|
||||
|
||||
#define ECO "Solo vehiculos electricos/hibridos"
|
||||
#define ALL "Todo tipo de vehiculos"
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#define SENSOR 0
|
||||
#define ACTUATOR 1
|
||||
|
||||
#define DEBUG
|
||||
|
||||
extern const uint32_t DEVICE_ID;
|
||||
extern const int GROUP_ID;
|
||||
extern const int GROUP_ID;
|
||||
extern String currentMessage;
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "globals.hpp"
|
||||
|
||||
#define DEVICE_ROLE SENSOR // se cambia entre SENSOR y ACTUATOR
|
||||
|
||||
#if DEVICE_ROLE == SENSOR
|
||||
#warning "Compilando firmware para SENSOR"
|
||||
#elif DEVICE_ROLE == ACTUATOR
|
||||
|
||||
Reference in New Issue
Block a user