Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions firmware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

## Getting started

- https://platformio.org/
- esp8266 01
- [Ardiono IDE](https://www.arduino.cc/en/software)
- Install [WiFi Manager](https://github.com/tzapu/WiFiManager)
- Add the [Arduino core for ESP8266](https://github.com/esp8266/Arduino)

```
pio run

# OTA Upgrade
pip run -t upload --upload-port IP_ADDR_HERE
```
Open up firmware.ini in the Arduino IDE and build / upload to your device
22 changes: 13 additions & 9 deletions firmware/src/main.cpp → firmware/firmware.ino
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
// WebSerial Firmware

#include <ESP8266WiFi.h>
#include <WiFiManager.h>
#include <ArduinoOTA.h>

WiFiClient client;
WiFiManager wifiManager;

// Configuration Variables
const char* ssid = "____"; // The SSID of your WiFi network
const char* password = "_____"; // The passphrase of your WiFi network
const char* endpoint = "_____"; // The endpoint on your network for it to connect to (IP Address of your server)
const char* endpoint;
const int port = 8888;

void setup() {
Serial.begin(115200);

WiFi.begin(ssid, password);
WiFi.setAutoReconnect(true);
WiFi.persistent(true);
WiFiManagerParameter webserial_endpoint("webserial_endpoint", "webserial endpoint", "192.168.X.X", 64);
wifiManager.addParameter(&webserial_endpoint);
wifiManager.autoConnect("WebSerial-Provisioning", "webserial");

while (WiFi.status() != WL_CONNECTED){
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}

if(client.connect(endpoint, port)) {
endpoint = webserial_endpoint.getValue();

if (client.connect(endpoint, port)) {
client.print(WiFi.macAddress());
client.print(WiFi.localIP());
delay(500);
Expand Down Expand Up @@ -51,7 +55,7 @@ void loop() {
}

if (!client.connected()) {
if(client.connect(endpoint, port)) {
if (client.connect(endpoint, port)) {
client.print(WiFi.macAddress());
client.print(WiFi.localIP());
delay(500);
Expand Down
9 changes: 0 additions & 9 deletions firmware/platformio.ini

This file was deleted.