Skip to content

Conversation

@mjcross
Copy link
Contributor

@mjcross mjcross commented Oct 2, 2025

  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

Martin Crossley added 2 commits October 2, 2025 21:18
Renamed README to README.md to improve how it renders in an IDE and when
browsing the online repository. Improved the example description to
clarify why the temperature updates might appear unexpectedly sporadic
to the user; and document how to read the current led status.
@peterharperuk
Copy link
Contributor

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

@lurch
Copy link
Contributor

lurch commented Oct 10, 2025

FYI #498 is where this example was first added.

@mjcross
Copy link
Contributor Author

mjcross commented Oct 10, 2025

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-)

Note that start_client() may be called direct from main() - i.e. not in a callback
@mjcross
Copy link
Contributor Author

mjcross commented Nov 13, 2025

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
Copy link
Contributor Author

mjcross commented Nov 13, 2025

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?

@peterharperuk
Copy link
Contributor

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
Copy link
Contributor

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

@mjcross
Copy link
Contributor Author

mjcross commented Nov 13, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants