All Projects → tuanpmt → react-native-mqttjs

tuanpmt / react-native-mqttjs

Licence: other
Pure javascript Websocket MQTT client library for react-native

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-mqttjs

modbus4mqtt
Modbus TCP <-> MQTT glue. YAML configuration. Robust.
Stars: ✭ 21 (-12.5%)
Mutual labels:  mqtt
tradfri-mqtt
Mirrors Trådfri gateways endpoints into MQTT and send commands to the gateway from MQTT
Stars: ✭ 26 (+8.33%)
Mutual labels:  mqtt
Farm-Data-Relay-System
A system that uses ESP-NOW, LoRa, and other protocols to transport sensor data in remote areas without relying on WiFi.
Stars: ✭ 97 (+304.17%)
Mutual labels:  mqtt
dlibox
Home automation that does not depend on the internet
Stars: ✭ 26 (+8.33%)
Mutual labels:  mqtt
mqttbeat
Elasticsearch beat to save messages received with the MQTT protocol.
Stars: ✭ 18 (-25%)
Mutual labels:  mqtt
ESPecial
ESP32 automation with web interface and telegram bot
Stars: ✭ 77 (+220.83%)
Mutual labels:  mqtt
spring-boot-protocol
springboot功能扩充-netty动态协议,可以支持各种网络协议的动态切换(单端口支持多个网络协议).支持mmap,sendfile零拷贝,http请求批量聚合
Stars: ✭ 68 (+183.33%)
Mutual labels:  mqtt
asgi-mqtt
Interface between MQTT and ASGI
Stars: ✭ 34 (+41.67%)
Mutual labels:  mqtt
pioreactor
Hardware and software for accessible, extensible, and scalable bioreactors. Built on Raspberry Pi.
Stars: ✭ 28 (+16.67%)
Mutual labels:  mqtt
asyncio-mqtt
Idomatic asyncio wrapper around paho-mqtt
Stars: ✭ 137 (+470.83%)
Mutual labels:  mqtt
chat21-ionic
A ionic v5 and Angular 8 desktop and mobile chat
Stars: ✭ 69 (+187.5%)
Mutual labels:  mqtt
metermon
Dockerized rtlamr wrapper that outputs formatted JSON messages over mqtt
Stars: ✭ 19 (-20.83%)
Mutual labels:  mqtt
Process-Simulator-2-OpenSource
Open source code of Process Simulator 2
Stars: ✭ 20 (-16.67%)
Mutual labels:  mqtt
WeConnect-mqtt
MQTT Client that publishes data from Volkswagen WeConnect
Stars: ✭ 14 (-41.67%)
Mutual labels:  mqtt
meshquitto
A simple Arduino project, which aims to provide a gateway between a mesh network of ESP8266's and a remote MQTT broker.
Stars: ✭ 37 (+54.17%)
Mutual labels:  mqtt
roataway-web
Roataway web site
Stars: ✭ 15 (-37.5%)
Mutual labels:  mqtt
AndrOBD-Plugin
AndrOBD plugin development project
Stars: ✭ 38 (+58.33%)
Mutual labels:  mqtt
mqtt-to-kafka-bridge
Move your messages from MQTT to Apache Kafka in real-time 🚀
Stars: ✭ 21 (-12.5%)
Mutual labels:  mqtt
emqx-rule-engine
EMQ X Rule Engine
Stars: ✭ 63 (+162.5%)
Mutual labels:  mqtt
as3MQTT
📢 Pure Action Script 3 that implements the MQTT (Message Queue Telemetry Transport) protocol, a lightweight protocol for publish/subscribe messaging.
Stars: ✭ 21 (-12.5%)
Mutual labels:  mqtt

react-native-mqttjs

Features

This is 100% Pure javascript Websocket MQTT client library without any dependencies for react-native, use original react-native Websocket, port from: MQTT client library for Contiki - Prefer for any IoT Mobile applications using react-native

Support subscribing, publishing, authentication, will messages, keep alive pings and all 3 QoS levels (it should be a fully functional client).

Sampe as esp_mqtt for ESP8266 chip and should replace for react-native-mqtt

Install

npm i react-native-mqttjs --save

Basic usage

import { MqttClient } from 'react-native-mqttjs';

var mqtt = new MqttClient();
mqtt.connect('ws://test.mosquitto.org:8080');

mqtt.subscribe({'/topic1': 0}, () => {
  console.log('subscribe success topic1 with qos 0');
});
mqtt.subscribe([{'/topic2': 1}, {'/topic3': 2}], () => {
  console.log('subscribe success topic2 with qos 1, topic3 with qos 2');
});

mqtt.publish('/topic1', 'test', {qos: 0, retain: 0}, () => {
  console.log('publish success');
});

mqtt.addListener('message', (topic, data) => {
  console.log('data arrived, topic: ' + topic + ' - data: ' + data);
});

mqtt.addListener('connect', () => {
  console.log('mqtt connected');
});

API

  • Options:
    • keepalive: 120 seconds
    • reschedulePings: reschedule ping messages after sending packets (default true)
    • clientId: 'mqttjs_' + Math.random().toString(16).substr(2, 8)
    • protocolId: 'MQTT' or 'MQIsdp'
    • clean: true, set to false to receive QoS 1 and 2 messages while offline
    • reconnectPeriod: 1000 milliseconds, interval between two reconnections
    • connectTimeout: 30 * 1000 milliseconds, time to wait before a CONNACK is received
    • username: the username required by your broker, if any
    • password: the password required by your broker, if any
    • will: a message that will sent by the broker automatically when the client disconnect badly. The format is:
      • topic: the topic to publish
      • payload: the message to publish
      • qos: the QoS
      • retain: the retain flag

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].