hello,
ik krijg dit in mijn seriële monitor. niet echt mooi .
graag had ik ieder info in een apparte regel geplaatst, hoe pak ik dit aan????
16:25:12.587 -> {"smr_version":50,"meter_model":"Fluvius 253770234_A","wifi_ssid":"telenet-A9B56","wifi_strength":100,"total_power_import_t1_kwh":271.658,"total_power_import_t2_kwh":401.108,"total_power_export_t1_kwh":1232.225,"total_power_export_t2_kwh":453.123,"active_power_w":115,"active_power_l1_w":null,"active_power_l2_w":null,"active_power_l3_w":null,"total_gas_m3":618.971,"gas_timestamp":210216162500}
in mijn browser ziet het er zo uit en dit wil ik natuurlijk ook zien op de seriële monitor
smr_version | 50 |
meter_model | "Fluvius 253770234_A" |
wifi_ssid | "telenet-A9B56" |
wifi_strength | 100 |
total_power_import_t1_kwh | 271.629 |
total_power_import_t2_kwh | 401.108 |
total_power_export_t1_kwh | 1232.225 |
total_power_export_t2_kwh | 453.123 |
active_power_w | 208 |
active_power_l1_w | null |
active_power_l2_w | null |
active_power_l3_w | null |
total_gas_m3 | 618.943 |
gas_timestamp | 210216161004 |
mijn code is::::
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>
/* Set these to your desired credentials. /
const char ssid = "tel56"; //ENTER YOUR WIFI SETTINGS
const char *password = "aKQ****y";
//Web/Server address to read/write from
const char host = "http://1******7/api/v1/data"; //https://circuits4you.com website or IP address of server
//=======================================================================
// Power on setup
//=======================================================================
void setup() {
delay(1000);
Serial.begin(115200);
WiFi.mode(WIFI_OFF); //Prevents reconnection issue (taking too long to connect)
delay(1000);
WiFi.mode(WIFI_STA); //This line hides the viewing of ESP as wifi hotspot
WiFi.begin(ssid, password); //Connect to your WiFi router
Serial.println("");
Serial.print("Connecting");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
//If connection successful show IP address in serial monitor
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP()); //IP address assigned to your ESP
}
//=======================================================================
// Main Program Loop
//=======================================================================
void loop() {
HTTPClient http; //Declare object of class HTTPClient
String ADCData, station, getData, Link;
int adcvalue=analogRead(A0); //Read Analog value of LDR
ADCData = String(adcvalue); //String to interger conversion
station = "B";
//GET Data
getData = "?status=" + ADCData + "&station=" + station ; //Note "?" added at front
Link = "http://1********7/api/v1/data" + getData;
http.begin(Link); //Specify request destination
int httpCode = http.GET(); //Send the request
String payload = http.getString(); //Get the response payload
Serial.println(httpCode); //Print HTTP return code
Serial.println(payload); //Print request response payload
http.end(); //Close connection
delay(30000); //GET Data at every 30 seconds
}
kan iemand mij aub helpen
dank u