tongwandou-david / ESP8266_MQTT_OneNet

Esp8266 Connect Onenet via mqtt, subscribe & publish

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Esp8266 Connect Onenet via mqtt, subscribe & publish

License:MIT License


Languages

Language:Python 100.0%