Skip to content

Commit

Permalink
Small doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
barbudor committed Apr 12, 2020
1 parent 29fdfa3 commit 76504e4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# secrets file
secrets.py
.private

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ Using `umqttsimple.py` from [MicroPython-Lib](https://github.com/micropython/mic
package (author: Paul Sokolovsky, license: MIT License).<br>
A big thanks to MicroPython authors and contributors.

![photo should display here](https://raw.githubusercontent.com/barbudor/upy-door-sensor/master/hardware/photo1.jpg "photo")


# Principle of operation
The ESP8266 is maintained in permanent Deep Sleep state (do not connect GPIO16 to RESET).
A pulse is generated on RESET whenever the door opens and the switch closes, resulting in
waking up the ESP. Once awaken, the ESP8266 connects to the Wifi, the MQTT server and then
publish on a given topic before entering in Deep Sleep.

See schematics in [`hardware/`](https://github.com/barbudor/upy-door-sensor/tree/master/harware)
See hardware details in [`hardware/`](https://github.com/barbudor/upy-door-sensor/tree/master/harware)
folder. Schematics avaible for both:
- [Circuit-Diagram.org](https://www.circuit-diagram.org/editor/)
- [Fritzing](http://fritzing.org/)
Expand Down
Binary file added hardware/photo1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 1 addition & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,5 @@
client.disconnect()
print("mqtt: disconnected")

### can we go deepsleep ?
#test_in = machine.Pin(3, machine.Pin.IN, machine.Pin.PULL_UP)
#test_out = machine.Pin(1, machine.Pin.OUT)
#test_out.value(0)
#disable_deepsleep = (test_in.value() == 0)
#if disable_deepsleep:
# raise KeyboardInterrupt

time.sleep(0.1)
time.sleep(0.1) # without this, deepsleep doesn't work well
esp.deepsleep(0)

0 comments on commit 76504e4

Please sign in to comment.