mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
de3241e90f
18962: pkg/lwip: Force loglevel when using log module r=maribu a=yarrick 18999: Paho: Allow building for 8 and 16 bit platforms r=maribu a=OlegHahm ### Contribution description Providing a patch to Paho upstream which uses fixed size integers (int32_t) instead of plain int whenever it is used to represent a size of an object. This patch will allow to build the Paho package for platforms where an integer has a width of less than 32 bit. This patch is also provided as a PR to the upstream version of Paho (https://github.com/eclipse/paho.mqtt.embedded-c/pull/238) but unfortunately the upstream seems to be unmaintained. ### Testing procedure Build for a 8 or 16 bit platform that has enough memory for the example, e.g., https://api.riot-os.org/group__boards__atxmega-a1u-xpro.html: BUILD_IN_DOCKER=1 BOARD=atxmega-a1u-xpro make clean all Without this PR this build will fail, with the patches applied it will succeed. ### Issues/PRs references This PR makes #18997 obsolete and thus reverts the change. 19034: boards/nucleo-l496zg: doc improvement r=maribu a=krzysztof-cabaj ### Contribution description This PR adds to nucleo-l496zg documentation MCU table - similar to those, for example for, Nucleo F103RB, F302R8 or F446RE. ### Testing procedure ``` make doc xdg-open doc/doxygen/html/group__boards__nucleo-l496zg.html ``` ### Issues/PRs references None Co-authored-by: Erik Ekman <eekman@google.com> Co-authored-by: Oleg Hahm <oleg@hobbykeller.org> Co-authored-by: krzysztof-cabaj <kcabaj@gmail.com> |
||
---|---|---|
.. | ||
main.c | ||
Makefile | ||
Makefile.board.dep | ||
Makefile.ci | ||
Makefile.gnrc | ||
Makefile.lwip | ||
README.md |
About
This application demonstrates the usage of the Eclipse paho MQTT package in RIOT.
Setup
For using this example, two prerequisites have to be fulfilled:
-
You need a running MQTT broker like Mosquitto broker for example. Take a look at Mosquitto Broker. Check online any guide that will help you setting up the broker into some port (a). For example this one for debian base linux users How to setup a Mosquitto MQTT Server and receive data.
-
Your RIOT node needs to be able to speak to that broker at the same port you set in 1.
Setting up RIOT native
on Linux
- Run
sudo ./dist/tools/tapsetup/tapsetup -c 1
Running the example
-
Run on RIOT's root directory:
make -C examples/paho-mqtt all term
-
To connect to a broker, use the
con
command:
con <broker ip addr> [port] [clientID] [user] [password] [keepalivetime]
- broker ip addr: IPv6 or IPv4 broker address.
- port: broker port. Default 1883
- client ID: is the client id you set up on the broker. Default can be set through DEFAULT_MQTT_CLIENT_ID in your makefile. Otherwise is an empty string.
- user: the one set in the broker, check online tutorial to do it regarding chosen broker. Default user can be set through DEFAULT_MQTT_USER in your makefile. Otherwise is an empty string.
- password: the one set in the broker, check online tutorial to do it regarding chosen broker. Default user can be set through DEFAULT_MQTT_PWD in your makefile. Otherwise is an empty string.
- keepalivetime: keep alive in seconds for your client. Default 10 secs.
- To subscribe to a topic, run
sub
with the topic name as parameter and a QoS level between 1 to 3, e.g.
sub hello/world 2
- To unsubscribe to a topic, run
unsub
with the topic name e.g.
unsub hello/world
- For publishing, use the
pub
command with a QoS level between 1 to 3:
pub hello/world "One more beer, please." 2