change url to iot.vvzero.com
This commit is contained in:
parent
d4939e383e
commit
340a6c9f89
10
src/main.cpp
10
src/main.cpp
|
@ -14,7 +14,7 @@ Ticker displayTicker;
|
||||||
const uint8_t g_displayFlushGpio[3] = {13, 12, 14};
|
const uint8_t g_displayFlushGpio[3] = {13, 12, 14};
|
||||||
uint16_t g_displayData[3] = {0x01ff, 0x007f, 0x7fff};
|
uint16_t g_displayData[3] = {0x01ff, 0x007f, 0x7fff};
|
||||||
|
|
||||||
StaticJsonDocument<256> receivedData;
|
StaticJsonDocument<512> receivedData;
|
||||||
|
|
||||||
void displayFlush()
|
void displayFlush()
|
||||||
{
|
{
|
||||||
|
@ -93,7 +93,7 @@ void loop()
|
||||||
WiFiClient client;
|
WiFiClient client;
|
||||||
HTTPClient http;
|
HTTPClient http;
|
||||||
|
|
||||||
if (http.begin(client, "http://192.168.2.3:7766/getdata")) {
|
if (http.begin(client, "http://iot.vvzero.com/topuino/getdata?UUID=1e788f28-7a5e-4888-96ff-71ab8b1876f8")) {
|
||||||
int httpCode = http.GET();
|
int httpCode = http.GET();
|
||||||
if (httpCode == HTTP_CODE_OK) {
|
if (httpCode == HTTP_CODE_OK) {
|
||||||
DeserializationError jsonError = deserializeJson(receivedData, http.getString().c_str());
|
DeserializationError jsonError = deserializeJson(receivedData, http.getString().c_str());
|
||||||
|
@ -102,9 +102,9 @@ void loop()
|
||||||
Serial.print(F("deserializeJson() failed: "));
|
Serial.print(F("deserializeJson() failed: "));
|
||||||
Serial.println(jsonError.f_str());
|
Serial.println(jsonError.f_str());
|
||||||
} else {
|
} else {
|
||||||
g_displayData[0] = PercentToBitmap(receivedData["CPU"]);
|
g_displayData[0] = PercentToBitmap(receivedData["CPU_PERCENT"]);
|
||||||
g_displayData[1] = PercentToBitmap(receivedData["MEM"]);
|
g_displayData[1] = PercentToBitmap(receivedData["MEM_PERCENT"]);
|
||||||
g_displayData[2] = PercentToBitmap(receivedData["DISK"]);
|
g_displayData[2] = PercentToBitmap(receivedData["DISK_PERCENT"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
http.end();
|
http.end();
|
||||||
|
|
Loading…
Reference in New Issue