Код: Выделить всё
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>
extern "C"
{
#include "user_interface.h"
}
bool en;
int refresh;
String syty;
String id;
const char* name;
float tempC;
float tempCmin;
float tempCmax;
float pressure;
int humidity;
float windspeed;
int winddeg;
const char* icon;
int Cloud;
const char* host= "api.openweathermap.org";
String line;
bool ESPControllerWifiClient_HRD = 0;
bool ESPControllerWifiClient_status = 1;
bool ESPControllerWifiClient_isDHCP = 1;
bool ESPControllerWifiClient_IsNeedReconect = 0;
bool ESPControllerWifiClient_workStatus = 1;
char ESPControllerWifiClient_SSID[40] = "ВИФИ";
char ESPControllerWifiClient_password[40] = "пароль";
IPAddress ESPControllerWifiClient_ip(0, 0, 0, 0);
IPAddress ESPControllerWifiClient_dns (0, 0, 0, 1);
IPAddress ESPControllerWifiClient_gateway (0, 0, 0, 1);
IPAddress ESPControllerWifiClient_subnet (255, 255, 255, 0);
uint8_t ESPControllerWifiClient_mac[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
String _stou1;
void setup()
{
WiFi.mode(WIFI_STA);
_esp8266WifiModuleClientReconnect();
Serial.begin(9600, SERIAL_8N1);
jsonGet();
}
void loop()
{
if(ESPControllerWifiClient_IsNeedReconect)
{
_esp8266WifiModuleClientReconnect();
ESPControllerWifiClient_IsNeedReconect = 0;
}
ESPControllerWifiClient_status = WiFi.status() == WL_CONNECTED;
if (ESPControllerWifiClient_status)
{
if (! ESPControllerWifiClient_HRD)
{
ESPControllerWifiClient_ip = WiFi.localIP();
ESPControllerWifiClient_subnet = WiFi.subnetMask();
ESPControllerWifiClient_gateway = WiFi.gatewayIP();
ESPControllerWifiClient_dns = WiFi.dnsIP();
WiFi.macAddress(ESPControllerWifiClient_mac);
ESPControllerWifiClient_HRD = 1;
}
}
else
{
ESPControllerWifiClient_HRD = 0;
}
//Плата:1
en = !(0);
refresh = 5000;
syty = String("524901");
id = String("6a4ba421859c9f4166697758b68d889b");
{
StaticJsonBuffer<2000> jsonBuffer;
JsonObject& root = jsonBuffer.parseObject(line);
if (!root.success())
{
jsonGet();
return;
}
name = root["name"];
tempC = root["main"]["temp"];
tempCmin = root["main"]["temp_min"];
tempCmax = root["main"]["temp_max"];
int pressurehPa = root["main"]["pressure"];
pressure = pressurehPa/1.333;
humidity = root["main"]["humidity"];
windspeed = root["wind"]["speed"];
winddeg = root["wind"]["deg"];
icon = root["weather"][0]["icon"];
Cloud = root["clouds"]["all"];
delay(refresh);
}
if (!(0))
{
if(!(((((_floatToStringWitRaz(tempC,2))) + (String(" * ")) + ((_floatToStringWitRaz(tempCmin,2))) + (String(" * ")) + ((_floatToStringWitRaz(tempCmax,2))) + (String(" * ")) + ((_floatToStringWitRaz(pressure,2))) + (String(" * ")) + ((String(humidity, DEC))) + (String(" * ")) + ((_floatToStringWitRaz(windspeed,2))) + (String(" * ")) + ((String(winddeg, DEC))) + (String(" * ")) + ((String(Cloud, DEC))) + (String(" * ")) + (name) + (String(" * ")) + (icon)))==(_stou1)))
{
Serial.println((((_floatToStringWitRaz(tempC,2))) + (String(" * ")) + ((_floatToStringWitRaz(tempCmin,2))) + (String(" * ")) + ((_floatToStringWitRaz(tempCmax,2))) + (String(" * ")) + ((_floatToStringWitRaz(pressure,2))) + (String(" * ")) + ((String(humidity, DEC))) + (String(" * ")) + ((_floatToStringWitRaz(windspeed,2))) + (String(" * ")) + ((String(winddeg, DEC))) + (String(" * ")) + ((String(Cloud, DEC))) + (String(" * ")) + (name) + (String(" * ")) + (icon)));
}
}
_stou1 = (((_floatToStringWitRaz(tempC,2))) + (String(" * ")) + ((_floatToStringWitRaz(tempCmin,2))) + (String(" * ")) + ((_floatToStringWitRaz(tempCmax,2))) + (String(" * ")) + ((_floatToStringWitRaz(pressure,2))) + (String(" * ")) + ((String(humidity, DEC))) + (String(" * ")) + ((_floatToStringWitRaz(windspeed,2))) + (String(" * ")) + ((String(winddeg, DEC))) + (String(" * ")) + ((String(Cloud, DEC))) + (String(" * ")) + (name) + (String(" * ")) + (icon));
}
String _floatToStringWitRaz(float value, int raz)
{
return String(value,raz);
}
bool _isTimer(unsigned long startTime, unsigned long period)
{
unsigned long currentTime;
currentTime = millis();
if (currentTime>= startTime)
{
return (currentTime>=(startTime + period));
}
else
{
return (currentTime >=(4294967295-startTime+period));
}
}
void jsonGet()
{
WiFiClient client;
const int httpPort = 80;
if (!client.connect(host, httpPort))
{
return;
}
client.println("GET /data/2.5/weather?id="+syty+"&units=metric&appid="+id+" HTTP/1.1");
client.println("Host: api.openweathermap.org");
client.println("Connection: close");
client.println();
delay(500);
while(client.available())
{
line = client.readStringUntil('\r');
}
}
int hexStrToInt(String instring)
{
byte len = instring.length();
if (len == 0) return 0;
int result = 0;
for (byte i = 0; i < 8; i++) // только первые 8 цыфар влезуть в uint32
{
char ch = instring[i];
if (ch == 0) break;
result <<= 4;
if (isdigit(ch))
result = result | (ch - '0');
else result = result | (ch - 'A' + 10);
}
return result;
}
void _esp8266WifiModuleClientReconnect()
{
if(_checkMacAddres(ESPControllerWifiClient_mac))
{
wifi_set_macaddr(0, const_cast<uint8*>(ESPControllerWifiClient_mac));
}
if(ESPControllerWifiClient_isDHCP)
{
WiFi.config(0U, 0U, 0U, 0U, 0U);
}
else
{
WiFi.config(ESPControllerWifiClient_ip, ESPControllerWifiClient_gateway, ESPControllerWifiClient_subnet, ESPControllerWifiClient_dns , ESPControllerWifiClient_dns);
}
WiFi.begin(ESPControllerWifiClient_SSID, ESPControllerWifiClient_password);
}
bool _checkMacAddres(byte array[])
{
bool result = 0;
for (byte i = 0; i < 6; i++)
{
if (array[i] == 255)
{
return 0;
}
if (array[i] > 0)
{
result = 1;
}
}
return result;
}
void _parseMacAddressString(String value, byte array[])
{
int index;
byte buffer[6] = {255, 255, 255, 255, 255, 255};
byte raz = 0;
String tempString;
while ((value.length() > 0) && (raz <= 6))
{
index = value.indexOf(":");
if (index == -1)
{
tempString = value;
value = "";
}
else
{
tempString = value.substring(0, index);
value = value.substring(index + 1);
}
buffer[raz] = byte(hexStrToInt(tempString));
raz++;
}
if (_checkMacAddres(buffer))
{
for (byte i = 0; i < 6; i++)
{
array[i] = buffer[i];
}
}
}
bool _compareMacAddreses(byte array1[], byte array2[])
{
for (byte i = 0; i < 6; i++)
{
if (array1[i] != array2[i])
{
return 0;
}
}
return 1;
}
bool _compareMacAddresWithString(byte array[], String value)
{
byte buffer[6] = {255, 255, 255, 255, 255, 255};
_parseMacAddressString(value, buffer);
return _compareMacAddreses(array, buffer);
}
bool _checkMacAddresString(String value)
{
byte buffer[6] = {255, 255, 255, 255, 255, 255};
_parseMacAddressString(value, buffer);
return _checkMacAddres(buffer);
}
String _macAddresToString(byte array[])
{
String result = "";
String temp ="";
for (byte i = 0; i < 6; i++)
{
temp=String(array[i],HEX);
if (temp.length() < 2)
{
temp = String("0") + temp;
}
result = result + temp;
if (i < 5)
{
result = result + String(":");
}
}
result.toUpperCase();
return result;
}
Код: Выделить всё
cod "200"
message 0
cnt 40
list
0
dt 1615723200
main
temp 1.63
feels_like -4.68
temp_min 1.44
temp_max 1.63
pressure 1009
sea_level 1009
grnd_level 994
humidity 90
temp_kf 0.19
weather
0
id 500
main "Rain"
description "небольшой дождь"
icon "10d"
clouds
all 95
wind
speed 6.22
deg 199
visibility 36
pop 0.96
rain
3h 0.87
sys
pod "d"
dt_txt "2021-03-14 12:00:00"
1
dt 1615734000
main
temp 1.94
feels_like -4.49
temp_min 1.94
temp_max 1.98
pressure 1010
sea_level 1010
grnd_level 993
humidity 95
temp_kf -0.04
weather
0
id 500
main "Rain"
description "небольшой дождь"
icon "10d"
clouds
all 98
wind
speed 6.61
deg 205
visibility 560
pop 0.94
rain
3h 0.72
sys
pod "d"
dt_txt "2021-03-14 15:00:00"
2
dt 1615744800
main
temp 1.91
feels_like -4.93
temp_min 1.91
temp_max 1.92
pressure 1010
sea_level 1010
grnd_level 994
humidity 96
temp_kf -0.01
weather
0
id 500
main "Rain"
description "небольшой дождь"
icon "10n"
clouds
all 99
wind
speed 7.23
deg 212
visibility 10000
pop 0.94
rain
3h 0.23
sys
pod "n"
dt_txt "2021-03-14 18:00:00"
3
dt 1615755600
main
temp 1.57
feels_like -5.53
temp_min 1.57
temp_max 1.57
pressure 1011
sea_level 1011
grnd_level 994
humidity 97
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04n"
clouds
all 100
wind
speed 7.55
deg 205
visibility 2944
pop 0.16
sys
pod "n"
dt_txt "2021-03-14 21:00:00"
4
dt 1615766400
main
temp 1.42
feels_like -5.4
temp_min 1.42
temp_max 1.42
pressure 1011
sea_level 1011
grnd_level 994
humidity 94
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04n"
clouds
all 100
wind
speed 7.03
deg 193
visibility 10000
pop 0.02
sys
pod "n"
dt_txt "2021-03-15 00:00:00"
5
dt 1615777200
main
temp 1.23
feels_like -5.72
temp_min 1.23
temp_max 1.23
pressure 1010
sea_level 1010
grnd_level 993
humidity 97
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04n"
clouds
all 100
wind
speed 7.26
deg 192
visibility 87
pop 0.01
sys
pod "n"
dt_txt "2021-03-15 03:00:00"
6
dt 1615788000
main
temp 0.89
feels_like -6.7
temp_min 0.89
temp_max 0.89
pressure 1010
sea_level 1010
grnd_level 993
humidity 97
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 100
wind
speed 8.11
deg 182
visibility 135
pop 0.25
snow
3h 0.19
sys
pod "d"
dt_txt "2021-03-15 06:00:00"
7
dt 1615798800
main
temp 0.83
feels_like -5.94
temp_min 0.83
temp_max 0.83
pressure 1010
sea_level 1010
grnd_level 993
humidity 99
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 100
wind
speed 6.99
deg 195
visibility 79
pop 0.67
snow
3h 0.15
sys
pod "d"
dt_txt "2021-03-15 09:00:00"
8
dt 1615809600
main
temp 1.07
feels_like -5.42
temp_min 1.07
temp_max 1.07
pressure 1010
sea_level 1010
grnd_level 993
humidity 98
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 100
wind
speed 6.6
deg 191
visibility 34
pop 1
snow
3h 0.67
sys
pod "d"
dt_txt "2021-03-15 12:00:00"
9
dt 1615820400
main
temp 1.39
feels_like -3.7
temp_min 1.39
temp_max 1.39
pressure 1011
sea_level 1011
grnd_level 994
humidity 97
temp_kf 0
weather
0
id 500
main "Rain"
description "небольшой дождь"
icon "10d"
clouds
all 100
wind
speed 4.64
deg 204
visibility 55
pop 1
rain
3h 0.48
sys
pod "d"
dt_txt "2021-03-15 15:00:00"
10
dt 1615831200
main
temp 1.51
feels_like -3.13
temp_min 1.51
temp_max 1.51
pressure 1012
sea_level 1012
grnd_level 995
humidity 98
temp_kf 0
weather
0
id 500
main "Rain"
description "небольшой дождь"
icon "10n"
clouds
all 100
wind
speed 4.06
deg 192
visibility 308
pop 0.97
rain
3h 0.37
sys
pod "n"
dt_txt "2021-03-15 18:00:00"
11
dt 1615842000
main
temp 1.56
feels_like -3.21
temp_min 1.56
temp_max 1.56
pressure 1013
sea_level 1013
grnd_level 996
humidity 98
temp_kf 0
weather
0
id 500
main "Rain"
description "небольшой дождь"
icon "10n"
clouds
all 100
wind
speed 4.26
deg 185
visibility 449
pop 0.95
rain
3h 0.84
sys
pod "n"
dt_txt "2021-03-15 21:00:00"
12
dt 1615852800
main
temp 1.21
feels_like -4.14
temp_min 1.21
temp_max 1.21
pressure 1013
sea_level 1013
grnd_level 996
humidity 97
temp_kf 0
weather
0
id 500
main "Rain"
description "небольшой дождь"
icon "10n"
clouds
all 100
wind
speed 4.97
deg 188
visibility 564
pop 0.99
rain
3h 0.65
sys
pod "n"
dt_txt "2021-03-16 00:00:00"
13
dt 1615863600
main
temp 0.34
feels_like -5.16
temp_min 0.34
temp_max 0.34
pressure 1014
sea_level 1014
grnd_level 997
humidity 97
temp_kf 0
weather
0
id 500
main "Rain"
description "небольшой дождь"
icon "10n"
clouds
all 100
wind
speed 5.01
deg 173
visibility 1161
pop 0.99
rain
3h 0.2
sys
pod "n"
dt_txt "2021-03-16 03:00:00"
14
dt 1615874400
main
temp 0.2
feels_like -5.32
temp_min 0.2
temp_max 0.2
pressure 1014
sea_level 1014
grnd_level 998
humidity 96
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 100
wind
speed 4.98
deg 174
visibility 382
pop 0.94
snow
3h 0.3
sys
pod "d"
dt_txt "2021-03-16 06:00:00"
15
dt 1615885200
main
temp 0.66
feels_like -4.46
temp_min 0.66
temp_max 0.66
pressure 1015
sea_level 1015
grnd_level 998
humidity 99
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 100
wind
speed 4.59
deg 172
visibility 10000
pop 0.45
snow
3h 0.29
sys
pod "d"
dt_txt "2021-03-16 09:00:00"
16
dt 1615896000
main
temp 0.9
feels_like -3.29
temp_min 0.9
temp_max 0.9
pressure 1015
sea_level 1015
grnd_level 998
humidity 99
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04d"
clouds
all 100
wind
speed 3.31
deg 157
visibility 3998
pop 0.11
sys
pod "d"
dt_txt "2021-03-16 12:00:00"
17
dt 1615906800
main
temp 0.54
feels_like -4.19
temp_min 0.54
temp_max 0.54
pressure 1015
sea_level 1015
grnd_level 998
humidity 91
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04d"
clouds
all 100
wind
speed 3.77
deg 146
visibility 10000
pop 0
sys
pod "d"
dt_txt "2021-03-16 15:00:00"
18
dt 1615917600
main
temp -0.81
feels_like -5.5
temp_min -0.81
temp_max -0.81
pressure 1016
sea_level 1016
grnd_level 999
humidity 95
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04n"
clouds
all 100
wind
speed 3.56
deg 140
visibility 5887
pop 0
sys
pod "n"
dt_txt "2021-03-16 18:00:00"
19
dt 1615928400
main
temp -1.32
feels_like -6.02
temp_min -1.32
temp_max -1.32
pressure 1015
sea_level 1015
grnd_level 998
humidity 96
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04n"
clouds
all 100
wind
speed 3.51
deg 129
visibility 1785
pop 0
sys
pod "n"
dt_txt "2021-03-16 21:00:00"
20
dt 1615939200
main
temp -2.13
feels_like -7.14
temp_min -2.13
temp_max -2.13
pressure 1014
sea_level 1014
grnd_level 997
humidity 94
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04n"
clouds
all 100
wind
speed 3.76
deg 125
visibility 10000
pop 0
sys
pod "n"
dt_txt "2021-03-17 00:00:00"
21
dt 1615950000
main
temp -4.98
feels_like -10.16
temp_min -4.98
temp_max -4.98
pressure 1013
sea_level 1013
grnd_level 996
humidity 95
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04n"
clouds
all 88
wind
speed 3.58
deg 115
visibility 10000
pop 0
sys
pod "n"
dt_txt "2021-03-17 03:00:00"
22
dt 1615960800
main
temp -3.35
feels_like -8.19
temp_min -3.35
temp_max -3.35
pressure 1013
sea_level 1013
grnd_level 996
humidity 95
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 80
wind
speed 3.34
deg 104
visibility 586
pop 0.2
snow
3h 0.1
sys
pod "d"
dt_txt "2021-03-17 06:00:00"
23
dt 1615971600
main
temp -1
feels_like -5.85
temp_min -1
temp_max -1
pressure 1012
sea_level 1012
grnd_level 995
humidity 95
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 93
wind
speed 3.75
deg 106
visibility 3302
pop 0.2
snow
3h 0.12
sys
pod "d"
dt_txt "2021-03-17 09:00:00"
24
dt 1615982400
main
temp -0.34
feels_like -5.04
temp_min -0.34
temp_max -0.34
pressure 1010
sea_level 1010
grnd_level 993
humidity 88
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04d"
clouds
all 96
wind
speed 3.47
deg 105
visibility 10000
pop 0
sys
pod "d"
dt_txt "2021-03-17 12:00:00"
25
dt 1615993200
main
temp -1.37
feels_like -5.39
temp_min -1.37
temp_max -1.37
pressure 1010
sea_level 1010
grnd_level 993
humidity 96
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 100
wind
speed 2.53
deg 100
visibility 335
pop 0.2
snow
3h 0.16
sys
pod "d"
dt_txt "2021-03-17 15:00:00"
26
dt 1616004000
main
temp -2.9
feels_like -7.11
temp_min -2.9
temp_max -2.9
pressure 1010
sea_level 1010
grnd_level 993
humidity 96
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13n"
clouds
all 98
wind
speed 2.53
deg 107
visibility 10000
pop 0.23
snow
3h 0.19
sys
pod "n"
dt_txt "2021-03-17 18:00:00"
27
dt 1616014800
main
temp -4.45
feels_like -8.26
temp_min -4.45
temp_max -4.45
pressure 1009
sea_level 1009
grnd_level 992
humidity 96
temp_kf 0
weather
0
id 803
main "Clouds"
description "облачно с прояснениями"
icon "04n"
clouds
all 70
wind
speed 1.72
deg 107
visibility 10000
pop 0
sys
pod "n"
dt_txt "2021-03-17 21:00:00"
28
dt 1616025600
main
temp -4.19
feels_like -7.72
temp_min -4.19
temp_max -4.19
pressure 1008
sea_level 1008
grnd_level 991
humidity 97
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13n"
clouds
all 74
wind
speed 1.38
deg 68
visibility 648
pop 0.2
snow
3h 0.1
sys
pod "n"
dt_txt "2021-03-18 00:00:00"
29
dt 1616036400
main
temp -4.62
feels_like -8.31
temp_min -4.62
temp_max -4.62
pressure 1007
sea_level 1007
grnd_level 990
humidity 96
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04n"
clouds
all 94
wind
speed 1.52
deg 65
visibility 2219
pop 0
sys
pod "n"
dt_txt "2021-03-18 03:00:00"
30
dt 1616047200
main
temp -2.97
feels_like -6.23
temp_min -2.97
temp_max -2.97
pressure 1007
sea_level 1007
grnd_level 990
humidity 93
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 95
wind
speed 1.1
deg 81
visibility 4747
pop 0.2
snow
3h 0.12
sys
pod "d"
dt_txt "2021-03-18 06:00:00"
31
dt 1616058000
main
temp -1.3
feels_like -4.12
temp_min -1.3
temp_max -1.3
pressure 1007
sea_level 1007
grnd_level 991
humidity 92
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04d"
clouds
all 99
wind
speed 0.72
deg 18
visibility 8127
pop 0
sys
pod "d"
dt_txt "2021-03-18 09:00:00"
32
dt 1616068800
main
temp -0.7
feels_like -3.5
temp_min -0.7
temp_max -0.7
pressure 1008
sea_level 1008
grnd_level 991
humidity 95
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 100
wind
speed 0.89
deg 355
visibility 866
pop 0.2
snow
3h 0.28
sys
pod "d"
dt_txt "2021-03-18 12:00:00"
33
dt 1616079600
main
temp -1.57
feels_like -4.27
temp_min -1.57
temp_max -1.57
pressure 1008
sea_level 1008
grnd_level 991
humidity 94
temp_kf 0
weather
0
id 804
main "Clouds"
description "пасмурно"
icon "04d"
clouds
all 97
wind
speed 0.55
deg 2
visibility 10000
pop 0.01
sys
pod "d"
dt_txt "2021-03-18 15:00:00"
34
dt 1616090400
main
temp -2.41
feels_like -5.23
temp_min -2.41
temp_max -2.41
pressure 1009
sea_level 1009
grnd_level 992
humidity 97
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13n"
clouds
all 99
wind
speed 0.65
deg 331
visibility 706
pop 0.23
snow
3h 0.1
sys
pod "n"
dt_txt "2021-03-18 18:00:00"
35
dt 1616101200
main
temp -2.74
feels_like -5.7
temp_min -2.74
temp_max -2.74
pressure 1010
sea_level 1010
grnd_level 993
humidity 97
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13n"
clouds
all 100
wind
speed 0.79
deg 335
visibility 356
pop 0.32
snow
3h 0.28
sys
pod "n"
dt_txt "2021-03-18 21:00:00"
36
dt 1616112000
main
temp -3.01
feels_like -6.63
temp_min -3.01
temp_max -3.01
pressure 1009
sea_level 1009
grnd_level 992
humidity 97
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13n"
clouds
all 100
wind
speed 1.7
deg 17
visibility 7539
pop 0.2
snow
3h 0.12
sys
pod "n"
dt_txt "2021-03-19 00:00:00"
37
dt 1616122800
main
temp -3.16
feels_like -7.1
temp_min -3.16
temp_max -3.16
pressure 1009
sea_level 1009
grnd_level 992
humidity 97
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13n"
clouds
all 100
wind
speed 2.12
deg 29
visibility 505
pop 0.27
snow
3h 0.24
sys
pod "n"
dt_txt "2021-03-19 03:00:00"
38
dt 1616133600
main
temp -2.21
feels_like -6.79
temp_min -2.21
temp_max -2.21
pressure 1010
sea_level 1010
grnd_level 993
humidity 95
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 100
wind
speed 3.16
deg 36
visibility 370
pop 0.42
snow
3h 0.29
sys
pod "d"
dt_txt "2021-03-19 06:00:00"
39
dt 1616144400
main
temp -1.12
feels_like -6.15
temp_min -1.12
temp_max -1.12
pressure 1010
sea_level 1010
grnd_level 993
humidity 94
temp_kf 0
weather
0
id 600
main "Snow"
description "небольшой снег"
icon "13d"
clouds
all 100
wind
speed 3.96
deg 33
visibility 827
pop 0.37
snow
3h 0.3
sys
pod "d"
dt_txt "2021-03-19 09:00:00"
city
id 556564
name "Москва"
coord
lat 54.8324
lon 33.1169
country "RU"
population 0
timezone 10800
sunrise 1615693500
sunset 1615735693
взят за основу блок с данного постаUser8 писал(а): ↑15.01.2019{, 13:16}Вот в таком варианте уже можно использовать по человечески. Rtrig встроен в блок, можно внешний не использовать.
Не забудьте на вход Get поставить симметричный мультивибратор, чтобы делать запросы через какое-то время.
Библиотека: https://github.com/bblanchon/ArduinoJson
Код: Выделить всё
int Humidity_134721148_1;
float windSpeed_134721148_1;
int windDeg_134721148_1;
float Cloud_134721148_1;
float snow1Hour_134721148_1;
//String showname_134721148_1;
int idsky_134721148_1;
bool sendTrigOne_134721148_1;
bool sendTrigTwo_134721148_1;
const char* showname_134721148_1;