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
12v alert doesn't shut down OVMS #711
Comments
As mentioned on the UI, the module wakes up from shutdown (actually deep sleep) once per minute. Currently the 12V deep sleep mode doesn't apply your configured threshold settings to the 12V check on wakeup, but rather uses fixed standard values. If the voltage seems to be restored it will proceed to a normal boot, possibly leading to a new alert once the system is up and can apply your actual settings. You can see the voltage level the boot module reads during the wakeup using a USB terminal (there is no file logging at this stage). Look for a log line "12V level: ~…V" and the following line. Please collect & post readings from a few wakeups. To be able to apply the user config on 12V wakeup, the calibration & threshold value needs to be added to the RTC RAM section, and the section must not be cleared on wakeup if still intact. I saw occasional memory corruptions on my deep sleep tests, so that may not catch all wakeups. Regards, |
That's expected behaviour, as 11V is, depending on the measurement variance, high enough to assume power has been restored. As written above, you can see the voltage level as interpreted by the boot module logged during the boot process. |
You still didn't post your boot log 12V messages, so I cannot know what uncalibrated voltage level your module reads (see above). |
I did only once see a log with the 12 level but I no longer see them during boot on the console - why is that ? Is there a way to force it to log that ? Is my Terminal broken ( I'm using screen on a mac connected via usb 112500 baud ) Once I saw: which was at 11Volts real Voltage. So 9Volts should keep it down right ? |
Yes, 9V should be classified as unbootable. The 12V level is only checked & logged on a boot from a wakeup. You don't need to wait for the module to detect a low level, you can also use |
Hmmm another finding - with the serial console attached it stays in deep sleep for an hour , detaching it , it will turn on the next time. (Doing 8V input voltage this time). |
And the boot 12V messages when it returned to full boot were…? |
Well, I was not connecting to it at the time, so I don't know. I might have a look if anything got logged to the sd card when I'm back at my desktop. |
See above on the log messages, serial speed isn't relevant. SD log won't help, as the early boot phase isn't logged to SD. |
I've done a grep through my scrollbackbuffer and I've seen that message only once where it had a sufficient battery level. But 50 times with insufficient battery level. As another test to see if it would stay in deep sleep I did it leave running without a console attached last night: It continously booted with just 8V connected to obd and no serial console attached. It looks like this the whole time:
I'm sorry if I'm not helpful, or if I did not understand you correctly. What else should I try ? |
Btw. I don't think I mentioned it, but the boot process always tells me about RTC_MODULE error about a lock being released before acquired.
|
The RTC_MODULE errors are expected and can be ignored as stated in the source, but the relevant log lines come directly before and after them:
This tells you the boot module has correctly detected the wakeup cause and a too low 12V level, putting the module back to sleep. You should see this cycle once per minute after entering deep sleep. You wrote your module leaves the cycle after some minutes. I need to know what you see exactly there when the module leaves the cycle and boots normally despite not having a high enough voltage. My development module has now been doing the deep sleep cycle correctly for about an hour, so something's different with your module. |
I just looked at the source vehicle/OVMS.V3/main/ovms_boot.cpp cause I wanted to see if I could understand the error about the lock released before locked and saw the remark about the lock, so all good. But looking at the code, I wonder: the battery code is only checked when the boot reason is DEEPSLEEP_RESET Why not always check the battery, except for debugging purposes (so when a console is attached) ? So my simple idea would be to
Furthermore I saw the level calculation using ints and floats without converting - that's doing alright with modern c compilers ? On a side note there, can't OVMS store the calibration data somewhere that it's available on boot ? |
Suspecting a different boot reason was what lead me to asking you to check the log. Inserting the test only on deep sleep wakeup is done intentionally to reduce potential harm from a general issue with the ADC reading. That may need to be changed if your issue turns out to be common. On the float: strictly, a cast to float for the |
is there not a way to keep the boot messages somewhere in ram until it's clear if the log is written to file and then either dicarded (no logfile) or send directly to the log file. Thinking of it , I would change the boot check in the following way as it would always protect the battery no matter what:
On a side question - I read that the ESP deep sleep: What else does cost so much power with OVMS when in deep sleep ? |
Keeping the boot log wasn't necessary before, but you're of course welcome to implement that. On changing the boot process: as written, that's nothing we should do without good reason, as it may lead to modules not being able to boot. Please try to get those log messages. On the power consumption: the OVMS consists of more than the ESP32 core, most secondary or passive components cannot be switched off or put to sleep. |
Just FYI (EDIT now 4boxes) I've looked at the now 4 ovms boxes ( 2021-03-25, 2022-03-05, 2022-05-23) I have here and see that they are having the same error curve on detecting the correct voltage ( measured / real voltage ) with the default setting of 195.7. as I see that the voltage error is a almost linear function between 10-15 volts I added a linear error correction and with that the errors are now linear in that range: so that one can get much better voltage estimation with just one correct measurement. This would be needed for a good deep sleep that works at a specific voltage. |
Deep sleep not held correctly without USB_5V feeding the system !! I have just acquired an OVMS HW v3.3 with MODEM 7600G I am running "edge" firmware and can concur with the findings from @jollyjinx that *the deep sleep mode only works when the (USB_5V) power rail is present. I am testing with a bench power supply with my new kit before taking the risk to attach it to my EV vehicle AUX battery... Has this issue not been resolved / understood since first posted here in 2022 ? I have had a look at ther schematics for the main board and the modem board to try to see if I could figure out what could be the issue...CSL_DTR/RTS outputs from CP2102 (USB_5V powered) idling high in the precence of USB_5V and somewhat controlling ESP32_EN might relate...? Obviously without <USB_5V> present one cannot get the boot messages out of the usb connector as the USB_2_Serial chipset would be unpowered. I guess that those messages would come out directly out of the ESP32 at 3v3 if there was a clear Testpoint to attach to : |
When it works properly with the <USB_5V> present:
and over and over drawing 0.22W (11.4V@20mA) for 60secs and then briefly waking up and drawing 0.34W(11.4V@30mA) |
My CONFIG/VEhicle/12Vmonitor is set to : 12V reference: 12.8V 12V shutdown: 12.0V |
I'll attempt to to place a <USB_2_SERIAL>@3v3 on resistor R25 (ESP32.TX0) , located in the top-end corner of the main PCB: This should clarify what the boot messages are when BAT=11.4V and the USB_5V is not present in the system : as I said earlier, for me, withoput USB_5V present, , the deep-sleep is NOT maintained, and the unit reboots fully , drawing 1.7W peak at some point (modem enabled) and will repeat this same full power-up over and over since the BAT will always read 11.4V (using power supply for testing). On an actual vehicle AUX battery, this would rapidly deplete the charges over a few days... |
My first route worked quite well with changing the kernel and going immediately to sleep even before the second core would spin up as it would sometimes reset itself for unknown reasons. |
I have a 2017 leaf 30 black edition with ovms running the latest firmware.
I've calibrated the 12v battery using my DVM and I've setup OVMS to shutdown after 2 minutes when the battery level goes 0.4v below threshold.
However, I just keep getting 12v alerts in the android app and OVMS never shuts down (at least I don't think it does). I'd assumed that I'd get a single alert and wouldn't get another until 12v is restored when I power the car up again.
Apologies if I've misunderstood the behaviour. Happy to help debug etc if this is a legit issue.
The text was updated successfully, but these errors were encountered: