Skip to content

Instantly share code, notes, and snippets.

View smartraysam's full-sized avatar

Adeseluka Toba Samuel smartraysam

View GitHub Profile
@smartraysam
smartraysam / app_mqtt_mysql_completed.js
Created February 28, 2021 13:12 — forked from smching/app_mqtt_mysql_completed.js
Node.js application: Store messages from Mosquitto MQTT broker into SQL Database (completed)
var mqtt = require('mqtt'); //https://www.npmjs.com/package/mqtt
var Topic = '#'; //subscribe to all topics
var Broker_URL = 'mqtt://192.168.1.123';
var Database_URL = '192.168.1.123';
var options = {
clientId: 'MyMQTT',
port: 1883,
//username: 'mqtt_user',
//password: 'mqtt_password',