@@ -34,10 +34,8 @@ typedef struct {
|
||||
time_t currentTime;
|
||||
time_t chargingStartTime;
|
||||
time_t automaticShutdownTimer;
|
||||
#ifdef SIM800L_ENABLED
|
||||
time_t lastDataSent;
|
||||
bool sim800l_enabled;
|
||||
#endif //SIM800L_ENABLED
|
||||
bool ignitionOn;
|
||||
bool ignitionOnPrevious;
|
||||
bool forwardDriveMode;
|
||||
|
||||
2
config.h
2
config.h
@@ -53,7 +53,7 @@
|
||||
#define SIM800L_RX 16
|
||||
#define SIM800L_TX 17
|
||||
#define SIM800L_RST 5
|
||||
#define SIM800L_TIMER 120
|
||||
#define SIM800L_TIMER 60
|
||||
#endif //SIM800L_ENABLED
|
||||
|
||||
// MENU ITEM
|
||||
|
||||
37
evDash.ino
37
evDash.ino
@@ -467,23 +467,24 @@ bool sendDataViaGPRS() {
|
||||
|
||||
Serial.println("Start HTTP POST...");
|
||||
|
||||
StaticJsonDocument<250> jsonData;
|
||||
StaticJsonDocument<450> jsonData;
|
||||
|
||||
jsonData["akey"] = liveData->settings.remoteApiKey;
|
||||
jsonData["soc"] = liveData->params.socPerc;
|
||||
jsonData["soh"] = liveData->params.sohPerc;
|
||||
jsonData["batK"] = liveData->params.batPowerKw;
|
||||
jsonData["batA"] = liveData->params.batPowerAmp;
|
||||
jsonData["batV"] = liveData->params.batVoltage;
|
||||
jsonData["auxV"] = liveData->params.auxVoltage;
|
||||
jsonData["MinC"] = liveData->params.batMinC;
|
||||
jsonData["MaxC"] = liveData->params.batMaxC;
|
||||
jsonData["InlC"] = liveData->params.batInletC;
|
||||
jsonData["fan"] = liveData->params.batFanStatus;
|
||||
jsonData["cumCh"] = liveData->params.cumulativeEnergyChargedKWh;
|
||||
jsonData["cumD"] = liveData->params.cumulativeEnergyDischargedKWh;
|
||||
jsonData["apikey"] = liveData->settings.remoteApiKey;
|
||||
jsonData["carType"] = liveData->settings.carType;
|
||||
jsonData["socPerc"] = liveData->params.socPerc;
|
||||
jsonData["sohPerc"] = liveData->params.sohPerc;
|
||||
jsonData["batPowerKw"] = liveData->params.batPowerKw;
|
||||
jsonData["batPowerAmp"] = liveData->params.batPowerAmp;
|
||||
jsonData["batVoltage"] = liveData->params.batVoltage;
|
||||
jsonData["auxVoltage"] = liveData->params.auxVoltage;
|
||||
jsonData["batMinC"] = liveData->params.batMinC;
|
||||
jsonData["batMaxC"] = liveData->params.batMaxC;
|
||||
jsonData["batInletC"] = liveData->params.batInletC;
|
||||
jsonData["batFanStatus"] = liveData->params.batFanStatus;
|
||||
jsonData["cumulativeEnergyChargedKWh"] = liveData->params.cumulativeEnergyChargedKWh;
|
||||
jsonData["cumulativeEnergyDischargedKWh"] = liveData->params.cumulativeEnergyDischargedKWh;
|
||||
|
||||
char payload[200];
|
||||
char payload[450];
|
||||
serializeJson(jsonData, payload);
|
||||
|
||||
Serial.print("Sending payload: ");
|
||||
@@ -492,12 +493,12 @@ bool sendDataViaGPRS() {
|
||||
Serial.print("Remote API server: ");
|
||||
Serial.println(liveData->settings.remoteApiUrl);
|
||||
|
||||
uint16_t rc = sim800l->doPost(liveData->settings.remoteApiSrvr, "application/json", payload, 10000, 10000);
|
||||
uint16_t rc = sim800l->doPost(liveData->settings.remoteApiUrl, "application/json", payload, 10000, 10000);
|
||||
if(rc == 200) {
|
||||
Serial.println(F("HTTP POST successful"));
|
||||
Serial.println("HTTP POST successful");
|
||||
} else {
|
||||
// Failed...
|
||||
Serial.print(F("HTTP POST error: "));
|
||||
Serial.print("HTTP POST error: ");
|
||||
Serial.println(rc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user