gerardwr wrote:Some suggestions for expanding:
- Store the CSTARTLOG in flash, so that it starts automatically after a reboot.
- report the #seconds with fractions or report #milliseconds too. I have a LED on my DumpPowemeter that flashes for a number of milliseconds related to current power consumption, and rounding to #seconds gives a major error.
@Borstenhorst
I really like your work on the Smartmeter example.
It’s an excellent basis for a more general „sensor” module using the ESP8266.
Just dreaming aloud here, without considering the technical feasibility.
Expand the CSTARTLOG with:
1. A parameter (#period) that periodically reports the measurement. If #period=0 then it is reported „as-is”, if #period=60, the most recent #(milli)seconds that GPIO2 was LOW is reported to the server every 60 seconds.
2. the possibility to select GPIO0 (or other GPIO# for modules like ESP-03) for logging purposes too.
3. the possibility to switch between several GPIO2 logging modes, f.i:
= Mode 1 to send URL to server when GPIO2 changes level, and report the level.
= Mode 2 to send URL to server containing analog value on GPIO2. (I have no idea if GPIO2 could be assigned as analog pin).
= Mode 3 to ........
The CSTARTLOG could then look something like this:
AT+CSTARTLOG="<protocol>","<URL>”,”<#mode>,<#period>,<#gpio>,<#port>