Feature #610

Implement lightsw IoT device

Added by Hammel 4 months ago. Updated 1 day ago.

Status:In ProgressStart date:04 Mar 2018
Priority:ImmediateDue date:
Assignee:Hammel% Done:

30%

Category:-
Target version:Iron Man - 002 - MVP
Severity:04 - Low

Description

This is code for the ESP8266 to act as a lightsw. It is an extension of the generic ESP8266 code I'd worked on previously, but redesigned to adhere to the defined protocols for Ironman.


Related issues

Related to Monitor - Feature #625: Ad support for returning a device list to imrest New 08 May 2018

Associated revisions

Revision cc40ec26
Added by Hammel 4 months ago

RM #610: Initial import of the lightsw code. It compiles but hasn't been tested.

History

#1 Updated by Hammel 4 months ago

  • % Done changed from 0 to 30

#2 Updated by Hammel 4 months ago

First pass is pushed. It compiles but isn't tested. And there are no stubs yet for actually controlling the light switch. This is just a communications implementation.

#3 Updated by Hammel 4 months ago

  • Project changed from Iron Man to Sensors
  • Category deleted (Device Node)

#4 Updated by Hammel 3 months ago

  • Severity changed from 01 - Critical to 04 - Low

#5 Updated by Hammel 3 days ago

First, getting back to working with the ESP-01 took a while. My layout on the breadboard was klunky so I reworked it and things stopped working. It took quite a bit of time before I found the problem.

If you power the ESP-01 from it's own 3.3v source, then the FTDI board used to program it must have the same ground. If not then any attempt to program gets stuck while the PC tries to connect to the ESP-01 bootloader. I'll post some pics for this setup later.

After fixing that I can upload and run the old esp8266 sample code I had. It will boot into the WifiManager hot spot for configuring the board using 192.168.4.1 and the AP "imiot". However, the lightsw code, which was based on that, doesn't work.

Now I need to run meld to compare the two modules and see why the new code isn't booting into the wifi manager.

Also: If I use the Arduino IDE, I have it pointing at 1.6.7. I should update this to the 1.8.4 version, using "latest" as a symlink and pointing ~/bin/arduino to that. See also: https://github.com/esp8266/Arduino.

#6 Updated by Hammel 1 day ago

There is a prime example, nearly identical to what I'm trying to do, on this website:
https://www.forward.com.au/pfod/ESP8266/GPIOpins/ESP8266_01_pin_magic.html

The section on Driving a Relay and Reading a Push Button using GPIO0 / GPIO2 is what I need to implement.

FYI: my current code for imlightsw wasn't working because of my incorrect use of GPIOs. The example code above should fix this (along with some hardware mods to the breadboard).

There's also this article, which is probably a little closer: http://acoptex.com/project/304/basics-project-021e-esp8266-esp-01-wi-fi-module-5v-relay-modules-webserver-at-acoptexcom/

Also available in: Atom PDF