Giter Site home page Giter Site logo

jxmot / esp8266-dht-udp Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 453 KB

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

C++ 87.47% C 3.73% JavaScript 8.81%
esp-01 esp8266 humidity-sensor ota ota-update temperature-sensor udp

esp8266-dht-udp's Introduction

jxmot

esp8266-dht-udp's People

Stargazers

 avatar

Watchers

 avatar

esp8266-dht-udp's Issues

sensor data appears to be unchanging for long periods of time

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:

  • below delta changes in data values over time
  • the "last" value used in comparison readings came from the last direct sensor reading
  • this would cause no new data to be sent because changes were below the deltas

The fix:

  • save the "last" value when the data is sent, and use it in the comparisons.

Investigate issuing double readings of the DHT sensor

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.

README updates

  • remove firebase references, change to MySQL
  • walk through code and obtain additional info
  • add images of built sensor devices
  • add schematic of sensor device

implement a heartbeat

Purpose

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.

Details

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 -

  • report type is "CHG"
  • "period of time" = 3 times the reporting interval with no data updates
  • heartbeat status will then occur at an interval identical to the data reporting interval

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.

Remote Reset

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.

Rename this repository

This repo is to be renamed as one of the following:

  • sensornet-sense
  • sensornet-device
  • sensornet-??????

Fix sensor run away

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();

obtain server IP address config data from the server

Purpose

This will allow devices to be added to the sensornet network without requiring to have the server's IP address configured.

Details

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.

compile error in ParseIPReply

Had to comment out some lines of Serial.println(). Was getting an error:

'Serial' was not declared in this scope
  • Checked all header files, no issues found.
  • Recompiled other cpp files with Serial.println() calls, no issues found.
  • Restarted the Arduino IDE, no change.

Too many NaN readings from DHT22

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.

Added device mimic feature

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.

Runaway heart beat

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.