-
Notifications
You must be signed in to change notification settings - Fork 2.1k
net: add Asymcute, an asynchronous MQTT-SN client implementation #9464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bf8f8df
net/sock_udp: add sock_udp_ep_equal()
haukepetersen ed01bf0
net: add header with generic MQTT-SN defines
haukepetersen ad20c4f
net: add Asymcute (asynchronous MQTT-SN client)
haukepetersen fb184a3
sys/auto_init: add init for asymcute
haukepetersen 901ec82
examples: add asymcute_mqttsn example application
haukepetersen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # name of your application | ||
| APPLICATION = asymcute_mqttsn | ||
|
|
||
| # If no BOARD is found in the environment, use this default: | ||
| BOARD ?= native | ||
|
|
||
| # This has to be the absolute path to the RIOT base directory: | ||
| RIOTBASE ?= $(CURDIR)/../.. | ||
|
|
||
| # Not all boards have enough memory to build the default configuration of this | ||
| # example... | ||
| BOARD_INSUFFICIENT_MEMORY := airfy-beacon chronos hifive1 microbit msb-430 \ | ||
| msb-430h nrf51dongle nrf6310 nucleo-f030r8 \ | ||
| nucleo-f031k6 nucleo-f042k6 nucleo-f070rb \ | ||
| nucleo-f072rb nucleo-f303k8 nucleo-f334r8 \ | ||
| nucleo-l031k6 nucleo-l053r8 stm32f0discovery \ | ||
| telosb wsn430-v1_3b wsn430-v1_4 yunjia-nrf51822 z1 | ||
|
|
||
| # Include packages that pull up and auto-init the link layer. | ||
| # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present | ||
| USEMODULE += gnrc_netdev_default | ||
| USEMODULE += auto_init_gnrc_netif | ||
| # Specify the mandatory networking modules for IPv6 and UDP | ||
| USEMODULE += gnrc_sock_udp | ||
| USEMODULE += gnrc_ipv6_default | ||
| # Include MQTT-SN | ||
| USEMODULE += asymcute | ||
| # Add also the shell, some shell commands | ||
| USEMODULE += shell | ||
| USEMODULE += shell_commands | ||
| USEMODULE += ps | ||
| # For testing we also include the ping6 command and some stats | ||
| USEMODULE += gnrc_icmpv6_echo | ||
|
|
||
| # Comment this out to disable code in RIOT that does safety checking | ||
| # which is not needed in a production environment but helps in the | ||
| # development process: | ||
| DEVELHELP ?= 1 | ||
|
|
||
| # Change this to 0 show compiler invocation lines by default: | ||
| QUIET ?= 1 | ||
|
|
||
| include $(RIOTBASE)/Makefile.include | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| ## About | ||
| This example application demonstrates the usage of the `Asymcute` MQTT-SN client | ||
| library. It provides a number of shell commands that can be used to trigger | ||
| selected procedures like connecting to a gateway, registration and subscription | ||
| of topics, and publishing of data. | ||
|
|
||
| ## Setup | ||
| For this application to do anything useful, a running MQTT-SN gateway is needed. | ||
| If you don't have access to one, RIOT provides a simple way to start one locally | ||
| by providing a dedicated `rsmb` make target, type: | ||
| ``` | ||
| make rsmb | ||
| ``` | ||
|
|
||
| This will download, build, and run the Eclipse Mosquitto.rsmb 'Really Small | ||
| Message Broker' [(found here)](https://github.com/eclipse/mosquitto.rsmb). | ||
|
|
||
| ## Usage | ||
| Simply type | ||
| ``` | ||
| help | ||
| ``` | ||
| for a list of available commands. | ||
|
|
||
| ## NOTE 1 | ||
| The UDP socket handling for IPv6 based endpoints in the `Mosquitto.rsmb` | ||
| implementation is buggy when it comes to handling link local addresses, | ||
| as the implementation does not remember the interface on which data comes in, | ||
| hindering it from sending out any responses. | ||
|
|
||
| Quick workaround: simply use global addresses | ||
|
|
||
| ## NOTE 2 | ||
| It also seems that the `Mosquitto.rsmb` implementation has a bug when it comes | ||
| to subscribing to topics: if a topic name was formerly registered and the same | ||
| topic name is later used for issuing a subscription request, the gateway will | ||
| assign a new topic ID to the same topic name, so publish messages to the | ||
| initially assigned topic ID will not be seen by that subscription. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't there some bootstrapping missing here?discussed offline. No: would cause mayhemThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what kind of bootstrapping do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of the broker.