feat: add env and ota details

This commit is contained in:
ZanzyTHEbar 2023-03-05 20:46:34 +00:00
parent e821b0aff0
commit 195dfe98b3
4 changed files with 104 additions and 15 deletions

View File

@ -48,6 +48,7 @@ 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: "Firmware Environments", link: "/firmware_guide/environments" },
{ text: "Upload Firmare", link: "/firmware_guide/upload_firmware" },
{ text: "MDNS", link: "/firmware_guide/mdns" },
{ text: "REST API", link: "/firmware_guide/rest_api" },

View File

@ -0,0 +1,62 @@
# Firmware Environments {.text-[var(--font-accent)]}
## What is it?
A firmware environment is a way to store the custom firmware config for a specific device. This is useful if you want to have multiple devices with different firmware configs.
We use environments to store the firmware config for each device, so that you can easily switch between them.
Envrionments are broken up into two distinct parts:
- The `build type` (e.g. `debug`, `release`)
- The `board type` (e.g. `espaithinker`, `esp32cam`)
## Build Types
We now have a couple of options letting us decide how we want to build the firmaware.
- `Debug` - Has a lot of logging, useful for getting everything setup for the first time and to see what is going on.
The debug environment is the default environment, so you don't need to specify it when building.
All debug environments are the default board environments, only `OTA` and `release` are specified in the name.
::: tip Tip
We recommend starting with a debug environment, and then switching to release once everything is working.
:::
- `Release` - Has a lot less debugging, may also be missing some things availible only in debug for debug purposes, this should be flashed when everything is working.
- `OTA` - Just like release, but it will upload your firmware to your esp wirelessly.
::: warning Warning
You need to change the IP to which board we should upload to, the setting is called the `otaserverip` and can be found in the `user_config.ini` file.
The `otaserverip` setting supports both `IPv4` and `mDNS` names, as long as the `mDNS` name is resolvable on your network (i.e: you have bonjour installed on your computer).
You can also change the port and password, but it's not recommended.
:::
## Board Types
We currently support a few different boards, and we are working on adding more.
::: warning Warning
It is important to note that the `esp32AIThinker` environment is the default environment, and will work for the vast majority of users. Do not switch your environment unless you know what you are doing, and have tested the default environment first, and verified that it does not work for you.
Most esp32Cams from Aliexpress will work with the `esp32AIThinker` environment, but some may require the `esp32cam` environment. Test the default environment first, and if it does not work, try the `esp32cam` environment.
:::
Currently supported boards:
- `esp32AIThinker` - The ESP32 Ai Thinker.
- `esp32cam` - The ESP32 Camera.
- `esp_eye` - The Non-Esp32S3 version of the ESP-EYE camera.
- `esp32M5Stack` - The ESP32 M5Stack camera.
- `wrover` - The ESP32 WRover (Non-ESP32-S3 variant).
::: tip Coming Soon
- `esp32s3cam` - The ESP32-S3 Camera boards.
:::

View File

