Note: The sensors described here are compatible with a raspberry pi home automation server described in this instructable: https://www.instructables.com/id/Raspberry-Pi-Home-Automation-Server/
An ESP8266 is a cheap wifi module that I use for home automation.
The programming steps are:
- Obtain the programmer from tindie:
2. Install python 2.7 and the windows driver for the device
3. Modify the first 2 lines of sensor.lua to specify the SSID and password of your local network:
local SSID = "YourSSID"
local password = "yourPassword"
4. Obtain an esp8266 and sensor from tindie:
5. Insert the Esp8266 in the programmer and insert the programmer into your pc. Use the control panel (ports) to determine the com port that has been assigned.
6.Run LuaLoader, and press the connect button, then upload file: sensor.lua
8. Remove the esp8266 from the programmer and place it in the sensor. It will now log onto your network and start monitoring.
Step 1: Windows Driver and Lualoader
- Download and install the ch340g windows driver from here: http://www.arduined.eu/ch340-windows-8-driver-download/ for the programmer.
Use Lua Loader to program the esp8266, it can be downloaded for free from: http://benlo.com/esp8266/
Step 2: Go to Control Panel, Device Manager to Determine the Com Port Assigned by Your Pc
Press the restart button on the Lua Loader. You should see "node.restart()" appear, then the unit should respond with ">"
Next upload the file "sensor.lua".
Attached is a generic sensor.lua file. You will need a specific sensor.lua that matches your sensor.
Press the restart button again, the unit should print some text every few seconds.
Step 3: Obtain an Esp8266 and Sensor From Tindie.com
When you order a sensor from tindie like this one:
you will receive an esp8266 that has already been flashed as is ready to be programmed.
You will also receive a sensor.lua file which will be used to program the esp8266 to perform a specific task (such as monitoring for the presence of water).
Edit the first 2 lines of the sensor.lua file:
local SSID = "YourSSID"
local password = "YourPassword"
Change the SSID to be the name of your local home network.
Change the password to be the security password for your network.
Step 4: Program the Sensor Using Lua Loader
- Using Lua Loader: press the restart button (">" should appear) load the sensor.lua file, then press restart. The unit should send text every few seconds.
Remove the esp8266 from the programmer and place it in the sensor.
When the sensor is connected to a power supply, it will log onto your network and start monitoring.
Step 5: If You Ever Need to Reload Sensor.lua....
First, you will need to remove the old sensor.lua.
Follow the steps in the above diagram to remove sensor.lua using lualoader
We have a be nice policy.
Please be positive and constructive.