You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-8
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,7 @@ Feeling generous and want to support my work, here is [my PayPal link](https://p
7
7
8
8
9
9
## What works for now
10
-
- WiFi init
11
-
- BLE init
10
+
- WiFi init with AP style configuration via HTTPS web page
12
11
- Websocket communication and AES 128 CBC auth
13
12
- Start/stop BLE scan
14
13
- Discover devices
@@ -29,11 +28,15 @@ This short guide explains how to install the gateway and configure the [TTLock H
29
28
30
29
### Preparing the ESP32
31
30
32
-
Open the cloned repo in VSCode and PlatformIO should automatically install all the required dependencies. After this is done, you need to create a `config.cpp` file in the src folder based on the `config.cpp.example` template. Update this config file with your WiFi credentials and a **random generated 128 bit AES key** that will be used for encryption during the authentication phase. You can use [online tools](https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx) to generate the key.
31
+
Open the cloned repo in VSCode and PlatformIO should automatically install all the required dependencies. You need to modify `sdkconfig.h` located in `.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config`and change `CONFIG_ARDUINO_LOOP_STACK_SIZE` to `10240`. This is because the HTTPS certificate generation takes more stack space.
33
32
34
33
> At the moment, the project is only configured to work on **ESP32-WROVER boards**. If you have a different board, you need to edit the `platformio.ini` file and create your own env configuration. As of this writing the code takes about 1.5Mb so I'm using the `min_spiffs.csv` partition scheme in order to be able to hopefully do OTA in the future.
35
34
36
-
Connect your ESP32 to the PC, go to PlatformIO menu (the alien head on the VSCode's left toolbar, where you have files, search, plugins etc.) then in **Project Tasks** choose **env:esp-wrover** -> **General** -> **Upload and Monitor**. This should start the build process and once it is finished the compiled result will be uploaded to the ESP32. Once the upload finishes you should start seeing some debug output, including if the WiFi connection was succesfull and the **IP address of the device** (which you need for configuring the TTLock Home Assistant addon).
35
+
Connect your ESP32 to the PC, go to PlatformIO menu (the alien head on the VSCode's left toolbar, where you have files, search, plugins etc.) then in **Project Tasks** choose **env:esp-wrover** -> **General** -> **Upload and Monitor**. This should start the build process and once it is finished the compiled result will be uploaded to the ESP32.
36
+
37
+
Once the upload finishes you should start seeing some debug output, including the status of the WiFi AP and HTTPS certificate generation status (it will take quite some time so be patient). After the startup is completed, you can connect to ESP's AP named **ESP32GW** with password **87654321** and access [https://esp32gw.local](https://esp32gw.local). The browser will complain about the self-signed certificate but you can ignore and continue. The default username and password are **admin/admin**. Configure your wifi credentials and copy the **AES Key** which you need to setup in the **TTLock Home Assistant addon**.
38
+
39
+
After saving the new configuration, the ESP will reboot, connect to your WiFi and output it's **IP address** on the serial port (it will also generate a new HTTPS certificate if you changed it's name). It will also be accessible via `esp32gw.local` (or the new name you gave it) via MDNS if this service is working in your network. You can still make configuration changes by accessing it's IP address in the browser.
37
40
38
41
### Setting up HA
39
42
@@ -42,7 +45,7 @@ Once you have the ESP runing the gateway software, go to the **TTLock Home Assis
42
45
```yaml
43
46
gateway: noble
44
47
gateway_host: IP_ADDRESS_OF_YOUR_ESP
45
-
gateway_port: 80
48
+
gateway_port: 8080
46
49
gateway_key: AES_KEY_FROM_ESP_CONFIG
47
50
gateway_user: admin
48
51
gateway_pass: admin
@@ -60,10 +63,8 @@ If everything was done correctly you should not be able to use the addon using t
60
63
- check if multiple connections to multiple devices are possible (`BLEDevice::createClient` seems to store only 1 `BLEClient`, but we could just create the client ourselfs)
61
64
- Service UUID filtering for scan and allow/disallow duplicates
62
65
- Timeout for non-authenticated connections
63
-
- Initial wifi AP based setup
64
-
- Web configuration for AES key and credentials
65
66
- Investigate unstable wifi (sometimes it connects but there is no traffic; try to ping gw during setup)
0 commit comments