Using the webclient module in a program causes Berry to crash #18832
-
Greetings First off, sorry I'm in the wrong place. I'm aware of the Berry repo, but I'm reasonably confident this is an issue for here. If not, please kindly direct me to the right place. That out of the way... The ProblemWhen I use the webclient module, The strange thing is, however, that running code similar to what I'll paste below in the REPL works fine. For example:
Output:
My CodeHere is my code. The local address is a different Tasmota device.
My DeviceMy device is a Ulanzi Smart Pixel Clock (TC001), running Tasmota 12.5.0. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Currently, if the Wifi is not yet established, webclient may crash. This is not ideal but we hadn't had time to fix this. One way to guard agains it is: if !tasmota.wifi()['up'] && !tasmota.eth()['up'] return end |
Beta Was this translation helpful? Give feedback.
-
I'd strongly recommend closing the cl instance of webclient, instead of relying on garbage collection to clean up later. Not doing this may increase the risk of crashing. Also, I'd like add a couple of things outside of the crash issue. The command For monitoring status of another device, it is highly recommended to not use polling, but instead subscribe to MQTT messages already published by the other device when status changes. Some devices may not be able to sustain being polled every second, but crash due to that. To be clear, this would not be Berry crashing. |
Beta Was this translation helpful? Give feedback.
-
I'm currently trying something similar. The example in the documentation works. When I change the link to Google https://script.google.com, Berry seems to crash. In any case, I get no feedback and there is no entry in the Google Sheet either. Have you found a solution? My code:
|
Beta Was this translation helpful? Give feedback.
Currently, if the Wifi is not yet established, webclient may crash. This is not ideal but we hadn't had time to fix this.
One way to guard agains it is: