keerekeerweere / ESP32_SMA-Inverter-MQTT

Arduino project to read SMA Inverter data via ESP32 bluetooth
MIT License
1 stars 0 forks source link

Changing SCANRATE has no effect #9

Closed kommando828 closed 6 months ago

kommando828 commented 6 months ago

Changing

define SCAN_RATE 60 in config_values.h

to a different number has no effect, refresh rate in MQTT is still 60 secs.

Going into ESP32_SMA_Inverter_App.cpp and editing the

else

appConfig.scanRate = doc["scanRate"] | 60 ;

to something other than 60 also has no effect either

My pragmatic fix was in config_values to set SUNUP to 22, SUNDOWN to 23 and changed NIGHTSCANRATE to 1times15times1000

This gives me the 15 sec I need to match the Solar-log the data is fed to but it wrong from a programming point of view. I have searched through the code to see where the appConfig.scanRate gets fixed at 60 but nothing stands out.

darrylb123 commented 6 months ago

The scan rate is changed in the web page. It is saved to the config file for next reboot.

kommando828 commented 6 months ago

Yep, assumptions and all, saw an example file, copied it and renamed, filled in all the details and it connected to the inverter, wifi and MQTT, but got the 60 sec refresh, rebooted several times as I had seen the note on settings but it steadfastly stuck to 60. Just rebuilt to a new ESP32 and entered all the details on the website and the 15 secs works.