Git Product home page Git Product logo

pio-esp32-ethernet-ota's Introduction

PlatformIO + ESP32 + Ethernet + OTA Demo

Prerequisites

Must have

Initial Sketch Upload

Use the given esp32dev environment to first transport the initial OTA code to the ESP32 module.

This is already the default environment in the platformio.ini (default_envs = ...).

Make sure the W5500 module is recognized and prints its DHCP address. Expected output:

Initialize Ethernet with DHCP:
  DHCP assigned IP 192.168.1.237
Link status: ON

If an error occurs, make sure you have

  • sufficiently good 3.3V power
  • all connections are sturdy and not loose
  • RESET of the W5500 module is connected to 3V3
  • Ethernet cable is connected

Also note down theh IP address of the module.

Note that in the sketch, we initialize the authorization parmaters

  ArduinoOTA.begin(Ethernet.localIP(), "Arduino", "password", InternalStorage);

With a username Arduino and password password.

OTA upload

To upload via OTA, review the upload parameters inside the platformio.ini. Inside the upload_flags parameter, make sure to adapt the username, password, IP address and port (if changed).

Then use the upload method of the esp32dev_ota environment. Either select the environment via the platformio.ini by changing the default_env, press the Upload button in the environment that VSCode shows or use the commandline to select the environment, e.g. via

pio run -e esp32dev_ota -t upload -v

This should invoke your system's CURL to push the sketch to the ESP

CURRENT: upload_protocol = custom
curl --request POST --data-binary @"C:\Users\Maxi\Desktop\esp32_eth_ota\.pio\build\esp32dev_ota\firmware.bin" http://arduino:[email protected]:65280/sketch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0  302k    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
 26  302k    0     0   26 81920      0  81920  0:00:03  0:00:01  0:00:02 57007
 52  302k    0     0   52  160k      0  81920  0:00:03  0:00:02  0:00:01 62060
 74  302k    0     0   74  224k      0  76458  0:00:04  0:00:03  0:00:01 67344
 95  302k    0     0   95  288k      0  73728  0:00:04  0:00:04 --:--:-- 66707
100  302k    0     0  100  302k      0  61875  0:00:05  0:00:05 --:--:-- 62664
100  302k    0     0  100  302k      0  51562  0:00:06  0:00:06 --:--:-- 45067
100  302k    0     0  100  302k      0  51562  0:00:06  0:00:06 --:--:-- 37860
=============================== [SUCCESS] Took 15.30 seconds =============== 

Environment    Status    Duration
-------------  --------  ------------
esp32dev       IGNORED
esp32dev_ota   SUCCESS   00:00:15.296
==== 1 succeeded in 00:00:15.296 ==================== 

And thus we have a successful OTA upload.

Upload SPIFFS?

Arduino OTA has the possibility of uploading the SPIFFS via the /spiffs URL. This is not implemented in the PlatformIO integration, it only does sketch data. Feel free to expand.

pio-esp32-ethernet-ota's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.