Skip to content

tailucas/switch-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License

About The Project

See my write-up on IoT with Mongoose OS. Here you can find a brief write-up about my projects based on Mongoose OS and my general experience with this IoT platform.

This is a Mongoose OS project containing a configuration template and code written in the so-called minimal JavaScript or mJS.

How it works

If you have ever used a smart switch this project does basically the same thing, but responds to messages sent over MQTT. If you were to try something like this yourself, I would recommend looking at platforms that make this work a more compatible out the box with other automation frameworks such as Tasmota.

Basic operation

At startup, GPIO channels are initialized and a timer is enabled to publish heartbeat messages. Using the configured topic paths, an MQTT client is created to receive control JSON-encoded control messages and then respond with the latest switch state. Switch state changes update globals which are used in MQTT message responses and heartbeats because GPIO channel states could not be read with the GPIO channels in OUTPUT mode.

(back to top)

Built With

Technologies that help make this project useful:

Espressif Mongoose OS MQTT

(back to top)

Getting Started

Here is some detail about the intended use of this project.

Prerequisites

Your development environment needs to have the mos tool available to build firmware binaries and for first-time configuration of the device. Mongoose OS has a good getting started guide with installation instructions.

(back to top)

Usage

The Mongoose OS documentation provides a detailed but concise instruction on how to use the mos tool to build the binaries that can then either be flashed directly to a USB-connected IoT device or that can be uploaded to the mDash site and delivered as an OTA update.

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Acknowledgments

(back to top)

Hits

Releases

No releases published

Packages

No packages published