-->
Page 1 of 9

Native Smartmeter/datalogger

PostPosted: Thu Oct 30, 2014 10:43 am
by Borstenhorst
Based on the AT example I build up a datalogger which is using a webserver for visualization.

More Infos:
http://hackaday.io/project/3249-simple- ... smartmeter

Demo:
http://www.barth-dev.de/proj/SmartMeter/

Sources:
https://github.com/ThomasBarth/ESP8266-SSM

Its not complete yet and if you have any suggestions please let me know and/or contribute :)

Re: Native Smartmeter/datalogger

PostPosted: Tue Nov 11, 2014 1:32 am
by alonewolfx2
Its starting with at command over serial. I need to start on the user main.c and i dont want to any other mcu or serial adapter. I need connect website and send data and deepsleep mode for 1 minute. I figure deepsleep and wake up. But i cant send data in usermain.c without any other serial adapter or mcu's

Re: Native Smartmeter/datalogger

PostPosted: Tue Nov 11, 2014 4:42 am
by gerardwr
I have uploaded this firmware to my ESP8266 and had no trouble getting it to work.

@ Borstenhorst : Thumbs up!

For testing, i was too lazy to setup the webserver as described. I tested with Netcat on my Mac. Here's a log for others who want to try.

Setup the logging on the ESP using AT command, and then grounding GPIO2 3 times with varying the #seconds:
Code: Select allready
AT+CSTARTLOG="TCP","192.168.0.10",80
Done setting up the Logger at GPIO2
OK
Linked
SEND OK
ALREAY CONNECT
SEND OK
ALREAY CONNECT
SEND OK


Displaying 3 commands send by ESP on Netcat server:

Code: Select allMac-mini-van-gerard:Documents gerard$ sudo nc -l 80
GET &d=4 HTTP/1.0
Host: 192.168.0.10

GET &d=8 HTTP/1.0
Host: 192.168.0.10

GET &d=12 HTTP/1.0
Host: 192.168.0.10


The variable number is the #seconds the GPIO2 was kept low.

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.

Had fun!

Re: Native Smartmeter/datalogger

PostPosted: Tue Nov 11, 2014 4:49 am
by gerardwr
I have uploaded the pre-built binaries of this firmware to my ESP8266 and had no trouble getting them to work.

@ Borstenhorst : Thumbs up!

For testing, i was too lazy to setup the webserver as described. I tested with Netcat on my Mac. Here's a log for others who want to try.

Setup the logging on the ESP using AT command, and then grounding GPIO2 3 times with varying the #seconds:
Code: Select allready
AT+CSTARTLOG="TCP","192.168.0.10",80
Done setting up the Logger at GPIO2
OK
Linked
SEND OK
ALREAY CONNECT
SEND OK
ALREAY CONNECT
SEND OK


Displaying 3 commands send by ESP on Netcat server:

Code: Select allMac-mini-van-gerard:Documents gerard$ sudo nc -l 80
GET &d=4 HTTP/1.0
Host: 192.168.0.10

GET &d=8 HTTP/1.0
Host: 192.168.0.10

GET &d=12 HTTP/1.0
Host: 192.168.0.10


The variable number is the #seconds the GPIO2 was kept low.

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.

Had fun!, Thanks!!/quote]