pico-examples icon indicating copy to clipboard operation
pico-examples copied to clipboard

Add .md to README and clarify what example does

Open mjcross opened this issue 3 months ago • 8 comments

  1. For pico_w/wifi/mqtt, rename README to README.md to improve how the content renders in an IDE or when browsing the online repository.
  2. Clarify that the example doesn't re-publish the temperature reading if it hasn't changed; so that users can understand why the updates can appear sporadic.
  3. Document how the led status can be checked by subscribing to /led/status

mjcross avatar Oct 02 '25 20:10 mjcross

Looks good. Just the one typo pointed out by @lurch

peterharperuk avatar Oct 10 '25 09:10 peterharperuk

FYI #498 is where this example was first added.

lurch avatar Oct 10 '25 11:10 lurch

Thanks @peterharperuk and well spotted @lurch - fixed in my a23bca5. One of these days I'll manage to get a PR through without a typo 8-)

mjcross avatar Oct 10 '25 13:10 mjcross

If the dns query returns immediately then start_client() is called directly from main(); so shouldn't the call to mqtt_client_new() be protected? The lwIP implementation has LWIP_ASSERT_CORE_LOCKED

mjcross avatar Nov 13 '25 11:11 mjcross

With the greatest respect, although this example is very thorough it is also quite hard to follow. Might I suggest that In the spirit of the other examples it would be clearer to use global variables and move some of the work outside the callbacks?

mjcross avatar Nov 13 '25 12:11 mjcross

If the dns query returns immediately then start_client() is called directly from main(); so shouldn't the call to mqtt_client_new() be protected? The lwIP implementation has LWIP_ASSERT_CORE_LOCKED

Yes

peterharperuk avatar Nov 13 '25 12:11 peterharperuk

If you have suggestions for other improvements and fixes. I would suggest raising them as separate pull requests.

peterharperuk avatar Nov 13 '25 12:11 peterharperuk

If the dns query returns immediately then start_client() is called directly from main(); so shouldn't the call to mqtt_client_new() be protected? The lwIP implementation has LWIP_ASSERT_CORE_LOCKED

Yes

The code as stands also calls mqtt_client_is_connected(), which the lwIP code also has the CORE_LOCKED assertion. Not sure whether that's safe or not?

mjcross avatar Nov 13 '25 15:11 mjcross