From e8e530d9cd6fe65b97c1ebe5c18691dd1ac5cd84 Mon Sep 17 00:00:00 2001 From: tunapro Date: Fri, 6 Feb 2026 16:32:12 +0300 Subject: [PATCH 1/2] chore: bump version to 0.2.2 and make WiFi channel config required Co-Authored-By: Claude Opus 4.6 --- VERSION | 2 +- idf_component.yml | 2 +- library.json | 2 +- library.properties | 2 +- src/driverstation/esp32s3/driver_station_esp32.hpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 0ea3a94..ee1372d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.0 +0.2.2 diff --git a/idf_component.yml b/idf_component.yml index 5f5e841..5469b5d 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -1,4 +1,4 @@ -version: 0.2.0 +version: 0.2.2 description: ESP32-S3 robotics control library url: https://github.com/nfrproducts/probot-lib dependencies: diff --git a/library.json b/library.json index 06d3e21..2ac5ab9 100644 --- a/library.json +++ b/library.json @@ -26,5 +26,5 @@ "type": "git", "url": "https://github.com/nfrproducts/probot-lib" }, - "version": "0.2.0" + "version": "0.2.2" } diff --git a/library.properties b/library.properties index c639468..b71fdac 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=probot -version=0.2.0 +version=0.2.2 author=Tuna Gül maintainer=Tuna Gül sentence=ProBot Library for Robotics Competitions. diff --git a/src/driverstation/esp32s3/driver_station_esp32.hpp b/src/driverstation/esp32s3/driver_station_esp32.hpp index 9516110..a566a50 100644 --- a/src/driverstation/esp32s3/driver_station_esp32.hpp +++ b/src/driverstation/esp32s3/driver_station_esp32.hpp @@ -21,7 +21,7 @@ static_assert(sizeof(PROBOT_WIFI_AP_SSID) - 1 <= 25, "PROBOT_WIFI_AP_SSID must b #endif #endif #ifndef PROBOT_WIFI_AP_CHANNEL -#define PROBOT_WIFI_AP_CHANNEL 1 +#error "WiFi AP channel not provided. Define PROBOT_WIFI_AP_CHANNEL (1-11) before including probot.h." #endif static_assert(PROBOT_WIFI_AP_CHANNEL >= 1 && PROBOT_WIFI_AP_CHANNEL <= 11, "PROBOT_WIFI_AP_CHANNEL must be between 1 and 11."); From c42506db8b5c63dbea49b763664cca965f975a84 Mon Sep 17 00:00:00 2001 From: tunapro Date: Fri, 6 Feb 2026 17:40:55 +0300 Subject: [PATCH 2/2] feat: make WiFi SSID config required and update examples Co-Authored-By: Claude Opus 4.6 --- examples/IBT2MotorDemo/IBT2MotorDemo.ino | 3 ++- examples/JoystickTest/JoystickTest.ino | 3 ++- examples/MotorOpenLoopDemo/MotorOpenLoopDemo.ino | 3 ++- .../command_based/AutonomousDemo/AutonomousDemo.ino | 3 ++- .../MecanumDriveDemo/MecanumDriveDemo.ino | 3 ++- examples/command_based/ShooterDemo/ShooterDemo.ino | 3 ++- examples/command_based/SliderDemo/SliderDemo.ino | 3 ++- .../command_based/TankDriveDemo/TankDriveDemo.ino | 3 ++- examples/command_based/TurretDemo/TurretDemo.ino | 3 ++- src/driverstation/esp32s3/driver_station_esp32.hpp | 12 ++++-------- 10 files changed, 22 insertions(+), 17 deletions(-) diff --git a/examples/IBT2MotorDemo/IBT2MotorDemo.ino b/examples/IBT2MotorDemo/IBT2MotorDemo.ino index ec18f12..957136b 100644 --- a/examples/IBT2MotorDemo/IBT2MotorDemo.ino +++ b/examples/IBT2MotorDemo/IBT2MotorDemo.ino @@ -51,8 +51,9 @@ * ============================================================================ */ +#define PROBOT_WIFI_AP_SSID "ProBot" #define PROBOT_WIFI_AP_PASSWORD "ProBot1234" -#define PROBOT_WIFI_AP_CHANNEL 3 // Opsiyonel (varsayilan 1) +#define PROBOT_WIFI_AP_CHANNEL 3 #include #include diff --git a/examples/JoystickTest/JoystickTest.ino b/examples/JoystickTest/JoystickTest.ino index 5ec50d5..31403b4 100644 --- a/examples/JoystickTest/JoystickTest.ino +++ b/examples/JoystickTest/JoystickTest.ino @@ -56,8 +56,9 @@ * ============================================================================ */ +#define PROBOT_WIFI_AP_SSID "ProBot" #define PROBOT_WIFI_AP_PASSWORD "ProBot1234" -#define PROBOT_WIFI_AP_CHANNEL 3 // Opsiyonel (varsayilan 1) +#define PROBOT_WIFI_AP_CHANNEL 3 #include #include diff --git a/examples/MotorOpenLoopDemo/MotorOpenLoopDemo.ino b/examples/MotorOpenLoopDemo/MotorOpenLoopDemo.ino index 7b692fa..dd8996f 100644 --- a/examples/MotorOpenLoopDemo/MotorOpenLoopDemo.ino +++ b/examples/MotorOpenLoopDemo/MotorOpenLoopDemo.ino @@ -47,8 +47,9 @@ * ============================================================================ */ +#define PROBOT_WIFI_AP_SSID "ProBot" #define PROBOT_WIFI_AP_PASSWORD "ProBot1234" -#define PROBOT_WIFI_AP_CHANNEL 3 // Opsiyonel (varsayilan 1) +#define PROBOT_WIFI_AP_CHANNEL 3 #include #include diff --git a/examples/command_based/AutonomousDemo/AutonomousDemo.ino b/examples/command_based/AutonomousDemo/AutonomousDemo.ino index 79a2525..374ff5f 100644 --- a/examples/command_based/AutonomousDemo/AutonomousDemo.ino +++ b/examples/command_based/AutonomousDemo/AutonomousDemo.ino @@ -1,5 +1,6 @@ +#define PROBOT_WIFI_AP_SSID "ProBot" #define PROBOT_WIFI_AP_PASSWORD "ProBot1234" -#define PROBOT_WIFI_AP_CHANNEL 3 // Opsiyonel (varsayilan 1) +#define PROBOT_WIFI_AP_CHANNEL 3 #include #include diff --git a/examples/command_based/MecanumDriveDemo/MecanumDriveDemo.ino b/examples/command_based/MecanumDriveDemo/MecanumDriveDemo.ino index e8d27d9..cabe952 100644 --- a/examples/command_based/MecanumDriveDemo/MecanumDriveDemo.ino +++ b/examples/command_based/MecanumDriveDemo/MecanumDriveDemo.ino @@ -1,5 +1,6 @@ +#define PROBOT_WIFI_AP_SSID "ProBot" #define PROBOT_WIFI_AP_PASSWORD "ProBot1234" -#define PROBOT_WIFI_AP_CHANNEL 3 // Opsiyonel (varsayilan 1) +#define PROBOT_WIFI_AP_CHANNEL 3 #include #include diff --git a/examples/command_based/ShooterDemo/ShooterDemo.ino b/examples/command_based/ShooterDemo/ShooterDemo.ino index 493c50b..126a7c9 100644 --- a/examples/command_based/ShooterDemo/ShooterDemo.ino +++ b/examples/command_based/ShooterDemo/ShooterDemo.ino @@ -1,5 +1,6 @@ +#define PROBOT_WIFI_AP_SSID "ProBot" #define PROBOT_WIFI_AP_PASSWORD "ProBot1234" -#define PROBOT_WIFI_AP_CHANNEL 3 // Opsiyonel (varsayilan 1) +#define PROBOT_WIFI_AP_CHANNEL 3 #include #include diff --git a/examples/command_based/SliderDemo/SliderDemo.ino b/examples/command_based/SliderDemo/SliderDemo.ino index 963f4b1..28eae9f 100644 --- a/examples/command_based/SliderDemo/SliderDemo.ino +++ b/examples/command_based/SliderDemo/SliderDemo.ino @@ -1,5 +1,6 @@ +#define PROBOT_WIFI_AP_SSID "ProBot" #define PROBOT_WIFI_AP_PASSWORD "ProBot1234" -#define PROBOT_WIFI_AP_CHANNEL 3 // Opsiyonel (varsayilan 1) +#define PROBOT_WIFI_AP_CHANNEL 3 #include #include diff --git a/examples/command_based/TankDriveDemo/TankDriveDemo.ino b/examples/command_based/TankDriveDemo/TankDriveDemo.ino index 008e83c..57113d2 100644 --- a/examples/command_based/TankDriveDemo/TankDriveDemo.ino +++ b/examples/command_based/TankDriveDemo/TankDriveDemo.ino @@ -1,5 +1,6 @@ +#define PROBOT_WIFI_AP_SSID "ProBot" #define PROBOT_WIFI_AP_PASSWORD "ProBot1234" -#define PROBOT_WIFI_AP_CHANNEL 3 // Opsiyonel (varsayilan 1) +#define PROBOT_WIFI_AP_CHANNEL 3 #include #include diff --git a/examples/command_based/TurretDemo/TurretDemo.ino b/examples/command_based/TurretDemo/TurretDemo.ino index 184ce9b..6da7eb0 100644 --- a/examples/command_based/TurretDemo/TurretDemo.ino +++ b/examples/command_based/TurretDemo/TurretDemo.ino @@ -1,5 +1,6 @@ +#define PROBOT_WIFI_AP_SSID "ProBot" #define PROBOT_WIFI_AP_PASSWORD "ProBot1234" -#define PROBOT_WIFI_AP_CHANNEL 3 // Opsiyonel (varsayilan 1) +#define PROBOT_WIFI_AP_CHANNEL 3 #include #include diff --git a/src/driverstation/esp32s3/driver_station_esp32.hpp b/src/driverstation/esp32s3/driver_station_esp32.hpp index a566a50..65c8168 100644 --- a/src/driverstation/esp32s3/driver_station_esp32.hpp +++ b/src/driverstation/esp32s3/driver_station_esp32.hpp @@ -12,14 +12,15 @@ #error "DriverStation AP password not provided. Define PROBOT_WIFI_AP_PASSWORD (>=8 chars) before including probot.h." #endif static_assert(sizeof(PROBOT_WIFI_AP_PASSWORD) - 1 >= 8, "PROBOT_WIFI_AP_PASSWORD must be at least 8 characters."); -#ifdef PROBOT_WIFI_AP_SSID +#ifndef PROBOT_WIFI_AP_SSID +#error "WiFi AP SSID not provided. Define PROBOT_WIFI_AP_SSID before including probot.h." +#endif static_assert(sizeof(PROBOT_WIFI_AP_SSID) - 1 >= 1, "PROBOT_WIFI_AP_SSID must be at least 1 character."); #ifdef PROBOT_WIFI_AP_SSID_NO_MAC_SUFFIX static_assert(sizeof(PROBOT_WIFI_AP_SSID) - 1 <= 32, "PROBOT_WIFI_AP_SSID must be 32 characters or fewer."); #else static_assert(sizeof(PROBOT_WIFI_AP_SSID) - 1 <= 25, "PROBOT_WIFI_AP_SSID must be 25 characters or fewer when MAC suffix is enabled."); #endif -#endif #ifndef PROBOT_WIFI_AP_CHANNEL #error "WiFi AP channel not provided. Define PROBOT_WIFI_AP_CHANNEL (1-11) before including probot.h." #endif @@ -34,16 +35,11 @@ namespace probot::driverstation::esp32 { void begin(){ const char* pw = PROBOT_WIFI_AP_PASSWORD; - String ssid; -#ifdef PROBOT_WIFI_AP_SSID - ssid = String(PROBOT_WIFI_AP_SSID); + String ssid = String(PROBOT_WIFI_AP_SSID); #ifndef PROBOT_WIFI_AP_SSID_NO_MAC_SUFFIX char suffix[8]; snprintf(suffix, sizeof(suffix), "-%06X", (unsigned int)(ESP.getEfuseMac() & 0xFFFFFF)); ssid += suffix; -#endif -#else - ssid = generateSSID(); #endif ap_ssid_ = ssid; WiFi.mode(WIFI_AP);