Skip to content

Latest commit

 

History

History

lightbulb-lan-esp8266

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Sample Edge Driver for ESP8266 Light bulb

Model: NodeMCU ESP8266

Protocol: LAN

Prerequisites

A SmartThings Hub with firmware version 38.x or greater and a LAN device ready to connect.

For this tutorial, we used an ESP8266 but the same principles can be used to integrate any LAN-based device that supports SSDP and HTTP.

  1. Set up the SmartThings CLI according to the configuration document.
  2. Add the Edge Driver plugin to the CLI.
  3. Configure your development environment for the SmartThingsEdgeDrivers

Uploading Your Driver to SmartThings

Note: Take a look at the installation tutorial in our Developer's Community.

  1. Compile the driver:
smartthings edge:drivers:package driver/
  1. Create a channel for your driver
smartthings edge:channels:create
  1. Enroll your driver into the channel
smartthings edge:channels:enroll
  1. Publish your driver to the channel
smartthings edge:drivers:publish
  1. If the package was successfully created, you can call the command below and follow the on-screen prompts to install the Driver in your Hub:
smartthings edge:drivers:install

You should see the confirmation message: Driver {driver-id} installed to Hub {hub-id}

  1. Use your WiFi router or the SmartThings IDE > My Hubs to locate and copy the IP Address for your Hub.

  2. From a computer on the same local network as your Hub, open a new terminal window and run the command to get the logs from all the installed drivers.

smartthings edge:drivers:logcat --hub-address=x.x.x.x -a

Onboarding your New Device

  1. Setup the ESP8266 board and embedded app according to these instructions.

  2. Open the SmartThings App and follow these steps (notice that you must add the device in the same location your Hub is installed):

    • Select Add (+) and then Device.
    • Tap on Scan nearby and check the logs emitted at your logcat session.

As soon as your device gets installed, the Driver will send a periodic Ping HTTP Requests with IP and Port reference of the server that will listen for external device updates at X.X.X.X:XXXXX/push-state.