Giter Club home page Giter Club logo

mqtt-sn-slip's Introduction

No Network MQTT-SN Demo

Simplest possible MQTT-SN client demo for MCUs without any network interface. MCU sends MQTT-SN "quick publish" (QoS -1) packets over a serial (SLIP) connection.

Tested on STM32F103C8 (aka the "Blue Pill") but should be easily portable to any board supported by the Arduino library.

Build

This project uses PlatformIO for building.

Connect your Pill to an ST-LINK and run:

$ pio run -t upload

You can configure some options in include/app_config.h and platformio.ini files.

Wiring

  1. Default: just use Pill's native USB as a SLIP interface.

  2. Using Serial1 and Serial2 (must be enabled in platformio.ini)

  • SLIP TX = PA9
  • SLIP RX = PA10
  • DBG TX = PA2
  • DBG RX = PA3

Running

Connect your Pill USB to a Linux computer and run:

$ sudo slattach -L -s 115200 -p slip -d /dev/ttyACM0

And in another terminal:

$ sudo ifconfig sl0 192.168.100.1 dstaddr 192.168.100.2
$ ping 192.168.100.2

The LED on the pill should blink with every received packet. Pill detects the echo request packets but does not send echo reply so you will see "100% packet loss" in ping, that's ok.

If everything went well, you can start an MQTT-SN gateway (e.g. this one ) on 1883/udp, configure predefined topic 1 and you should see Hello! messages sent by the Pill on the configured topic.

mqtt-sn-slip's People

Contributors

mprymek avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

szf2020

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.