https://github.com/coditva/switchboard
A wifi switchboard
https://github.com/coditva/switchboard
Last synced: 8 months ago
JSON representation
A wifi switchboard
- Host: GitHub
- URL: https://github.com/coditva/switchboard
- Owner: coditva
- License: mit
- Created: 2020-11-08T14:51:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-29T09:56:05.000Z (about 5 years ago)
- Last Synced: 2025-05-20T10:45:13.861Z (9 months ago)
- Language: Lua
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# switchboard
A wifi switchboard based on NodeMCU (ESP8266)
## Usage
Wire up GPIO pins of NodeMCU D0 to D7 to relay module inputs.
Change `config.lua` to configure the switch names, access point SSID and password and local hostname.
Upload the files to NodeMCU flash and start it up!
If everything goes well, you should see an access point available with the SSID you configured. There will be a server available which provides this API:
#### `GET` 192.168.4.1
Returns the status of the device:
```json
{
"status": "ok"
}
```
#### `GET` 192.168.4.1/:id
Returns the state of the switch wired to the pin corresponding to the `id` (as specified in `config.lua`).
```json
{
"state": 0
}
```
#### `POST` 192.168.4.1/:id
Toggles the state of the switch wired to the pin corresponding to the `id` (as specified in `config.lua`).
```json
{
"state": 1
}
```
**Note: You can also use `http://switchboard.local` (or whatever hostname you configured in `config.lua`) in place of `192.168.4.1`.**