-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
merge V23.12.16 #556
merge V23.12.16 #556
Conversation
Thanks to @broth-itk for the idea! Fix: #1258 #1397
… Midnight lead to wrong values.
@schlimmchen can you do a review please |
This is based on the idea of @Henrik-Ingenieur and was discussed in #1504
@helgeerbe I am humbled that you are asking for my opinion. I will gladly inspect the changeset and give feedback. I can't tell you when that will be...
This statement confuses me. If all the loop() functions now run in their own tasks, we need more mutexes. Many more. If that's really the case that every loop() function can now be preempted at any moment, there will be lots and lots of issues. I am really eager to learn what tbnobody did there and how it might affect the OpenDTU-OnBattery-specific features. |
Oooooh, I see! This actually sounds awesome! And now it makes sense that you are asking to remove mutexes. I still have questions, e.g., how these new non-preemptive tasks interface with preemptive threads that are not under our control, like the WiFi driver and so on? Very interesting. I will look at this in more detail soon. |
@schlimmchen Thanks, I would really appreciate your support. I just did a simple merge and applied @tbnobody patterns to our code extensions. It seems to run well (at least with my victron charger). But I don't own the complete supported hardware components. I assume even if everything will work well, we could refactor some code in future due to the newly introduced TaskScheduler. |
Hi, I just installed this PR. As far as I can tell everything is working.
Merry Christmas and thank y'all for the energy here ! |
Adding to this: |
@helgeerbe first of all let me thank you for your great job of maintaining this fantastic fork of OpenDTU for a variety of additional purposes. Especially the swift and timely manner in which you are merging upstream changes into your extensions are outstanding! 🎉 😄
I have only seen the code changes from upstream being merged into OpenDTU-OnBattery in this PR #556.
I would expect something similar as in |
I don't fully understand. This is done. Could it be that you only lock at one commit and not at all of the changes? |
OK, Thanks for the positiv feedback. So I will merge this PR. |
I appreciate the changes introduced with this PR, i.e., the work done in the upstream project to use TaskScheduler in favor of extending the
@stefan123t They are part of the merge commit 7c11a5a. @helgeerbe did all the work required to migrate all OpenDTU-OnBattery-specific components to TaskScheduler. Have a look at the changes to He did it in the most backwards-compatible way, which makes perfect sense. This means the components have their Regarding the mutex in And this is where my concers start: As far as I can tell, AsyncWebServer does indeed still run in a thread other than the main As before, all `loop()´ functions that we care about run in the same context. Now they are part of the TaskScheduler. However, also as before, some callbacks run in the context of the respective caller, i.e., MQTT and WebServer callbacks in particular. Those are not part of the TaskScheduler context. Same with the WiFi driver (and potentially other drivers as well), which also may execute callbacks that access shared data structures. As an example I looked closer at AsyncWebServer. I don't see that AsyncWebServer would have any knowledge about TaskScheduler such that it would ask TaskScheduler to execute callbacks as TaskScheduler tasks. Instead, the callbacks are (still) executed in the "async_tcp" FreeRTOS thread, which is scheduled pre-emptively alongside the TaskScheduler thread. Hence I don't see how we could remove mutexes and locking mechanisms, as the concurrency issues are the same as before. This is based on reading code as I am unable to conduct experiments right now. However, I am fairly confident that my assessment holds true.
It absolutely is not. Serial output will be garbled from time to time. Not within a single For the GridProfileParser, the library "Frozen" was added. That's also very interesting and can serve performance improvements and code reduction for JK BMS and VE.Direct at least. If this was not already released, I would argue to go ahead and do so. If users experience errors, we can address them as needed. This is a good time for experiments as sun is scarce anyways and people might have more time than usual to report, inspect and fix issues. #350 was effectively reverted. Let's keep that in mind in case spontaneous reboots or data corruption are reported while using the MQTT interface. We might need to have a look at all MQTT callbacks within OpenDTU-OnBattery. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns. |
This is a big merge for
from upstream
On my test system it seems to run, OK
But tbnobody separated the loop() functions of the components to run in separated tasks.
So please check if your components are still running:
I saw that you sometimes used mutexes, please check if they are still needed, because the loops runs now in tasks.
I also used the original MessageOutput, since it seems to be thread safe.