jxmot
jxmot / esp8266-dht-udp Goto Github PK
View Code? Open in Web Editor NEWSensorNet 1 of 3 - A temperature and humidity sensor using a DHT22/11 device and UDP to transmit the data to a server.
License: MIT License
SensorNet 1 of 3 - A temperature and humidity sensor using a DHT22/11 device and UDP to transmit the data to a server.
License: MIT License
jxmot
It was noticed on the client that some sensors would not show the current temperature even though the difference between current data and what was seen is greater than the respective minimum deltas.
This is caused by:
The fix:
For #8 change all ".dat" to ".json".
I've read where the DHT22 provides a true reading if it is read at least twice in succession. The way it was explained (not word-for-word) is that when the DHT is read it will report the data from the last time it was activated by a command. And that a subsequent read of the data would provide fresh values.
In my implementation where the DHT is accessed in approximately 5 minute intervals. My usage does not require readings with only seconds in between. So the value may not be current.
The likely "fix" would be to read the DHT every 5 to 10 seconds and only report the current value when the longer (~5min) interval expires.
Occasionally a sensor will send heartbeat data messages as fast as possible. This tends to over-run the server and floods the database with sensor records.
Some devices may not report changes in temperature or humidity for extended periods of time. This results in not knowing if a device is still active. If it has failed in a way that prohibits it from sending an error status the failure will go unseen. This change is intended to provide the ability to know if a device is still alive or not.
The devices should have a heartbeat that is sent via a status broadcast when there has been no data updates for a period of time. The heartbeat is sent when the -
For example, if a device is set to report "CHG" every 5 minutes then if 15 or more minutes has elapsed since the last report then send a heartbeat.
Allow the server to send a "reset" command to the device. It will cause a reboot/restart of the device.
Reset command handling should have priority over other running tasks.
This repo is to be renamed as one of the following:
Occasionally a sensor will (re)send data packets as fast as it can. When it occurs the server can be over run.
The cause appears to be in esp8266-dht-udp.ino:heartBeat()
. Specifically here:
if((lastbeat + heartrate) < millis())
{
lastbeat = millis();
.
.
.
That code should be changed to:
if((millis() - lastbeat) > heartrate)
{
lastbeat = millis();
This will allow devices to be added to the sensornet network without requiring to have the server's IP address configured.
The device will use the status broadcast to announce that it is ready to obtain the server's IP address. The server (node-dht-udp) receives the broadcast and replies directly to the device with its IP address contained in a JSON string.
This is the first step in migrating most of the device configuration data to the server reply.
Had to comment out some lines of Serial.println()
. Was getting an error:
'Serial' was not declared in this scope
Serial.println()
calls, no issues found.Will change the circuit design to use a PCA9306
board between the DHT22 and the DHT sensor. The purpose is to reduce the quantity of NaN reads to zero.
Update the README with a schematic.
The mimic feature is used for allowing for the replacement of a failed device with a new one, and having the new device "mimic" the hostname
and device ID of the one it replaced.
During long term testing of the fix for issue #5 it was noticed that upon rare occasion that the heart beat would "runaway" and continuously send messages. The exact cause has not been determined, but some info gathering and debugging code will be added so that it can be noticed sooner and tracked. A "band-aid" fix might also be used.
This has occurred on more than one running sensor individually, and a sensor can run 45+ days before it happens.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.