These are chat archives for SmingHub/Sming

4th
Jan 2017
crosofg
@crosofg
Jan 04 2017 21:00
what is the best way to log data to esp8266 and send it peroidically to server?
I need to save power consumption data every second
laurentppol
@laurentppol
Jan 04 2017 21:04
@crosofg I have been thinking some day about "3 level" system:
  • lowest level, AVR (PicoPower?), easy to go to low power level, but no WiFi/Ethernet
  • middle - ESP
  • highest - Linux device (Orange PI?)
powerful but power (quite, 5V 2A) hungry
amount of Flash "KB" / "MB" / "GB" (even SQL base)
link between AVR / ESP using 433MHz low power radio
crosofg
@crosofg
Jan 04 2017 21:45
@laurentppol I just want to use esp only.
is stroing in flash an option
I can make regular update to server and clear the flash
laurentppol
@laurentppol
Jan 04 2017 21:47
there is FlashFilesystem and You could disable WiFi when not needed (but it costs startup time)
crosofg
@crosofg
Jan 04 2017 21:49
wifi always on is fine
laurentppol
@laurentppol
Jan 04 2017 21:49
if FFS uses "wear levelling" it could be useful
but costs power
crosofg
@crosofg
Jan 04 2017 21:49
what is that
wear levelling?
do you mean I maintain a file with values?
when offline and send it all once?
can you show a sample code to send a logged file to server from esp?
laurentppol
@laurentppol
Jan 04 2017 21:50
storing data spreaded over entire Flash, as single sector has only 10-100k writes endurance
crosofg
@crosofg
Jan 04 2017 21:50
oh
laurentppol
@laurentppol
Jan 04 2017 21:51
You can check DS of module You use for Flash chip name, then chip maker DS for endurance
crosofg
@crosofg
Jan 04 2017 21:53
does smings implementaion of spiff use wear levelling?
even if I create a file
how do I send it over internet
can you show a sample code?
@laurentppol
laurentppol
@laurentppol
Jan 04 2017 21:56
don't know, ex EON EN25Q32 has 100k cycles
only used ESP as server not client, but did it as (almost) "copy/paste" from examples
laurentppol
@laurentppol
Jan 04 2017 22:04
digging in Smin/Services/SpiFS/README there is mention about wear leveling
laurentppol
@laurentppol
Jan 04 2017 22:12
sending normally would be: 1). connect to server, 2). send data using "print", until "end of time" or connection break, everything using callbacks, (I use "print" in interrupt, rest using callbacks)
3). close connection