Skip to content

rochimensi/mqtt-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MQTT PoC using Mosca.js

MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol.

It was designed as an extremely lightweight publish/subscribe messaging transport.

It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium.

MQTT messaging protocol:

diagram

Prerequisites

  • Install Mosca globally: npm install mosca pino -g
  • Install Client dependencies: npm install

Run unauthorized Mosca broker

Run mosca -v | pino

Mosca Authorization & Authentication

https://github.com/mcollina/mosca/wiki/Mosca-as-a-standalone-service.#authorization

Run the broker with: mosca -v --credentials ./credentials.json | pino

Run the client with environment variables for username and password.

Run Client

Run the client with node index.js, setting environment variables if needed for Mosca authentication.

Extra details..

https://github.com/mqttjs/MQTT.js#connect

About

MQTT Client PoC using Mosca.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published