Skip to content

Temperature and humidity sensor control for the HUZZAH ESP8266 breakout in micropython using deepsleep

License

Notifications You must be signed in to change notification settings

dedeibel/humtemp

Repository files navigation

humtemp

Temperature and humidity sensor control for the HUZZAH ESP8266 breakout in micropython.

  • Measure temperature and humidity
  • Update time and send data to graphite carbon or influx
  • Deepsleep between measurements

Sensors

Wiring Plan

See ./model.

Notes

  • RHT03 is actually DHT22 (chose the wrong one or was was not available at the time)
  • Resistors for ADC circuit are mounted standing up but this does not seem to be supported in the breadboard view. So it looks weird.

Default pin assignment:

  • DHT22 on 12
  • Temp Sensor on pin 13

See configuration.py for options.

Prerequisites

Mostly for the "build" process. Where the script files are stripped down a little.

source env/bin/activate
pip install -r requirements.txt

Copy mpy_cross into PATH.

Flashing esp

mpy version

Via: utils/mpyversion.py

Example:

mpy version: 6 mpy flags: -march=xtensa

Building and running

Prepare esp with micropython.

After that:

make
  • Fill out the created config file
  • Connect esp using serial connection (and the configured tty)
  • retry

Blink Codes

  • 10 times - could not connect to wifi and the network. Going to sleep for a while an retry.
  • 8 times - could not fetch initial ntp time. Going to sleep for a while an retry.
  • 6 times - OSError occured in main loop. Retrying after a few seconds (with increasing holdoff time).
  • 4 times - Exception occured in main loop. Retrying after a few seconds (with increasing holdoff time).

Blinks a lot more when debug is on - so this makes only sense when compiled without debug.

Utility Tools

terminal-loop.sh

Will open a screen session in a loop. It will be closed before flushing the device and opens up again when using enter.

util/clean_esp.sh

Removes all files from the esp.

util/mpyversion.py

Prints the required mpy version for the installed micropython firmware on the esp.

util/smoke-test.py

Call esp.check_fw(), and blink the LED.

util/freespace.sh

Connects to the esp and lists the free flash space.

References

Improvement Ideas

  • configration.py could be created/filled by the user now that we have multiple modules

About

Temperature and humidity sensor control for the HUZZAH ESP8266 breakout in micropython using deepsleep

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published