Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

SDK • Re: lwIP: Custom request handling results in panic

$
0
0

I don't think that is true. I use the background picow system option and do tcp client and server. works great. I don't have a really simple example, but my working example of a wifi accessing app does show this. It has 2 different tcp client/servers and test python code. https://github.com/nospamcalfee/pico-ap-configure

Steve
That's interesting. I am working on a basic configuration tool myself, which allows for setting the wireless connection parameters and a desired hostname, but not much else; a similar approach to the initial configuration method used in the Tasmota firmware.

Because of this, I want the application code to not be too tightly integrated into the configuration module, and vice versa.
Ideally, it would be a case of including a subdirectory into CMakeLists.txt, setting some preprocessor definitions, and dropping a tiny amount of code into main() along the lines of:

Code:

    configured(0);    const char*hostname = config_get_hostname();    const char*ssid = config_get_ssid();    const char*key = config_get_key();
and getting on with it from there.
The configured method takes care of everything else;
To cater for reconfiguration, it can be called with a non-zero parameter to force the unit into AP mode, using either a default name or the existing configured hostname.
When configuring for the first time (or reconfiguring), the system is rebooted on completion.
That way the configuration stuff is (mostly) boxed away from the application code.

For me, this means no use of httpd, in case the main application wants to use it. Sadly, this means code duplication, since I have to have an HTTP server to allow for web-based configuration :(

I like your approach to saving the configuration data without requiring use of something like littlefs, as that is quite neat.

Having done embedded work on ESP8266/ESP32 (and hobby stuff on ATmega), I agree on not necessarily needing an RTOS (and the extra code and learning curve that implies). However, I can see some instances where it would be useful, so I'm not saying "never".

Statistics: Posted by SteveSpencer — Fri Dec 12, 2025 10:59 am



Viewing all articles
Browse latest Browse all 8041

Trending Articles