|
From: | Christoph M. Wintersteiger |
Subject: | Re: [lwip-users] lwip on pico_w |
Date: | Thu, 27 Apr 2023 22:17:22 +0100 |
Hi Edward, I’m afraid my code isn’t public yet, but it’s exactly as simple as you imagine it. Every time you call into a function called mqtt_* you first call cyw43_arch_lwip_begin(); then the function, then cyw43_arch_lwip_end(); For example #include <pico/cyw43_arch.h> … cyw43_arch_lwip_begin(); err_t r = mqtt_publish(client, topic, payload, payload_length, qos, retain, cb, arg); cyw43_arch_lwip_end(); I’m also using mosquito, although the type of server really shouldn’t make any difference for your random panics here. Cheers, Christoph From: lwip-users-bounces+christoph=winterstiger.at@nongnu.org <lwip-users-bounces+christoph=winterstiger.at@nongnu.org> On Behalf Of Edward Vidal Hi Christoph Chrrisoph wrote "Yes, I’m using lwIP on Picos as well. In my case, the MQTT client was a bit of a pain and kept throwing me into random panics too. The problem is that it doesn’t take the state lock. Basically, all calls to mqtt_* functions have to be guarded by cyw43_arch_lwip_begin() / cyw43_arch_lwip_end(). Once I did that, everything became quite stable for me." First of all thank you for the information. This provides a path forward to getting the random panics resolved. I am very new to using lwip & pico_w. Can you provide a link to example code the shows cyw43_arch_lwip_begin() / cyw43_arch_lwip_end() with mqtt_ functions. What are using as the broker? I am using mosquitto on a RPi. I have been working on RPi Bare Metal. I can a broker on hardware/QEMU https://github.com/develone/Ultibo_Projects/tree/master/Pauls-ultibo-mqtt Edward Vidal Jr. e-mail develone@sbcglobal.net 915-595-1613 |
[Prev in Thread] | Current Thread | [Next in Thread] |