Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mongoose-os-apps/losant-mqtt
Losant + Mongoose OS example
https://github.com/mongoose-os-apps/losant-mqtt
esp32 esp8266 gpio hardware iot javascript losant mongoose-os mqtt
Last synced: 2 months ago
JSON representation
Losant + Mongoose OS example
- Host: GitHub
- URL: https://github.com/mongoose-os-apps/losant-mqtt
- Owner: mongoose-os-apps
- License: other
- Created: 2017-08-22T12:35:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-20T19:03:17.000Z (over 4 years ago)
- Last Synced: 2024-07-31T21:52:57.591Z (5 months ago)
- Topics: esp32, esp8266, gpio, hardware, iot, javascript, losant, mongoose-os, mqtt
- Language: JavaScript
- Size: 268 KB
- Stars: 3
- Watchers: 7
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mongoose-os - losant-mqtt - Losant + Mongoose OS example (Awesome Mongoose OS [![Awesome](https://awesome.re/badge.svg)](https://awesome.re) / Official Examples)
README
# Losant + Mongoose OS Example
This is an example Mongoose OS app that connects to Losant via MQTT.
## Tested Hardware
- ESP8266
- ESP32## Installation & Flashing
Before beginning, you must have the `mos` tool installed. For more info, see the mos [installation instructions](https://mongoose-os.com/docs/quickstart/setup.html).
1. First, clone the losant app
```
$ git clone https://github.com/mongoose-os-apps/losant-mqtt
```2. Build the firmware: (esp8266 or esp32)
```
$ mos build --arch esp8266
```3. Flash the device: (esp8266 or esp32)
```
$ mos flash
```4. Configure WiFi:
```
mos wifi WIFI_SSID WIFI_PASSWORD
```
You must replace the following values:
- WIFI_SSID
- WIFI_PASSWORD5. Login to Losant service. Create and app and
credentials for your device:![](shot1.png)
5. Configure MQTT connection to Losant:
```
mos config-set mqtt.client_id=LOSANT_DEVICE_ID \
mqtt.user=LOSANT_ACCESS_KEY \
mqtt.pass=LOSANT_ACCESS_SECRET
```You obtain the `LOSANT_DEVICE_ID`, `LOSANT_ACCESS_KEY`, and `LOSANT_ACCESS_SECRET` values from [Losant](www.losant.com).
6. To stream logs to the terminal:
```
$ mos console
```7. Press "Flash" button to trigger data sending:
```
$ mos
```8. Switch back to Losant page, watch data graph:
![](shot2.png)