Bi-monthly release with minor bug fixes and improvements
Please Log in or Create an account to join the conversation.
Sketch uses 23780 bytes (73%) of program storage space. Maximum is 32256 bytes.
Global variables use 961 bytes (46%) of dynamic memory, leaving 1087 bytes for local variables. Maximum is 2048 byte
{"Davis Anemometer":{"init":true,"direction":96,"avg speed":0,"min speed":0,"max speed":0,"rotations":0},"BME280":{"init":true,"Temp":12.25,"Pres":1024.765,"Hum":52.88281},"MLX90614":{"init":true,"T amb":12.45001,"T obj":12.91},"TSL2591":{"init":true,"Lux":2.062501,"Visible":799,"IR":211,"Gain":32,"Timing":1}
Weather Radio V 1.10
{"Davis Anemometer":{"init":true,"direction":96,"avg speed":0,"min speed":0,"max speed":0,"rotations":0},"BME280":{"init":true,"Temp":12.25,"Pres":1024.765,"Hum":52.88281},"MLX90614":{"init":true,"T amb":12.45001,"T obj":12.91},"TSL2591":{"init":true,"Lux":2.062501,"Visible":799,"IR":211,"Gain":32,"Timing":1}}
{
"Davis Anemometer": {
"init": true,
"direction": 96,
"avg speed": 0,
"min speed": 0,
"max speed": 0,
"rotations": 0
},
"BME280": {
"init": true,
"Temp": 12.25,
"Pres": 1024.765,
"Hum": 52.88281
},
"MLX90614": {
"init": true,
"T amb":
"Visible": 799,
"IR"iming": 1
}
}
Please Log in or Create an account to join the conversation.
Weather Radio V 1.10
152 <=== Serial.println(docSize)
{
"Davis Anemometer": {
"init": true,
"direction": 87,
"avg speed": 0,
"min speed": 0,
"max speed": 0,
"rotations": 0
},
"BME280": {
"init": true,
"Temp": 14.42,
"Pres": 1024.433,
"Hum": 50.88184
},
"MLX90614": {
"init": true,
"T amb": 14.82999,
"T obj": 14.19
},
"TSL2591":<Rni
}
}
Please Log in or Create an account to join the conversation.
String getCurrentConfig() {
const int docSize = JSON_OBJECT_SIZE(7) + // max 7 configurations
JSON_OBJECT_SIZE(2) + // DHT sensors
JSON_OBJECT_SIZE(3) + // Davis Anemometer
JSON_OBJECT_SIZE(1) + // Water sensor
JSON_OBJECT_SIZE(2) + // Rain Sensor
JSON_OBJECT_SIZE(3) + // WiFi parameters
JSON_OBJECT_SIZE(1) + // Arduino
JSON_OBJECT_SIZE(3) + // OTA
JSON_OBJECT_SIZE(2); // buffer
StaticJsonDocument <docSize> doc;
...
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
#include <ArduinoJson.h>
#define DESTBUFSIZE 320
char destBuf[DESTBUFSIZE];
#ifdef __arm__
// should use uinstd.h to define sbrk but Due causes a conflict
extern "C" char* sbrk(int incr);
#else // __ARM__
extern char *__brkval;
#endif // __arm__
int freeMemory() {
char top;
#ifdef __arm__
return &top - reinterpret_cast<char*>(sbrk(0));
#elif defined(CORE_TEENSY) || (ARDUINO > 103 && ARDUINO != 151)
return &top - __brkval;
#else // __arm__
return __brkval ? &top - __brkval : &top - __malloc_heap_start;
#endif // __arm__
}
void getSensorData(bool pretty) {
and
int ret;
destBuf[0] = 0;// Null terminator
if (pretty)
ret = serializeJsonPretty(weatherDoc, destBuf, DESTBUFSIZE);
else
ret = serializeJson(weatherDoc, destBuf, DESTBUFSIZE);
Serial.print("ret :"); Serial.println(ret);
Serial.print("Free Memory: "); Serial.println(freeMemory());
Serial.print("DestBuf :"); Serial.println(destBuf);
case 'w':
//Serial.println(getSensorData(false));
getSensorData(false);
Serial.println(destBuf);
break;
case 'c':
Serial.println(getCurrentConfig());
break;
case 'p':
//Serial.println(getSensorData(true));
getSensorData(true);
Serial.println(destBuf);
break;
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
{
"Davis Anemometer": {
"init": true,
"direction": 3,
"avg speed": 0,
"min speed": 0,
"max speed": 0,
"rotations": 0
},
"Rain Sensor": {
"init": true,
"rainfall": 0,
"count": 0
},
"BME280": {
"init": true,
"Temp": 21.08,
"Pres": 974.0237,
"Hum": 26.83203
},
"DHT": {
"init": true,
"Temp": 19.9,
"Hum": 36
},
"MLX90614": {
"init": true,
"T amb": 21.01,
"T obj": 20.55001
},
"TSL2591": {
"init": true,
"Lux": 1.487565,
"Visible": 505,
"IR": 108,
"Gain": 32,
"Timing": 1
}
}
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.