https://github.com/seenkid/mqtt-to-db
script that allows you to record data retrieved from an MQTT server into a MySQL database. Need to create your own MQTT server ? -->
https://github.com/seenkid/mqtt-to-db
database mqtt mysql nodejs
Last synced: 3 months ago
JSON representation
script that allows you to record data retrieved from an MQTT server into a MySQL database. Need to create your own MQTT server ? -->
- Host: GitHub
- URL: https://github.com/seenkid/mqtt-to-db
- Owner: SeenKid
- Created: 2025-03-17T12:52:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-17T13:02:26.000Z (over 1 year ago)
- Last Synced: 2025-03-17T13:47:55.727Z (over 1 year ago)
- Topics: database, mqtt, mysql, nodejs
- Language: JavaScript
- Homepage: https://croustycloud.fr/
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
`mqtt-to-db` is a Node.js script that allows you to record data retrieved from an MQTT server into a MySQL database. This project is ideal for IoT applications that require data persistence in a relational database. I use it for OwnTracks.
## Features
- Connect to an MQTT server to receive messages.
- Store MQTT messages in a MySQL database.
- Use Winston for logging events and errors.
## Prerequisites
- Node.js (version 14 or higher)
- An accessible MQTT server
- A configured MySQL database
## Installation
1. Clone this repository:
```bash
git clone https://github.com/SeenKid/mqtt-to-db.git
cd mqtt-to-db
```
2. Install the dependencies:
```bash
npm i
```
## Configuration
Edit the `index.js` file to fill the missing database and mqtt broker credentials.
## Launch
node index.js