[Ovmsdev] Introducing myself and questions on deep sleep
Patrick Stein
4seasons-ovms at jinx.de
Sat Nov 12 16:20:07 HKT 2022
Hello All,
as described in https://docs.openvehicles.com/en/latest/introduction.html I’ll introduce myself ;-)
I do devleopment of mainly iOS/Mac software for a living. I have driven a BMW i3 for the last 6 years and the BMW iPhone app was so unreliable that I created a status application for myself (and two friends). As BMW servers no longer give out data about the SOH I recently started looking into OVMS.
As I’m using mqtt for my home equipment I started using ovms mqtt interface and filtering that to send the data to ABRP and my own application server.
As I’m only interested in live data while driving/charging and the 12v battery of the i3 is not charged while parked I would like to have the ovms module sleep when the car is parked - so the battery does not drain as much. I have to add that I can’t charge the car at home or work.
My current OVMS quest is to get deep sleep working correctly.
I have access to four OVMS modules and a lab-power supply so my starting point was to get correct voltage readings in software.
I first created correct measurements for the voltage level of the four modules. This gave me the data to have one calibration voltage measurement of a module and still have a fairly good voltage reading between 11 and 14 volts.
Then I started adding that to the current codebase. That works and the module goes to sleep when the car is parked.
What does not work is, that the module sometimes does not recognize it’s coming out of deep sleep and will fully boot and then go to sleep cause the battery level is too low. This is only happening when NOT connected to the serial port (bad for debugging).
I started to pack the calibration and wakeup voltage in a RTC_DATA_ATTR variable before sleep and immediately check it ovms_boot.c . That helped but it sometimes RTC_DATA_ATTR would be empty even though I set it the last line before going to sleep.
Then I thought ok, when the deep sleep is somewhat faulty, let the module go to sleep as early as possible in the boot process, so as soon as we have the configuration data with the calibration voltage and sleep then.
That works ok, but the problem is, that in the boot process the cellular modem is powered on and stays on when going to deep sleep. So I decided to power off the cellular modem, but that will sometimes crash.
So my questions:
1. Why does the module forget that it was in deep sleep before ? Is it the esp32 beeing faulty or something else ?
2. What would be the best way to immediately sleep again by reading the configuration without starting anything else - not even a second processor.
3. Is this the mailing list still active ? I would rather use the forum, but the forum is not really usable.
Best Regards, Patrick aka @jollyjinx
P.S.: If I can get OVMS to work for me I might adopt it to my application which then makes it possible for a broader audience to use (not just the three users it currently has) (currently it needs a backend where I’m using undocumented access to bmw servers, so I can’t open it up right now).
Currently it looks like this:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMG_1320.PNG
Type: image/png
Size: 225691 bytes
Desc: not available
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20221112/1be399e3/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMG_1323.PNG
Type: image/png
Size: 479510 bytes
Desc: not available
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20221112/1be399e3/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMG_1326.PNG
Type: image/png
Size: 476426 bytes
Desc: not available
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20221112/1be399e3/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMG_1327.PNG
Type: image/png
Size: 328442 bytes
Desc: not available
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20221112/1be399e3/attachment-0007.png>
-------------- next part --------------
More information about the OvmsDev
mailing list