Skip to content

Commit

Permalink
OTA using ESP32 AP mode
Browse files Browse the repository at this point in the history
  • Loading branch information
SK21 committed Jan 5, 2024
1 parent c7d6d2f commit 3fa67da
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 69 deletions.
3 changes: 3 additions & 0 deletions Modules/ESP32 Rate/Notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
RC_ESP32 can connect to the rate app by using the ESP32 access point. Connect to the tablet to the ESP32 access point.(RateModule ...) In the rate app set the subnet to the access point network.

To update the ESP32 over-the-air open a browser web page to (access point IP)/update. For example 192.168.100.1/update. Find the hex file on the tablet and upload.
Binary file modified Modules/ESP32 Rate/RC_ESP32.ino.bin
Binary file not shown.
14 changes: 11 additions & 3 deletions Modules/ESP32 Rate/RC_ESP32/Begin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,7 @@ void DoSetup()
break;
}

//StartOTA();

// Access Point

AP_LocalIP = IPAddress(192, 168, MDL.ID + 100, 1);
AP_DestinationIP = IPAddress(192, 168, MDL.ID + 100, 255);

Expand All @@ -340,8 +337,19 @@ void DoSetup()
server.on("/ButtonPressed", ButtonPressed);
server.onNotFound(HandlePage1);

// OTA
server.on("/myurl", HTTP_GET, []() {
server.sendHeader("Connection", "close");
server.send(200, "text/plain", "Hello there!");
});

/* INITIALIZE ESP2SOTA LIBRARY */
ESP2SOTA.begin(&server);

server.begin();

Serial.println("OTA started.");

Serial.println("");
Serial.println("Finished setup.");
Serial.println("");
Expand Down
55 changes: 0 additions & 55 deletions Modules/ESP32 Rate/RC_ESP32/OTA.ino

This file was deleted.

4 changes: 2 additions & 2 deletions Modules/ESP32 Rate/RC_ESP32/RC_ESP32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <WiFiClient.h>
#include <WiFiAP.h>

#include <ArduinoOTA.h>
#include <WebServer.h>
#include <EEPROM.h>

Expand All @@ -25,6 +24,8 @@
#include <EthernetUdp.h>
#include <Adafruit_PWMServoDriver.h>

#include <ESP2SOTA.h> // https://github.com/pangodream/ESP2SOTA

// rate control with ESP32 board: DOIT ESP32 DEVKIT V1
# define InoDescription "RC_ESP32 : 04-Jan-2024"
const uint16_t InoID = 4124; // change to send defaults to eeprom, ddmmy, no leading 0
Expand Down Expand Up @@ -183,7 +184,6 @@ void loop()
ReceiveUDP();
ReceiveAGIO();

ArduinoOTA.handle();
server.handleClient();

Blink();
Expand Down
15 changes: 7 additions & 8 deletions Modules/ESP32 Rate/RC_ESP32/RC_ESP32.vcxproj

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Modules/ESP32 Rate/RC_ESP32/RC_ESP32.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<ClCompile Include="Analog.ino" />
<ClCompile Include="Begin.ino" />
<ClCompile Include="Motor.ino" />
<ClCompile Include="OTA.ino" />
<ClCompile Include="PCA95x5_RC.h">
<Filter>Header Files</Filter>
</ClCompile>
Expand Down

0 comments on commit 3fa67da

Please sign in to comment.