Page 1 of 1

Recording datas into internal memory

Posted: 04 Aug 2022, 16:33
by Sylv_01
Hello, I have a project with a Wemos D1 Mini and EspEasy : I want to use this like a data logger for noise measurement.
Do you know how it's possible to record datas in Wemos memory, into a text file for example ?
And how can I read this file after recording ?
Many thanks for your help !

Re: Recording datas into internal memory

Posted: 04 Aug 2022, 16:59
by Ath
You can use the Cache controller, that is included in the Custom builds available from the regular Github downloads page.

Description is a bit compact, but it is complete, and should get you going.

What type of sensor do you intend to use to collect the noise measurements?

Re: Recording datas into internal memory

Posted: 05 Aug 2022, 07:42
by Sylv_01
Hello, and thanks for your quick reply !
I will take a look about that...
My sensor is a GY-MAX4466, like this :
https://www.adafruit.com/product/1063

Re: Recording datas into internal memory

Posted: 05 Aug 2022, 08:58
by Ath
AFAICS, that device needs to be connected to an analog input, as there is no specific plugin available in ESPEasy, but analog should work OK for your use.

Re: Recording datas into internal memory

Posted: 05 Aug 2022, 09:03
by Sylv_01
Ath wrote: 05 Aug 2022, 08:58 AFAICS, that device needs to be connected to an analog input, as there is no specific plugin available in ESPEasy, but analog should work OK for your use.
Yes, I will see how I can read value from analog input (connected to my device) and record it into RTC memory with Cache controller

Re: Recording datas into internal memory

Posted: 05 Aug 2022, 09:28
by TD-er
It will first record it into RTC to make sure there is a large enough chunk of data to write to flash.
The reason it is put in RTC first is to make sure no data gets lost in cache of a crash or warm reboot.

There is a .htm file in the source tree (dump6.htm I think it is named) which you need to upload to the filesystem too.
When opening this file (loaded from the ESPs filesystem in a new tab for example), it will fetch the .bin files and decode them in JavaScript and then generate a .CSV file from it to analyze in just any spreadsheet program.

Re: Recording datas into internal memory

Posted: 05 Aug 2022, 11:38
by Sylv_01
TD-er wrote: 05 Aug 2022, 09:28 It will first record it into RTC to make sure there is a large enough chunk of data to write to flash.
The reason it is put in RTC first is to make sure no data gets lost in cache of a crash or warm reboot.

There is a .htm file in the source tree (dump6.htm I think it is named) which you need to upload to the filesystem too.
When opening this file (loaded from the ESPs filesystem in a new tab for example), it will fetch the .bin files and decode them in JavaScript and then generate a .CSV file from it to analyze in just any spreadsheet program.
Thanks for your help ! :D
It seem be exactly what I want...

Re: Recording datas into internal memory

Posted: 09 Aug 2022, 13:49
by Sylv_01
Hello guys,
I've just downloaded the latest build :
https://github.com/letscontrolit/ESPEas ... a-20220809
and unzipped it...
We are ok, that I should use this binary file, for my Wemos D1 Mini (ESP8266) ?
Screen Shot 08-09-22 at 01.43 PM.PNG
Screen Shot 08-09-22 at 01.43 PM.PNG (25.45 KiB) Viewed 4866 times

Re: Recording datas into internal memory

Posted: 09 Aug 2022, 13:59
by Ath
You should install the same name of the .bin file you used before, except of course with the new date ;)
So for a Wemos D1 mini that should be the correct one.

Re: Recording datas into internal memory

Posted: 09 Aug 2022, 14:06
by Sylv_01
Thanks for you quick reply !
I'm not sure to remember witch I'm using actually, I think it's "ESP_Easy_mega_20210802_normal_ESP8266_4M1M.bin"...
But you told me, that Cache Controler is only on the custom build, so I believe I have to use the binary with "xxx_custom_xxx" on the name ???

Re: Recording datas into internal memory

Posted: 09 Aug 2022, 14:30
by Ath
That's correct.

You can see the currently installed .bin file in the Info page (available from 'Main/More info' or 'Tools/Info') in the Firmware section.
'Custom' is currently the only ESP8266 build that has the Cache controller included.

Edit:
And as long as you keep the Flash/Filesystem config (4M1M) the same, you can install any build for the same processor (ESP8266, ESP32 or ESP32s2) and keep your current configuration. Though some builds might have a few more/different plugins or less features available.

When doing the upgrade via 'Tools/Update Firmware', usually from the computer, you can also select the .bin.gz file; the OTA feature knows how to handle this compressed file, and as it is smaller, it's a little quicker to upload 8-)

Re: Recording datas into internal memory

Posted: 09 Aug 2022, 14:43
by Sylv_01
Ok, many thanks for your help !
I will let you know if everything is working properly when I receive my sensor.

Re: Recording datas into internal memory

