-
Notifications
You must be signed in to change notification settings - Fork 166
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
ESP miss boot from OpenEvse and dont get the state of the atmega boot notif #173
Comments
My guess, ESP32 (which you probably use to takes longer time to boot than ATMEGA thus these messages are lost. You can get firmware version from http://openevse-XXXX.local/#/configuration/firmware menu |
Hello, |
You can get the version via |
Okay thanks a lot ! |
I guess this can be now closed. |
Okay so, i tried to use the $GS command, but it didn't succeed, are you sure you can get the post_code with this command ? |
The post code if just the status at boot, so it the status is not one of the error states it can be derived that the post code was 0 |
Okay, but i made some test, if i fake a stuck relay, i've got the post code 08 ( in the boot notif $AB at the boot), but when i send $GS i go state "fe" so sleeping. I try to send the command $F1, in a stuck relay behavior, then $GS, and i get state "00" so Unknown. |
Have you checked the |
I guess the check state is being cleared after the boot then, maybe a RAPI command is needed to get the POST code.... |
Ok, I see, I'm going to try to get it how I can for now, thanks for the help ! |
If you want to get the $AB result, you can send $FR and reset the ATmega when your ESP boots. OTOH, if you want what's returned by $AB, you can also just send $GS/$GV.
|
@lincomatic I couldn't find any error condition checks in or around The issue occurs if the WiFi controller is operated in "normally disabled" mode. The $FS command, used to put the Atmega into sleeping state after boot, overwrites the error state on the Atmega. Other functions like $F1 seem to reset the state variable too, but they leave it in undefined (00) state. And since the Atmega enters an infinite loop if the post checks fail, it doesn't recover the EVSE error state. This will never mean that the Atmega does something harmful like re-entering the normal operational mode. However, the error disappears from the display and becomes invisible for the ESP, making it harder to track the hardware status in external charge management systems. Still, the post_code is not affected and works quite well. |
@matth-x Thanks for the clarifications.
Perhaps the easiest/best way to fix this is to disable $FS & $FE if POST fails. Would that be acceptable to all? Only configuration commands and reboot should really be sent during a POST error. |
The "normally disabled mode" refers to the charging rules on the WiFi controller. If none of the rules explicitly allow charging, then the Atmega will be put into sleep. If no rule exists, it means the same. To be honest, I just recently started diving into your code and the RAPI interface on the WiFi controller. I'm not sure if the WiFi controller actually uses the $FS command to forbid charging on the Atmega or if it is implemented using the Auth Lock which would not have that side effect of overriding the EVSE state. But in any case, there seems to be at least one message from the ESP to Atmega which leads to the reset of the post_code. A first idea for a patch with less side effects could be to capture the EVSE state before processing the RAPI inputs and then to restore it afterwards. At this point: open_evse/firmware/open_evse/J1772EvseController.cpp Lines 1157 to 1159 in 4647293
Inside the while loop, capture and restore m_EvseState like this: auto captureState = m_EvseState;
ProcessInputs();
m_EvseState = captureState; Unfortunately, I don't have the debugging tools set up to try this on my OpenEVSE, but maybe it's still useful to post it here. |
FYI the latest ESP32 firmware should not put the ATMEGA to speed by default, but that is kind of mute as you can certainly set it up to go to sleep mode. IMHO if the expected behavior is that you shouldn't call $FS/$FD after a post failure (or any error condition?) then that probably should be enforced (and documented). We will probably need to update the ESP code as well to handle this. |
@jeremypoulter Have you ever tried the Auth lock feature? It seems like the less "intrusive" way of implementing the charge control. |
Yes, that's would be the preferred method, because it works independently of timers, user pressing the button, etc. |
Hello,
I have an issue, i would like to catch the boot notification from the atmega ( the messages $AB XX Firmware) but i succed to catch it only when i reboot manually the atmega (alone).
Where can i get this state after the whole boot ? Thanks a lot for helping !
Best regards
The text was updated successfully, but these errors were encountered: