Recording datas into internal memory

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Recording datas into internal memory

#1 Post by Sylv_01 » 04 Aug 2022, 16:33

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 !

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Recording datas into internal memory

#2 Post by Ath » 04 Aug 2022, 16:59

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?
/Ton (PayPal.me)

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#3 Post by Sylv_01 » 05 Aug 2022, 07:42

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

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Recording datas into internal memory

#4 Post by Ath » 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.
/Ton (PayPal.me)

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#5 Post by Sylv_01 » 05 Aug 2022, 09:03

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

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Recording datas into internal memory

#6 Post by TD-er » 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.

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#7 Post by Sylv_01 » 05 Aug 2022, 11:38

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...

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#8 Post by Sylv_01 » 09 Aug 2022, 13:49

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 4482 times

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Recording datas into internal memory

#9 Post by Ath » 09 Aug 2022, 13:59

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.
/Ton (PayPal.me)

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#10 Post by Sylv_01 » 09 Aug 2022, 14:06

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 ???

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Recording datas into internal memory

#11 Post by Ath » 09 Aug 2022, 14:30

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-)
/Ton (PayPal.me)

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#12 Post by Sylv_01 » 09 Aug 2022, 14:43

Ok, many thanks for your help !
I will let you know if everything is working properly when I receive my sensor.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Recording datas into internal memory

#13 Post by TD-er » 09 Aug 2022, 16:53

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.

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#14 Post by Sylv_01 » 11 Aug 2022, 09:27

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 !

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Recording datas into internal memory

#15 Post by Ath » 11 Aug 2022, 10:28

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.
/Ton (PayPal.me)

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#16 Post by Sylv_01 » 11 Aug 2022, 10:40

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:

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Recording datas into internal memory

#17 Post by Ath » 11 Aug 2022, 11:16

I think you switched the words in that password...
/Ton (PayPal.me)

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#18 Post by Sylv_01 » 11 Aug 2022, 11:58

you mean that the password is "configesp" ??? :shock: :shock:

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Recording datas into internal memory

#19 Post by TD-er » 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 ;)

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#20 Post by Sylv_01 » 11 Aug 2022, 13:22

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:

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Recording datas into internal memory

#21 Post by TD-er » 11 Aug 2022, 13:36

Where did you read this?

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#22 Post by Sylv_01 » 11 Aug 2022, 14:17

I don't remember exactly where, I read a lot of page about the wifi connection !

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Recording datas into internal memory

#23 Post by TD-er » 11 Aug 2022, 15:00

If it is anywhere on pages we manage, I will for sure remove this info.

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#24 Post by Sylv_01 » 11 Aug 2022, 15:04

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....

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#25 Post by Sylv_01 » 17 Aug 2022, 15:34

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 ?

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Recording datas into internal memory

#26 Post by Ath » 17 Aug 2022, 16:19

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.
/Ton (PayPal.me)

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#27 Post by Sylv_01 » 17 Aug 2022, 16:30

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...

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Recording datas into internal memory

#28 Post by TD-er » 17 Aug 2022, 21:03

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.

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#29 Post by Sylv_01 » 18 Aug 2022, 08:11

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 4119 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:

Sylv_01
Normal user
Posts: 19
Joined: 25 Aug 2021, 15:58

Re: Recording datas into internal memory

#30 Post by Sylv_01 » 18 Aug 2022, 10:02

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 ???

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Recording datas into internal memory

#31 Post by Ath » 18 Aug 2022, 11:00

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.
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 31 guests