-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persistent storage #15
Comments
Did you use the json library for storage or some other method? |
Yes, I used ArduinoJson library to store.
It would be helpfull especially for devices I don't have. I have changes for storage on a separate branch. I suspect it contains also the device I added to control the servo motor. |
Ok, I've created a 'serialize device settings' branch. |
Hello I have great interest in their aquarium control. I have tested the controller on a "Node MCU32" and "ESP32 Wrover" board, unfortunately I have problems saving the configuration on the SPIFFS or SD card memory. When I write the devices.json in the following format to memory. Will I receive the following log output:
Am I doing something wrong or is there an error in the code? |
hey, try posting your problem over here. I'm not sure what the issue is. |
Hi urkrossi, I need to anticipate that the devices store and load is still in debug so I do not guarantee that it works 100%. Anyway the devices.json file is supposed to be written by the app and not manually. Could you try to delete it and let the firmware handle it? I am in the process of implementing the hardware so soon I will probably debug it. |
Hi Avilla83,
I have now reinstalled my two boards. Both are correctly displayed on the home site after setting up a thermometer and saving. If I then restart the board, a device is loaded in the log with the correct settings that I have set. However, the thermometer is no longer displayed on the home site.
Log with configuration and storage of the device:
>
......ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac
Initializing SPIFFS...
SUCCESS - Found index.htm file.
Print config file...
{
"ssid": "my ssid",
"password": "my pass",
"ip": [192, 168, 1, 180],
"gateway": [192, 168, 1, 1],
"subnet": [255, 255, 255, 0],
"timeZone": 2,
"ntpServer": "time.google.com"
}
Loading configuration...
{
"ssid": "my ssid",
"password": "my pass",
"ip": [192, 168, 1, 180],
"gateway": [192, 168, 1, 1],
"subnet": [255, 255, 255, 0],
"timeZone": 2,
"ntpServer": "time.google.com"
}
Connecting to my ssid
.Connected to wifi
IP Address: 192.168.1.180
Loading Devices
Failed to read file, using default configuration
waiting for sync
Transmit NTP Request
Receive NTP Response
memory 253468
user pass
14177
set: and
Saving Devices
Serializing OneWireSensor
[{"numDevices":1},{"pin":4,"classType":"OneWireSensor","deviceName":"Thermometer","imageName":"thermo.jpg","deviceColor":"70B829","deviceState":false,"suspendTime":false,"deviceId":1,"min":0,"max":50,"unit":""}]
success ajax
<<
Log after restarting the board:
>
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac
Initializing SPIFFS...
SUCCESS - Found index.htm file.
Print config file...
{
"ssid": "my ssid",
"password": "my pass",
"ip": [192, 168, 1, 180],
"gateway": [192, 168, 1, 1],
"subnet": [255, 255, 255, 0],
"timeZone": 2,
"ntpServer": "time.google.com"
}
Loading configuration...
{
"ssid": "my ssid",
"password": "my pass",
"ip": [192, 168, 1, 180],
"gateway": [192, 168, 1, 1],
"subnet": [255, 255, 255, 0],
"timeZone": 2,
"ntpServer": "time.google.com"
}
Connecting to my ssid
....Connected to wifi
IP Address: 192.168.1.180
Loading Devices
Found devices: 1
[{"numDevices":1},{"pin":4,"classType":"OneWireSensor","deviceName":"Thermometer","imageName":"thermo.jpg","deviceColor":"70B829","deviceState":false,"suspendTime":false,"deviceId":1,"min":0,"max":50,"unit":""}]
waiting for sync
Transmit NTP Request
Receive NTP Response
memory 253324
user pass
46892
<<
I hope we can find a way that I can use the controller.
It is a great project.
Kind regards
Von: Avilla83 <[email protected]>
Gesendet: Donnerstag, 4. Juni 2020 19:00
An: mistergreen/WAAC <[email protected]>
Cc: urkrossi <[email protected]>; Comment <[email protected]>
Betreff: Re: [mistergreen/WAAC] Persistent storage (#15)
Hi urkrossi,
I need to anticipate that the devices store and load is still in debug so I do not guarantee that it works 100%. Anyway the devices.json file is supposed to be written by the app and not manually. Could you try to delete it and let the firmware handle it?
I am in the process of implementing the hardware so soon I will probably debug it.
—
You are receiving this because you commented.
Reply to this email directly, <#15 (comment)> view it on GitHub, or <https://github.com/notifications/unsubscribe-auth/AP2OR4F7EKVZ4AYRUEDFMKLRU7HHVANCNFSM4KVFVMGQ> unsubscribe. <https://github.com/notifications/beacon/AP2OR4EEQ4WGUGNZCHSCSRTRU7HHVA5CNFSM4KVFVMG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEYLBNVQ.gif>
|
Hi urkrossi, I checked in the code and I didn't remember a simple fact: only the servo motor and the relay are completely stored and loaded! Said so there are some bugs in the relay too so now I am focusing on debugging the restore process with a simple relay. If I find some time I may add the one wire sensor too. It would be good if you have a chance to test the code too, so we have a double check on my changes. I will let you know as soon as I have something working. Regards |
Hi urkrossi, Added One Wire store and load - partially tested The OneWireSensor class should be correctly saved and loaded but unfortunately I don't have a sensor of this type for a complete testing. If you can test please report the results. I will test the events handling changes for Relay since they were not working in the previous code. Regards |
Hello Avilla83, this sounds good, I can test here with the help of DS18b20 One Wire sensors whether the configurations are saved and loaded again after restart. Greeting |
Hi ukrossi, I am not sure what you mean for customized files, do you mean the devices configuration? In the meanwhile my DS18B20 sensor arrived so I have been able to test it and it seems to work correctly. I suggest you also to download from my stream since I uploaded some fixes there about devices persistent storage (incase you are using it). Regards |
Hi,
I added storage capability to all sensors and devices.
I know for sure that AdaFruitPWM8 is not stored completely and still needs some development.
Currently I tested only the ServoMotor class I added but it would be nice to have further tesing.
I am also checking how much memory is needed to serialize/deserialize the json for a correct memory allocation.
Would you like to collaborate or better integrate it in the main repository (maybe in a separate branch)?
I could start to send pull requests as soon as I implement something if you think it would be a good way to proceed.
The text was updated successfully, but these errors were encountered: