/ESP8266_MQTT_OneNet

Esp8266 Connect Onenet via mqtt, subscribe & publish

Primary LanguagePythonMIT LicenseMIT

ESP8266 MQTT OneNet

Esp8266 Connect Onenet via mqtt, subscribe & publish

Usage:

Code Config:

main.py

product_id = 'YourProductID'
#Change to your product id number as a string
regKey = 'YourEvnRegistKey' 
#Change to your environment key

wifi.py

sta_if.connect('SSID', 'PASSOWRD')
#Change to your wifi SSID and PASSWORD

MQTT Command:

Command format by 'pin n state'.

  • pin as string 'pin'
  • n is pin number, enum by 0,1,2,3,4,5,12,13,14,15,16
  • state is 'on','off' or 'toggle'

Board:

image

TODO:

  1. auto reconnect
  2. web config or smartlink