Hello everyone, I wanted to know by looking at the logs what this warning message can be regarding response times.
[10:33:10][D][sensor:094]: 'PV Power': Sending state 131.00000 W with 0 decimals of accuracy
[10:33:10][D][sensor:094]: 'Solar Energy Produced': Sending state 23.87855 Wh with 2 decimals of accuracy
[10:33:10][D][text_sensor:064]: 'MPPT state': Sending state 'Bulk'
[10:33:10][D][text_sensor:064]: 'MPPT Error reason': Sending state ''
[10:33:11][D][victron_ble:027]: [F1:8D:57:7C:C2:61] Received SOLAR_CHARGER message.
[10:33:11][D][sensor:094]: 'Battery Voltage': Sending state 53.19000 V with 2 decimals of accuracy
[10:33:11][D][sensor:094]: 'Battery Current': Sending state 2.40000 A with 3 decimals of accuracy
[10:33:11][D][sensor:094]: 'Yield Today': Sending state 0.20000 kWh with 2 decimals of accuracy
[10:33:11][D][sensor:094]: 'PV Power': Sending state 132.00000 W with 0 decimals of accuracy
[10:33:11][D][sensor:094]: 'Solar Energy Produced': Sending state 23.92439 Wh with 2 decimals of accuracy
[10:33:11][D][sensor:094]: 'Load Current': Sending state nan A with 1 decimals of accuracy
[10:33:11][D][text_sensor:064]: 'MPPT state': Sending state 'Bulk'
[10:33:11][D][text_sensor:064]: 'MPPT Error reason': Sending state ''
[10:33:11][W][component:237]: Component victron_ble took a long time for an operation (67 ms).
[10:33:11][W][component:238]: Components should block for at most 30 ms.
Don’t worry about it, it’s just a warning introduced a few versions ago.
If all your components are working correctly then it is fine, just means they are slower than some arbitrary value the devs assigned. My displays spit this message out every refresh cycle.
Anyway thanks, at the moment I find that for no reason only two of the 4 esp32 that I have in particular those that monitor two victron sometimes remain.
It’s a warning. How important it is to pay any attention to it depends on what the device is doing. Loop time is important for some tasks/components and doesn’t matter at all for others. Unfortunately figuring out if it matters or not is not easy.
No direct experience with the binary sensor using GPIO yet, but it seems it only checks every loop (doesn’t use interrupts). This means it could miss events if the loop time is too long too frequently.
Generally, if you device is doing what you want you can ignore the message, especially when the number is small like that. At many hundreds of ms, I would start working to understand why and likely change the design of the device.
Wroom is Wroom, other Esp variants are others. You can’t directly compare them. Neither you can compare one that run BLE to one that doesn’t.
If you have questions, be specific.
Your warning looks harmless.
unlikely to be a memory issue, it is more with how much work is being done in each loop period.
Some components try and do too much in a single loop, so they deprive other components from running, hence the warning. Doing the same amount of work across multiple loop/update periods is harder (to write the component code). The advantage is it gives other components more time to run. This matters for some components but not at all for others.
I have seen people write code that takes many seconds to update a display. This seems like a generally bad idea but can work okay for some devices.
Hello, regarding my question it is evident that my experience on esp32 is limited. I thought this because the loop cycle seemed to be slow because according to my personal impression I suspected that it could be generated by the hardware, but evidently it is not so
Thanks Neel, in fact I wanted to tell you that as far as the two esp32 counts I brought them closer to the two victors and the 130ms waiting times have gone down, but I don’t know if this centers something. Thank you for your intervention which for me turns out to be a source of teaching.
It is hard to make generalizations. There are differences in the various esp boards in terms of the number, type, and speed of the CPUs. These can definitely have an impact on performance.
My understanding of the loop time warning is the code is tracking the time it starts the loop (for each component it seems) and then compares it to the time it is when done. If the time it takes is too long it shows the warning.
I am working on a component to listen to my water heater. I use a state machine and only do anything if at least how much data I need (for the current state) is available. This means I am never delaying in loop() or update(). Some of the components I have seen do a LOT of work in a single loop, sometimes with delays. Sometimes it is reasonably easy to change this, but other times it can be very hard.