Software for the ESP8266 that sends P1 smart meter data to a MQTT broker.
- Reads P1 telegram from smart meter
- Publish data to MQTT broker
- Uses WifiManager to create an AP if WiFi connection cannot be established
- Clone this repository
- Download the Arduino IDE
- Install Arduino core for ESP8266 WiFi chip
- Install the WifiManager library
- Install the PubSub MQTT client library
- Edit pubsubclient.h to set the MQTT MAX MESSAGE SIZE to 512
- Adjust WiFi, MQTT and debug settings in
P1_settings.h
- Compile and flash the ESP8266 module as usual
The ESP8266 can be connected to the smart meter using a RJ11 connector. The ESP module can be powered from the smart meter. A couple of hardware components are added to the ESP8266 module to invert the serial signal from the smart meter. If you do not want to use additional hardware you can try to use the SoftwareSerial
library to invert the signal in software.
I followed this schema to modify my ESP8266:
Use this schema to connect the RJ11 connector: