#esp32 #node-red # Python #smarthome
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
mat 1bb80f0828 Updated readme 2 weeks ago
figures Updated readme 2 weeks ago
BME280.py Black formatting, licenses, minor updated code, initial documentation 1 month ago
LICENSE Initial commit 2 months ago
PIR_sensor.py Minor updates 2 weeks ago
README.md Updated readme 2 weeks ago
boot.py Minor updates 2 weeks ago
flows.json Node-Red visualization of sensor data 2 weeks ago
gpios.py Black formatting, licenses, minor updated code, initial documentation 1 month ago
helper_functions.py Black formatting, licenses, minor updated code, initial documentation 1 month ago
main.py Minor updates 2 weeks ago
mqtt_sub_pub.py Minor updates 2 weeks ago
temp_pressure_humidity.py Minor updates 2 weeks ago
temperature.py Black formatting, licenses, minor updated code, initial documentation 1 month ago

README.md

pySmartHome

This is the home of pySmartHome - a MicroPython and ESP32 based private Smart Home under your control.

The following sensors are currently integrated: BME280 temperature, humidity, pressure sensor; PIR motion sensor; relay.

Figure of ESP32: ESP32

Figure of Node-Red Flow: Node-Red Flow

Figure of resulting Node-Red UI: Figure of Node-Red Flow: Node-Red Flow

Set up of ESP32, Linux, IDE

// Install ESP32 Python pip packages

// had to install as sudo, as otherwise the ESP32 could not be connected

pip install esptool

// Check the tool with the following command

esptool.py

// Download latest MiroPython version for ESP32

https://micropython.org/download/#esp32

// Check if ESP32 is connected via serial port

dmesg | grep tty

If you are putting MicroPython on your board for the first time then you should first erase the entire flash using:

esptool.py --chip esp32 --port /dev/ttyUSB0 erase_flash

// From then on program the firmware starting at address 0x1000:

esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 460800 write_flash -z 0x1000 esp32spiram-idf3-20200902-v1.13.bin

// If your are having trouble with permissions, fix access rights in Fedora as follow:

Error appeared: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Keine Berechtigung: '/dev/ttyUSB0'

sudo usermod -a -G dialout $User

getent group dialout

Output ist similar to dialout:x:18:username

Add the output to /etc/group

// find MicroPython packages on PyPi Link: https://pypi.org/search/?c=Programming+Language+%3A%3A+Python+%3A%3A+Implementation+%3A%3A+MicroPython&o=&q=&page=3

// Install additional packages from PyPi // https://pypi.org/project/micropython-umqtt.simple2/

import upip
upip.install("micropython-umqtt.simple2")
upip.install("micropython-umqtt.robust2")

// PyCharm with MicroPython Plugin

https://medium.com/@andymule/micropython-in-pycharms-basic-setup-9169b497ec8a