@ -7,11 +7,11 @@ import { alerts } from '../../static/alerts'
# Building and uploading the firmware manually {.text-[var(--font-accent)]}
Uploading your firmware must initially be done over cable. Once you have the tracker connected to your WiFi after your first firmware update, you can opt to use OTA in the future.
Uploading your firmware must initially be done over cable. Once you have the tracker connected to your WiFi after your first firmware update, you can opt to use [OTA](#how-do-i-use-it) in the future.
## 1. Connect your tracker to your PC via the programmer
First, connect your ESP32-Cam to your programmer. In the case of the ESP32-Cam-MB board, it's as simple as sticking it into the socket the way it came in the package and then connecting it to your PC with a micro-USB cable. In some cases, there is a button labeled IOO on the programmer. If that button exists make sure to hold it in while you plug the programmer into your pc, once plugged in you can release the button.
First, connect your ESP32-Cam to your programmer. In the case of the ESP32-Cam-MB board, it's as simple as sticking it into the socket the way it came in the package and then connecting it to your PC with a micro-USB cable. In some cases, there is a button labeled `IOO` on the programmer. If that button exists make sure to hold it in while you plug the programmer into your pc, once plugged in you can release the button.
In the case of an FTDI programmer, the steps aren't as easy, so grab [this guide](https://randomnerdtutorials.com/program-upload-code-esp32-cam/) for how to set it up.
@ -19,13 +19,13 @@ In the case of an FTDI programmer, the steps aren't as easy, so grab [this guide
1. Press the build button at the bottom of Visual Studio Code.
This builds the firmware, but does not send it to the ESP yet.
> This builds the firmware, but does not send it to the ESP yet.
![img](https://i.imgur.com/EmSkhFp.png)
![img](https://i.imgur.com/EmSkhFp.png)
## 3. Upload your firmware
- If you are using the OTA method, first make sure the tracker you wish to flash is turned on.
- If you are using the OTA method, first make sure the tracker you wish to flash is turned on and connected to your network, then skip to the [OTA section below](#how-do-i-use-it).
- Once the firmware has been built, press the upload button to upload the firmware.
@ -57,22 +57,47 @@ Additionally, this can be caused by software hogging COM ports (**VSCode and Cur
## Uploading via OTA
### What is it?
OTA stands for `Over The Air`, and it is a way to update your firmware without having to connect your device to your computer.
### How do I use it?
To use OTA, you need to have working firmware on your ESPs first.
Once you have mnually flashed the firmware at least once, you can use the `OTA` environment to upate your ESPs.
::: tip Coming Soon
Currently, we only support OTA using `platformio` and `Visual Studio Code`. We are working on a new app, where you can upload your firmware to your ESPs over WiFi straight from the app.
:::
To do this, you need to change your environment to the `OTA` version of your working environment.
For example, if you have a working `esp32AIThinker` environment, you would change your environment to `esp32AIThinker_OTA`.
Once you have changed your environment, you can upload your firmware to your ESPs using the upload button, as you would normally.
Once you have successfully connected your trackers to your WiFi, you can use OTA to handle all future firmware updates.
1. Retrieve the IP of the tracker you wish to flash. The IP can be found through network monitoring applications, or by viewing tracker output in a serial monitor.
2. In `platformio.ini` file uncomment the following lines in Visual Studio Code by removing the `;`:
1. Retrieve the IP or mDNS name of the tracker you wish to flash. The IP can be found through network monitoring applications, or by viewing tracker output in a serial monitor.
2. In the `ini/user_config.ini` file:
- Put IP or hostname of device into config file
```ini
;upload_protocol = espota
;upload_port = 192.168.1.49
[ota]
enableota = 1
otaserverip = "openiristrackerL.local" # here we use a custom mDNS name
otapassword = "12345678"
otaserverport = 3232
```
1. Change the value of upload_port to the IP address retrieved during the first step.
1. Turn the tracker you wish to flash off and then on again.
1. Wait around 5 seconds.
1. Press the upload button to upload the firmware.<br>
3. Change to OTA env
4. Restart the ESPs, they **_must_** be power cycled
5. Press the upload button to upload the firmware.<br>
![img](https://i.imgur.com/lI3PFVC.png)
1. Repeat for as many trackers as you need.
6. Do not touch esps or move them during OTA upload
7. Wait around 1 minute.
8. Repeat for as many trackers as you need.
## Finding the IP address of your tracker

View File

@ -6,11 +6,12 @@ const Completed: IDevRoadMap = {
{ label: 'Tracking algorithm' },
{ label: 'Calibration' },
{ label: 'GUI' },
{ label: 'PCB Designfor IR emitters' },
{ label: 'PCB Design for IR emitters' },
{ label: 'Dual Eye support' },
{ label: 'Firmware' },
{ label: 'Better documentation over things (setup, wiring etc.)' },
{ label: 'Setup dynamic WiFi credentials at runtime' },
{ label: 'OTA using Platformio' },
]
}