diff --git a/vitepress/docs/src/custom/theme/index.ts b/vitepress/docs/src/custom/theme/index.ts
index 2e37651..8bedb14 100644
--- a/vitepress/docs/src/custom/theme/index.ts
+++ b/vitepress/docs/src/custom/theme/index.ts
@@ -48,7 +48,9 @@ const theme = {
{ text: "Introduction", link: "/firmware_guide/firmware" },
{ text: "Setup Visual Studio Code environment", link: "/firmware_guide/setup_vscode" },
{ text: "Configuring Firmware", link: "/firmware_guide/configure_firmware" },
- { text: "Getting Started", link: "/firmware_guide/upload_firmware" },
+ { text: "Upload Firmare", link: "/firmware_guide/upload_firmware" },
+ { text: "MDNS", link: "/firmware_guide/mdns" },
+ { text: "REST API", link: "/firmware_guide/rest_api" },
],
},
{
diff --git a/vitepress/docs/src/pages/firmware_guide/configure_firmware.md b/vitepress/docs/src/pages/firmware_guide/configure_firmware.md
index a613009..77f87ba 100644
--- a/vitepress/docs/src/pages/firmware_guide/configure_firmware.md
+++ b/vitepress/docs/src/pages/firmware_guide/configure_firmware.md
@@ -15,7 +15,21 @@ import { alerts } from '../../static/alerts'
-On lines 17 and 18 replace the placeholder text with your correct SSID (WiFi access point name), and password respectfully.
+Replace the placeholder text with your correct SSID (WiFi access point name), and password respectfully.
+
+::: info
+Special characters such as `!` and `@` are not supported. If you have a special character in your password or ssid, you will need to change it.
+
+Spaces are not supported either. If you have a space in either, you will need to change it.
+
+The firmware supports AP mode, but it is not recommended. If you are using AP mode, you will need to set the `enableadhoc` to `1`.
+
+Then, you will need to set the `ap_ssid` to the name of your AP, and `ap_password` to the password of your AP.
+
+You can choose to leave the `ap_ssid` and `ap_password` as defaults, but you will need to set the `enableadhoc` to `1`.
+
+Note, if you are enabling AP mode for both ESPs, you will need to set the `ap_ssid` and `ap_password` to different values for both ESPs. It is best to set AP mode only for one ESP, and leave the other ESP in STA mode. Connect the other ESP to the AP of the ESP in AP mode. Then connect your computer to the AP of the ESP in AP mode. This will allow you to connect to the ESP in AP mode, and the ESP in STA mode.
+:::
@@ -27,4 +41,48 @@ On lines 17 and 18 replace the placeholder text with your correct SSID (WiFi acc
Double check that you have correctly entered your WiFi credentials and that said wifi network has a 2.4GHz band.
+### Additonal configuration
+
+#### `mDNS`
+
+If you do not wish to manually keep track of the ESPs IP addresses and ports, you can enable the mDNS feature. This will allow you to connect to the ESPs using the following format: `http://.local`. This will only work if you are connected to the same network as the ESPs,and if you have enabled mDNS on your computer. If you are using Windows, you can enable mDNS by following [this guide](/firmware_guide/mdns.html).
+
+#### `OTA`
+
+The firmware supports OTA updates. This means that you can update the firmware without having to connect to the ESPs. To enable OTA updates, you will need to set the `enableota` to `1`. Then, you will need to set the `otapassword` to the password you wish to use to update the firmware. You will need to use this password to update the firmware. If you do not wish to use a password, you can set the `otapassword` to nothing. This will allow you to update the firmware without a password. However, this is not recommended, as anyone on your network will be able to update the firmware.
+
+You will also need to set the `otaserverip` to the IP address of the ESP you wish to update. This is the IP address of the ESP you wish to update. If you are using mDNS, you can use the mDNS name of the ESP you wish to update. For example, if you are updating the ESP with the dns set to `http://esp32.local`, you will need to set the `otaserverip` to `http://esp32.local`.
+
+#### `REST API`
+
+The firmware also supports a fully featured REST API. This means that you can control the ESPs using a REST API. This feature is enabled by defauly, and can not be turned off.
+
+This feature is used more for advanced users, and is not required for basic operation.
+
+The REST API was developed to be used by our new app (still in development). However, it can be used by any REST API client, you can not send POST requests to the ESPs using a browser though, so some REST API functionality can only be used by tools like [Thunder Client](https://www.thunderclient.com/) and [Postman](https://www.postman.com/).
+
+The full REST API is documented [here](/firmware_guide/rest_api.html).
+
+#### ´Environments´
+
+The firmware supports multiple environments. This means that we have full support for multiple types of esps. Each ESP is configured to be in a different environment. If you are using a different ESP, you will need to change the environment to the correct one. The environments are as follows:
+
+- `esp32AIThinker` - This is the default environment. This is for the ESP32-AI-THINKER.
+- `esp32Cam` - This is for the ESP32-CAM.
+- `esp32M5Stack` - This is for ESP32M5Stack.
+- `esp32WRover` - This is for the ESP32WRover.
+- `esp-eye` - This is for the ESP-EYE (not the S3 variant).
+
+Each environment has a `debug` and `release` configuration. The `debug` configuration is for debugging, and the `release` configuration is for production. The `debug` configuration is not recommended for production, as it will use more memory, and will be slower. However we recommend using the `debug` configuration for initial configuration and testing, as it will be easier to debug, for you and for us. Once you are confident that the firmware is working correctly, you can switch to the `release` configuration.
+
+The `debug` configuration will print out debug messages to the serial port. The `release` configuration will not print out debug messages to the serial port. This will save memory, and will make the firmware faster.
+
+The default configutration is `debug` for the `espAIThinker` environment. If you are using a different ESP, please follow the GIFs below to change the environment.
+
+
+
+::: tip Coming Soon
+We are working on a new app that will allow you to configure the firmware, flash the boards, and connect to Social VR Games using a GUI. This will make it easier to configure the firmware, and will allow you to configure the firmware without having to use/download `VSCode` or our `platformio` project. We are hard at work on this, but do not currently have a release date. Please check back frequently.
+:::
+
## [Now, move on to uploading the firmware](/firmware_guide/upload_firmware.html)
diff --git a/vitepress/docs/src/pages/firmware_guide/mdns.md b/vitepress/docs/src/pages/firmware_guide/mdns.md
new file mode 100644
index 0000000..031b976
--- /dev/null
+++ b/vitepress/docs/src/pages/firmware_guide/mdns.md
@@ -0,0 +1,47 @@
+# MDNS {.text-[#ab5ac7]}
+
+## What is it?
+
+`mDNS` is a protocol that allows you to connect to a device using a name instead of an IP address. This is useful if you do not know the IP address of the device, or if you do not want to keep track of the IP address of the device. This is also useful if you are using a device that does not have a static IP address.
+
+In the `mDNS` protocol the IP address of the device can change, but the name of the device will always be the same. This means that you can connect to the device using the name of the device, even if the IP address of the device changes.
+
+The name of the device is the name of the device followed by `.local`. For example, if the name of the device is `esp32`, you can connect to the device using `http://esp32.local`.
+
+## How to use it
+
+### Enable mDNS
+
+The `mDNS` is enabled by default on the new firmware, and can not be disabled.
+
+To use it,all you need to do is set the name of the device in the `platformio.ini` file.
+
+This setting can be located under the `[wifi]` section of the `platformio.ini` file.
+
+```ini
+mdnsname = "openiristracker" # do not add .local
+```
+
+By default, the name of the device is `openiristracker`, however you can change it to whatever you want.
+
+::: warning Change the name
+Since you have two ESP32 devices, you need to make sure that the name of the device is different for each device. If you do not change the name of the device, you will not be able to connect to both devices at the same time.
+:::
+
+### Connect to the device
+
+To connect to the device, you need to use the name of the device followed by `.local`. For example, if the name of the device is `esp32`, you can connect to the device using `http://esp32.local`.
+
+## Prerequisites `Bonjour`
+
+`Bonjour` is required to use the `mDNS` protocol _for windows and mac only_. If you are using Windows, you can download Bonjour from [here](https://support.apple.com/kb/DL999?locale=en_US). If you are using macOS, Bonjour is already installed.
+
+You can also get the fully tested Bonjour package from us [here](https://github.com/RedHawk989/EyeTrackVR/tree/GUI/GUI/assets/3rdParty) (for Windows only).
+
+## Troubleshooting
+
+### Can not connect to the device
+
+If you can not connect to the device, make sure that the name of the device is correct. If the name of the device is correct, make sure that the device is connected to the network.
+
+If the device is connected to the network, try to restart the device. If the device is still not connected, try to restart the router.
diff --git a/vitepress/docs/src/pages/firmware_guide/rest_api.md b/vitepress/docs/src/pages/firmware_guide/rest_api.md
new file mode 100644
index 0000000..8311d78
--- /dev/null
+++ b/vitepress/docs/src/pages/firmware_guide/rest_api.md
@@ -0,0 +1,143 @@
+# REST API {.text-[#ab5ac7]}
+
+## What is it?
+
+A REST API is a way to communicate with the ESP devices using HTTP requests. This is useful if you want to control the device from a computer or a mobile device.
+
+We developed a REST API for this project so that we can control the devices more easily from our new app.
+
+## How to use it
+
+### REST API Client
+
+Any REST API client can be used to communicate with the ESP devices. We recommend using [Thunder Client](https://www.thunderclient.com/) to test the REST API, as it's free and is a vscode extension.
+
+For basic `GET` requests, you can use your browser of choice.
+
+### Standard
+
+The REST API follows the following standard:
+
+´´´bash
+http://.local:81/control/command/?=&=
+´´´
+
+> For example, if the name of the device is `esp32`, you can connect to the device using `http://esp32.local:81/control/command/`.
+
+### Endpoints
+
+The REST API has the following endpoints:
+
+| Endpoint | Method | Description |
+| :------: | :----: | :---------: |
+| /ping | GET | Returns the status of the device. |
+| /save | GET | Writes any changes to the flash. |
+| /restartDevice | GET | Restarts the ESP itself. |
+| /restartCamera | GET | Restarts the camera. |
+| /resetConfig | GET | Clears the current config in memory and RAM |
+| /getStoredConfig | GET | Returns a _JSON_ object of the devices current config. |
+| /setTxPower | POST | Sets the Transmission Power of the ESPs |
+| /setDevice | POST | Sets the `OTA` and `mDNS` settings |
+| /setCamera | POST | Sets all of the wifi settings |
+| /wifi | POST | Adds a new wifi network, or writes over an existing one |
+| /wifi | DELETE | Deletes a wifi network |
+| /wifi | GET | Returns a _JSON_ object of all of the wifi networks |
+
+### Params
+
+The REST API has the following params:
+
+::: danger Feature not a bug
+All params for a given URL are required, even if you are not changing that params value.
+
+If you do not supply a param, that param will be set to default settings.
+:::
+
+URL params are passed in the URL as a query string, using the following format:
+
+`http://.local:81/control/command/?=&=`
+
+#### /wifi
+
+::: info Note
+We allow you to store up to 3 wifi networks in memory. If you try to add more than 3, the oldest network will be overwritten.
+:::
+
+| Param | Description |
+| :---: | :---------: |
+| `ssid` | The ssid of the network. |
+| `password` | The password of the network. |
+| `networkName` | The unique name (given by you) to refer to that network in memory. |
+| `channel` | The channel for the wifi network to broadcast on
only `1 - 14` are allowed. |
+| `power` | The Transmittion power of the ESP for that network config. |
+| `adhoc` | Whether to enable AP mode or not. |
+
+::: info Note - Transmission Power
+You must follow the following format for the `power` param:
+
+Using the following enum, you pass the _number_ to the right of the `=` sign that corresponds with the power in `dBm` that you wish to use.
+
+```cpp
+typedef enum {
+ WIFI_POWER_19_5dBm = 78,// 19.5dBm
+ WIFI_POWER_19dBm = 76,// 19dBm
+ WIFI_POWER_18_5dBm = 74,// 18.5dBm
+ WIFI_POWER_17dBm = 68,// 17dBm
+ WIFI_POWER_15dBm = 60,// 15dBm
+ WIFI_POWER_13dBm = 52,// 13dBm
+ WIFI_POWER_11dBm = 44,// 11dBm
+ WIFI_POWER_8_5dBm = 34,// 8.5dBm
+ WIFI_POWER_7dBm = 28,// 7dBm
+ WIFI_POWER_5dBm = 20,// 5dBm
+ WIFI_POWER_2dBm = 8,// 2dBm
+ WIFI_POWER_MINUS_1dBm = -4// -1dBm
+} wifi_power_t;
+```
+
+:::
+
+#### /setDevice
+
+| Param | Description |
+| :---: | :---------: |
+| `hostname` | The hostname for the ESP
used by `OTA` and `mDNS`. |
+| `service` | The service to look for when scanning `mDNS` devices on the network
this should be set to `openiristracker` in order to look for `EyeTrackVR` devices |
+| `ota_password` | The password for the `OTA` service. |
+| `ota_port` | The port for the `OTA` service. |
+| `firmware_name` | The name of the binary file for `OTA`
depricated and will be removed |
+
+#### /setTxPower
+
+::: info Note
+You must follow the following format for the `txPower` param:
+
+Using the following enum, you pass the _number_ to the right of the `=` sign.
+
+```cpp
+typedef enum {
+ WIFI_POWER_19_5dBm = 78,// 19.5dBm
+ WIFI_POWER_19dBm = 76,// 19dBm
+ WIFI_POWER_18_5dBm = 74,// 18.5dBm
+ WIFI_POWER_17dBm = 68,// 17dBm
+ WIFI_POWER_15dBm = 60,// 15dBm
+ WIFI_POWER_13dBm = 52,// 13dBm
+ WIFI_POWER_11dBm = 44,// 11dBm
+ WIFI_POWER_8_5dBm = 34,// 8.5dBm
+ WIFI_POWER_7dBm = 28,// 7dBm
+ WIFI_POWER_5dBm = 20,// 5dBm
+ WIFI_POWER_2dBm = 8,// 2dBm
+ WIFI_POWER_MINUS_1dBm = -4// -1dBm
+} wifi_power_t;
+```
+
+:::
+
+| Param | Description |
+| :---: | :---------: |
+| `txPower` | The power level to set. |
+
+### Camera Params
+
+::: tip Coming Soon
+We are currently working on this section of documentation.
+:::