Posted: 09 Aug 2022, 16:53
by TD-er
You can already start testing by using something like the system info plugin.
This generates samples like free memory, system load, etc. (whatever you select)
Then you can send the data from a task running the sysinfo plugin to send it to the "Cache Controller" and you can see how the data is being saved, how to process it, etc.

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 09:27
by Sylv_01
Hello,
Previously, my Wemos was configured with my home's wifi...
I have flashed it with custom firmware (I've flashed it with blank_4MB firmware before), and I'm trying to connect here at job, but I don"t see wifi SSID "espeasy_0", like original config...
How can I reset the Wemos to see ad-hoc access point ?
Thanks in advance !

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 10:28
by Ath
The default AP should be ESP_Easy (unless you have made your own Custom build), but please keep in mind that after 5 minutes of inactivity, the AP is stopped. A reset/power cycle of the device should get it active again.

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 10:40
by Sylv_01
Yes thanks, I manage to see ESP_easy wifi, but I can't connect my phone...
I'm trying with "espconfig" password, but no way !
I think I will try this evening at home with an another tablet... :evil: :evil: :evil:

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 11:16
by Ath
I think you switched the words in that password...

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 11:58
by Sylv_01
you mean that the password is "configesp" ??? :shock: :shock:

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 13:07
by TD-er
Sylv_01 wrote: 11 Aug 2022, 11:58 you mean that the password is "configesp" ??? :shock: :shock:
Yep, as it has been for ages ;)

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 13:22
by Sylv_01
TD-er wrote: 11 Aug 2022, 13:07
Sylv_01 wrote: 11 Aug 2022, 11:58 you mean that the password is "configesp" ??? :shock: :shock:
Yep, as it has been for ages ;)
You read both in internet, when you're cherching "password ESP_Easy" !! :twisted: :twisted:

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 13:36
by TD-er
Where did you read this?

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 14:17
by Sylv_01
I don't remember exactly where, I read a lot of page about the wifi connection !

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 15:00
by TD-er
If it is anywhere on pages we manage, I will for sure remove this info.

Re: Recording datas into internal memory

Posted: 11 Aug 2022, 15:04
by Sylv_01
TD-er wrote: 11 Aug 2022, 15:00 If it is anywhere on pages we manage, I will for sure remove this info.
No, it's not into this forum, I think it was on a tuto somewhere....

Re: Recording datas into internal memory

Posted: 17 Aug 2022, 15:34
by Sylv_01
Hello, some (bad) news : I can't connect to my Wemos by WiFi AP mode here at job, I thinks it's because we have a lot of differents Wifi SSID / channels, so Wemos Wifi seem to be inconstant...
Can you tell me how I can force AP Mode ?
Do you think I can send "WifiAPMode" serial command with Arduino IDE ?

Re: Recording datas into internal memory

Posted: 17 Aug 2022, 16:19
by Ath
Sylv_01 wrote: 17 Aug 2022, 15:34 Do you think I can send "WifiAPMode" serial command with Arduino IDE ?
Yes, that's one of the possibilities.

You can also watch what is logged during boot (hint: reboot command), to see what is going on while trying to connect to WiFi, and you can also force a specific SSID using the "WiFiSSID,{SSID}" and "WiFiKey,{ssid-key}" commands, and then the "Connect" command to start the connection.
You need to enter those commands blind (or enable input echo in your terminal), and can't correct typos!

After that succeeds, you should be able to see the IP address assigned to the ESP unit, so you can use the web UI.

Re: Recording datas into internal memory

Posted: 17 Aug 2022, 16:30
by Sylv_01
Thanks for your quick reply !
The pb is, I don't have authorization to use WiFi Network at job, I can only connect to Wemos in AP mode with my tablet or my phone...
So It's because I want to force AP mode only, to be sure Wemos won't be disturb by other WiFi networks....
I will try this tomorrow...

Re: Recording datas into internal memory

Posted: 17 Aug 2022, 21:03
by TD-er
One quick work-around is that you can setup your phone as a mobile hotspot.
Just set the credentials you programmed into ESPEasy as the settings for your hotspot and then ESPEasy will probably connect to your phone as that's then the strongest signal.

Then you need to figure out what IP-address the ESP received from your phone.
For this I use the "LAN scan" option in an app called Network Analyzer I have on my phone. (a truly must have app, I have the pro version and use it very often)

This way you can acces your ESPEasy node from a browser on your phone.

If you are running a build which has "mDNS" included, then you can also access it via the ESPEasy name with ".local" appended to the name.
This name is shown at the root page on the ESPEasy device.

Re: Recording datas into internal memory

Posted: 18 Aug 2022, 08:11
by Sylv_01
Hello, I have a pb to send command to Wemos with Arduino IDE...
I'm correctly receiving message from Wemos, but command I send seem not to be received by Wemos (example below with "DateTime" command) :
Screen Shot 08-18-22 at 08.08 AM.PNG
Screen Shot 08-18-22 at 08.08 AM.PNG (101.51 KiB) Viewed 4503 times
[Edit] Ok, that's working fine, I didnt' see that I have to put Crtl+Enter to send command !!! Sorry for the mistake... :oops: :oops: :oops:

Re: Recording datas into internal memory

Posted: 18 Aug 2022, 10:02
by Sylv_01
Regarding the list of commands on this page :

https://espeasy.readthedocs.io/en/lates ... mmand.html

I don't see a GPIO command to read analog input on A0 pin, isn't possible ???

Re: Recording datas into internal memory

Posted: 18 Aug 2022, 11:00
by Ath
Sylv_01 wrote: 18 Aug 2022, 08:11 [Edit] Ok, that's working fine, I didnt' see that I have to put Crtl+Enter to send command !!! Sorry for the mistake... :oops: :oops: :oops:
That's just one of the peculiarities of Arduino IDE... :shock:
We advise the use of VSCode with PlatformIO when working with/on ESPEasy (development), but you could even use the monitor command of the ESPEasy flasher, as long as your serial ports are recognized by that.
Sylv_01 wrote: 18 Aug 2022, 10:02 I don't see a GPIO command to read analog input on A0 pin, isn't possible ???
There is no direct command for that (AFAIK), but you can use the 'Analog input' plugin for that.