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
7 changes: 5 additions & 2 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,10 @@ where `&type` is:

### 7.6. Q: How do I connect to the companion via WIFI, e.g. using a heltec v3?
**A:**
WiFi firmware requires you to compile it yourself, as you need to set the wifi ssid and password.
Edit WIFI_SSID and WIFI_PWD in `./variants/heltec_v3/platformio.ini` and then flash it to your device.
WiFi firmware now utilizes WIFI Manager which automatically creates an AP of "MC-AP" with password "mypwd000" when unable to connect to WIFI.

To customize the default AP name and password, edit WIFI_MANAGER and WIFI_PWD in `./variants/heltec_v3/platformio.ini` and then flash it to your device. A custom password with fewer than 8 characters will be right-padded with zeros to a length of 8.

If the manager does not pop up automatically after connecting to the AP, please browse to 192.168.4.1 .

---
23 changes: 18 additions & 5 deletions examples/companion_radio/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ static uint32_t _atoi(const char* sp) {
#endif

#ifdef ESP32
#ifdef WIFI_SSID
#if defined(WIFI_MANAGER)
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
WiFiManager wifiManager;
#include <helpers/esp32/SerialWifiInterface.h>
SerialWifiInterface serial_interface;
#ifndef TCP_PORT
Expand Down Expand Up @@ -193,10 +195,21 @@ void setup() {
#endif
);

#ifdef WIFI_SSID
board.setInhibitSleep(true); // prevent sleep when WiFi is active
WiFi.begin(WIFI_SSID, WIFI_PWD);
serial_interface.begin(TCP_PORT);
#if defined(WIFI_MANAGER)
// AP password must have a minimum 8 characters
String ap_passwd = WIFI_PWD;
while (ap_passwd.length() < 8) {
ap_passwd += "0";
}
if (wifiManager.autoConnect(WIFI_MANAGER, ap_passwd.c_str()))
{
board.setInhibitSleep(true); // prevent sleep when WiFi is active
serial_interface.begin(TCP_PORT);
} else {
MESH_DEBUG_PRINTLN("WifiManager failed to connect. Restarting.");
delay(2000);
ESP.restart();
}
#elif defined(BLE_PIN_CODE)
serial_interface.begin(BLE_NAME_PREFIX, the_mesh.getNodePrefs()->node_name, the_mesh.getBLEPin());
#elif defined(SERIAL_RX)
Expand Down
4 changes: 2 additions & 2 deletions examples/companion_radio/ui-new/UITask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <helpers/TxtDataHelpers.h>
#include "../MyMesh.h"
#include "target.h"
#ifdef WIFI_SSID
#if defined(WIFI_MANAGER)
#include <WiFi.h>
#endif

Expand Down Expand Up @@ -201,7 +201,7 @@ class HomeScreen : public UIScreen {
sprintf(tmp, "MSG: %d", _task->getMsgCount());
display.drawTextCentered(display.width() / 2, 20, tmp);

#ifdef WIFI_SSID
#if defined(WIFI_MANAGER)
IPAddress ip = WiFi.localIP();
snprintf(tmp, sizeof(tmp), "IP: %d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
display.setTextSize(1);
Expand Down
5 changes: 3 additions & 2 deletions variants/heltec_tracker_v2/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ build_flags =
-D MAX_GROUP_CHANNELS=40
-D DISPLAY_CLASS=ST7735Display
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
-D OFFLINE_QUEUE_SIZE=256
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
Expand All @@ -197,6 +197,7 @@ build_src_filter = ${Heltec_tracker_v2.build_src_filter}
lib_deps =
${Heltec_tracker_v2.lib_deps}
densaugeo/base64 @ ~1.4.0
tzapu/WiFiManager@^2.0.17

[env:heltec_tracker_v2_sensor]
extends = Heltec_tracker_v2
Expand Down
5 changes: 3 additions & 2 deletions variants/heltec_v2/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ build_flags =
-D MAX_CONTACTS=160
-D MAX_GROUP_CHANNELS=8
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
-D OFFLINE_QUEUE_SIZE=256
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
Expand All @@ -195,3 +195,4 @@ build_src_filter = ${Heltec_lora32_v2.build_src_filter}
lib_deps =
${Heltec_lora32_v2.lib_deps}
densaugeo/base64 @ ~1.4.0
tzapu/WiFiManager@^2.0.17
9 changes: 5 additions & 4 deletions variants/heltec_v3/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ build_flags =
-D MAX_GROUP_CHANNELS=40
-D DISPLAY_CLASS=SSD1306Display
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
-D OFFLINE_QUEUE_SIZE=256
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
Expand Down Expand Up @@ -340,8 +340,8 @@ build_flags =
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
-D OFFLINE_QUEUE_SIZE=256
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
Expand All @@ -351,6 +351,7 @@ build_src_filter = ${Heltec_lora32_v3.build_src_filter}
lib_deps =
${Heltec_lora32_v3.lib_deps}
densaugeo/base64 @ ~1.4.0
tzapu/WiFiManager@^2.0.17

[env:Heltec_WSL3_sensor]
extends = Heltec_lora32_v3
Expand Down
9 changes: 5 additions & 4 deletions variants/heltec_v4/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ build_flags =
-D MAX_GROUP_CHANNELS=40
-D DISPLAY_CLASS=SSD1306Display
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${heltec_v4_oled.build_src_filter}
Expand Down Expand Up @@ -371,8 +371,8 @@ build_flags =
-D MAX_GROUP_CHANNELS=40
-D DISPLAY_CLASS=ST7789LCDDisplay
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${heltec_v4_tft.build_src_filter}
Expand All @@ -384,6 +384,7 @@ build_src_filter = ${heltec_v4_tft.build_src_filter}
lib_deps =
${heltec_v4_tft.lib_deps}
densaugeo/base64 @ ~1.4.0
tzapu/WiFiManager@^2.0.17

[env:heltec_v4_tft_sensor]
extends = heltec_v4_tft
Expand Down
5 changes: 3 additions & 2 deletions variants/lilygo_tlora_v2_1/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ build_flags =
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=160
-D MAX_GROUP_CHANNELS=8
-D WIFI_SSID='"ssid"'
-D WIFI_PWD='"password"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
-D WIFI_DEBUG_LOGGING=1
-D OFFLINE_QUEUE_SIZE=256
build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
Expand All @@ -145,6 +145,7 @@ build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter}
lib_deps =
${LilyGo_TLora_V2_1_1_6.lib_deps}
densaugeo/base64 @ ~1.4.0
tzapu/WiFiManager@^2.0.17

;
; Repeater Bridges
Expand Down
5 changes: 3 additions & 2 deletions variants/nibble_screen_connect/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ build_flags =
-D MAX_CONTACTS=300
-D MAX_GROUP_CHANNELS=8
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
-D OFFLINE_QUEUE_SIZE=256
build_src_filter = ${nibble_screen_connect_base.build_src_filter}
+<helpers/ui/SSD1306Display.cpp>
Expand All @@ -157,4 +157,5 @@ build_src_filter = ${nibble_screen_connect_base.build_src_filter}
lib_deps =
${nibble_screen_connect_base.lib_deps}
densaugeo/base64 @ ~1.4.0
tzapu/WiFiManager@^2.0.17

5 changes: 3 additions & 2 deletions variants/rak11310/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,15 @@ lib_deps = ${rak11310.lib_deps}
; -D MAX_CONTACTS=100
; -D MAX_GROUP_CHANNELS=8
; -D WIFI_DEBUG_LOGGING=1
; -D WIFI_SSID='"myssid"'
; -D WIFI_PWD='"mypwd"'
; -D WIFI_MANAGER='"MC-AP"'
; -D WIFI_PWD='"mypwd000"'
; ; -D MESH_PACKET_LOGGING=1
; ; -D MESH_DEBUG=1
; build_src_filter = ${rak11310.build_src_filter}
; +<../examples/companion_radio/*.cpp>
; lib_deps = ${rak11310.lib_deps}
; densaugeo/base64 @ ~1.4.0
; tzapu/WiFiManager@^2.0.17

[env:RAK_11310_terminal_chat]
extends = rak11310
Expand Down
5 changes: 3 additions & 2 deletions variants/rak3112/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ build_flags =
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
-D OFFLINE_QUEUE_SIZE=256
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
Expand All @@ -184,6 +184,7 @@ build_src_filter = ${rak3112.build_src_filter}
lib_deps =
${rak3112.lib_deps}
densaugeo/base64 @ ~1.4.0
tzapu/WiFiManager@^2.0.17

[env:RAK_3112_sensor]
extends = rak3112
Expand Down
5 changes: 3 additions & 2 deletions variants/rpi_picow/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ lib_deps = ${rpi_picow.lib_deps}
; -D MAX_CONTACTS=100
; -D MAX_GROUP_CHANNELS=8
; -D WIFI_DEBUG_LOGGING=1
; -D WIFI_SSID='"myssid"'
; -D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
; ; -D MESH_PACKET_LOGGING=1
; ; -D MESH_DEBUG=1
; build_src_filter = ${rpi_picow.build_src_filter}
; +<../examples/companion_radio/*.cpp>
; lib_deps = ${rpi_picow.lib_deps}
; densaugeo/base64 @ ~1.4.0
; tzapu/WiFiManager@^2.0.17

[env:PicoW_terminal_chat]
extends = rpi_picow
Expand Down
5 changes: 3 additions & 2 deletions variants/station_g2/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ build_flags =
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
-D OFFLINE_QUEUE_SIZE=256
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
Expand All @@ -237,3 +237,4 @@ build_src_filter = ${Station_G2.build_src_filter}
lib_deps =
${Station_G2.lib_deps}
densaugeo/base64 @ ~1.4.0
tzapu/WiFiManager@^2.0.17
7 changes: 5 additions & 2 deletions variants/thinknode_m2/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ build_flags =
-D MAX_GROUP_CHANNELS=40
-D OFFLINE_QUEUE_SIZE=256
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${ThinkNode_M2.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/MomentaryButton.cpp>
Expand All @@ -188,6 +190,7 @@ lib_deps =
${ThinkNode_M2.lib_deps}
densaugeo/base64 @ ~1.4.0
end2endzone/NonBlockingRTTTL@^1.3.0
tzapu/WiFiManager@^2.0.17

[env:ThinkNode_M2_companion_radio_serial]
extends = ThinkNode_M2
Expand Down
7 changes: 5 additions & 2 deletions variants/thinknode_m5/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ build_flags =
-D MAX_GROUP_CHANNELS=40
-D OFFLINE_QUEUE_SIZE=256
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"Livebox-633C"'
-D WIFI_PWD='"vvQUHGSxsWd7fKMYSr"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${ThinkNode_M5.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/MomentaryButton.cpp>
Expand All @@ -204,6 +206,7 @@ lib_deps =
${ThinkNode_M5.lib_deps}
densaugeo/base64 @ ~1.4.0
end2endzone/NonBlockingRTTTL@^1.3.0
tzapu/WiFiManager@^2.0.17

[env:ThinkNode_M5_companion_radio_serial]
extends = ThinkNode_M5
Expand Down
9 changes: 5 additions & 4 deletions variants/waveshare_rp2040_lora/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ lib_deps = ${waveshare_rp2040_lora.lib_deps}
; -D MAX_CONTACTS=100
; -D MAX_GROUP_CHANNELS=8
; -D WIFI_DEBUG_LOGGING=1
; -D WIFI_SSID='"myssid"'
; -D WIFI_PWD='"mypwd"'
; ; -D MESH_PACKET_LOGGING=1
; ; -D MESH_DEBUG=1
; -D WIFI_MANAGER='"MC-AP"'
; -D WIFI_PWD='"mypwd000"'
; ; -D MESH_PACKET_LOGGING=1
; ; -D MESH_DEBUG=1
; build_src_filter = ${waveshare_rp2040_lora.build_src_filter}
; +<../examples/companion_radio/*.cpp>
; lib_deps = ${waveshare_rp2040_lora.lib_deps}
; densaugeo/base64 @ ~1.4.0
; tzapu/WiFiManager@^2.0.17

[env:waveshare_rp2040_lora_terminal_chat]
extends = waveshare_rp2040_lora
Expand Down
5 changes: 3 additions & 2 deletions variants/xiao_c3/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ build_flags =
-D MAX_GROUP_CHANNELS=40
-D OFFLINE_QUEUE_SIZE=256
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"mypwd"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
; -D BLE_DEBUG_LOGGING=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${Xiao_esp32_C3.lib_deps}
${esp32_ota.lib_deps}
densaugeo/base64 @ ~1.4.0
tzapu/WiFiManager@^2.0.17
5 changes: 3 additions & 2 deletions variants/xiao_rp2040/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,15 @@ lib_deps = ${Xiao_rp2040.lib_deps}
; -D MAX_CONTACTS=100
; -D MAX_GROUP_CHANNELS=8
; -D WIFI_DEBUG_LOGGING=1
; -D WIFI_SSID='"myssid"'
; -D WIFI_PWD='"mypwd"'
; -D WIFI_MANAGER='"MC-AP"'
; -D WIFI_PWD='"mypwd000"'
; ; -D MESH_PACKET_LOGGING=1
; ; -D MESH_DEBUG=1
; build_src_filter = ${Xiao_rp2040.build_src_filter}
; +<../examples/companion_radio/*.cpp>
; lib_deps = ${Xiao_rp2040.lib_deps}
; densaugeo/base64 @ ~1.4.0
; tzapu/WiFiManager@^2.0.17

[env:Xiao_rp2040_terminal_chat]
extends = Xiao_rp2040
Expand Down
5 changes: 3 additions & 2 deletions variants/xiao_s3_wio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,15 @@ build_flags =
-D MAX_GROUP_CHANNELS=40
-D OFFLINE_QUEUE_SIZE=256
-D WIFI_DEBUG_LOGGING=1
-D WIFI_SSID='"myssid"'
-D WIFI_PWD='"password"'
-D WIFI_MANAGER='"MC-AP"'
-D WIFI_PWD='"mypwd000"'
; -D BLE_DEBUG_LOGGING=1
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
lib_deps =
${Xiao_S3_WIO.lib_deps}
densaugeo/base64 @ ~1.4.0
tzapu/WiFiManager@^2.0.17

[env:Xiao_S3_WIO_sensor]
extends = Xiao_S3_WIO
Expand Down