https://github.com/graboskyc/mqtttorealm
A c# console app to act as MQTT broker and write messages to MongoDB Realm
https://github.com/graboskyc/mqtttorealm
mongodb mongodb-atlas mongodb-atlas-search search tika
Last synced: 3 months ago
JSON representation
A c# console app to act as MQTT broker and write messages to MongoDB Realm
- Host: GitHub
- URL: https://github.com/graboskyc/mqtttorealm
- Owner: graboskyc
- Created: 2021-03-30T02:04:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-20T19:57:00.000Z (over 4 years ago)
- Last Synced: 2023-03-23T22:01:55.348Z (over 2 years ago)
- Topics: mongodb, mongodb-atlas, mongodb-atlas-search, search, tika
- Language: C#
- Homepage:
- Size: 116 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MQTTtoRealm
This is a simple proof of concept to act as a middleware console app to take in IOT sensor data via MQTT (act as a broker) and write those messages into MongoDB Atlas using Realm Sync.
# Setup
## Pre Reqs
* Deploy an Atlas Cluster
* Deploy a Realm App on that cluster
* Have docker installed
* Have a MQTT load generator such [as mine](https://github.com/graboskyc/MQTTProducer) or [my mobile](https://github.com/graboskyc/MQTTProducer-Android)
## Realm Setup
* Turn on Sync Developer Mode
* Choose the cluster you deployed earlier as the sync target cluster
* Database is `realmvr`
* Schema is in the `Realm` folder of this repo
* Turn on API Key authentication
* Generate an API Key## Code Setup
* Clone this repo onto a server
* make a .env file: `cp sample.env .env`
* Edit the .env and replace the values with that of your Realm App ID and the API Key you generated in the previous step
* Run `./build.sh` which will start the docker container for you using the above variables## One time initial setup
* If this is the first time running, go back into Realm after the container starts, and disable developer mode
* Disable the anonymous authentication
* In the Atlas cluster you should now see a new DB as setup in the Realm Setup step with a new collection called `realmvr` and a JSON Schema has been applied to it in Realm.
* Restart your docker container## Execution
* Point your MQTT clients I mentioned above at this now running MQTT broker# Screenshots
