-
1Step 1
Flash your ESP8266 with Micropython. Follow instructions from here:
http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/intro.html -
2Step 2
Edit the main.py file to connect to your own Wifi
-
3Step 3
In the main.py define the GPIO pins you connect the devices to.
As it is when you download it:
- DHT22 connected to GPIO16
- SSD1306 connected using I2C: SDA to GPIO4, SCL to GPIO5
- Output to the led of the ESP8266 (GPIO2) -
4Step 4
In the server side: install a MQTT Broker (I've used Mosquitto on Linux)
-
5Step 5
In the main.py file, edit the address of the MQTT broker (server) you will be sending the info of Temperature and Humidity to.
-
6Step 6
Transfer the files from the project to the ESP8266. My advise is to use the Webrepl file transfer option.
Follow instructions from here: http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/repl.html -
7Step 7
Edit your boot.py in the ESP8266 so it won't autostart the webrepl service and thus you have more memory available.
-
8Step 8
In the server side: install and configure OpenHab Runtime with MQTT binding.
Follow instructions from: https://github.com/openhab/openhab/wiki/MQTT-Binding
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.