## Web installer

You can now install the BTClock firmware directly from your browser (only Chrome/Chromium and Microsoft Edge for now) using https://btclock.store/web-flasher/

The first time you have to put the S3 mini in to boot mode:
Press both buttons at the same time (RST/BOOT), then first release the RST button and then the boot button.

## Build and compile

**NOTE**: The instructions below are for V2, V3 is available and highly recommended over V2. We will update the instructions soon.

To do this we need [Visual Studio Code](https://code.visualstudio.com/Download), [node.js](https://nodejs.org/en/download) and [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable). 

Also you will need the [PlatformIO IDE for Visual Studio Code](https://platformio.org/install/ide?install=vscode)

Please follow the installation instructions before you continue. 

When you successfully installed VSC (Visual Studio Code) follow the following steps to upload the code to the Wemos S3 Mini.

<img src="media/VSC_1.png" width="500"/>

Add the repository from GitHub <https://git.btclock.dev/btclock/btclock_v3> to VSC 

<img src="media/VSC_2.png" width="500"/>

When you put in the URL just click on the button that appears (btclock/btclock_v3).

<img src="media/VSC_3.png" width="500"/>

Select a repository directory and click "Select as Repository Destination" and click on open. Note: it can take some time to load all the necessary data. Please wait.

<img src="media/VSC_5.png" width="500"/>

After all the data is loaded, click on PlatformIO (in the right standing menu)
Then select the correct environment by "Switch PlatformIO Project Environment" in the under menu:

- `env:lolin_s3_mini_213epd` for a Rev. A board with 2.13 inch ePaper screens
- `env:lolin_s3_mini_29epd` for a Rev. A board with 2.9 inch ePaper screens (unsupported)
- `env:btclock_rev_b_213epd` for a Rev. B board with 2.13 inch ePaper screens


<img src="media/VSC_6.png" width="500"/>

Now it's time to build the software. Expand the "General" and "Platform" menu and click on "Build" and "Build Filesystem image" (one at the time) After building is complete first connect your Wemos S3 Mini or Rev. B board by an USB-C data cable to your computer and put it in to boot mode, to put it in to boot mode you have to push both buttons on the S3 Mini or Rev. B board at the same time, but when releasing you have to release the reset button first. 

When the board is in boot mode first upload the filesystem image by clicking "Upload Filesystem Image" after completing click under "General" "Upload". When complete your clock shut show you something like this

<img src="media/IMG_2179.jpeg" width="500"/>

Scan the QR-code with your smartphone and establish the WiFi connection. When the WiFi connection is established, open a web browser and type the following in the search bar "192.168.4.1". Since this is a captive portal, your device might automatically take you to this page already.
You will get a page like screenshot 1.

<img src="media/IMG_2181.jpeg" width="180"/> <img src="media/IMG_2183.jpeg" width="180"/> <img src="media/IMG_2184.jpeg" width="180"/>

Click on "Configure WiFi" and select the your WiFi SSID and add the necessary credentials. After you click have click on "save" you should get the screen like screenshot 3 and the clock will show you this or some of the other screens.

<img src="media/IMG_2185.jpeg" width="500"/>

Make sure all displays work, before completing the clock in the last step.
