Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about updating via curl - terminal #17

Open
Mathteus opened this issue May 23, 2022 · 7 comments
Open

question about updating via curl - terminal #17

Mathteus opened this issue May 23, 2022 · 7 comments

Comments

@Mathteus
Copy link

I am using the lib 'ESP-Web OTA' in my project, and when I go to do the firmware update via curl through the linux terminal, I find the following error.

I add the following lines to init_wifi()

IPAddress local_ip(192,168,1,46);
IPAddress getway(168,168,1,1);
IPAddress subnet(255,255,0,0);
IPAddress primaryDNS(8,8,8,8);
IPAddress secondaryDNS(8,8,4,4);
if (!WiFi.config(local_ip, getway, subnet, primaryDNS, secondaryDNS)) ESP.restart();

to be able to get it by changing the ip of eps32.

using code in main

#include <WebOTA.h>
#include <Arduino.h>

void setup() {
Serial.begin(115200);
init_wifi("LAb", "test123", "esp-ota");
}

void loop() {
webota.handle();
}

image

I did several tests and found that it only works if the ip of the esp32 is 192.168.1.* , when changing the ip of the esp32 does not work with the error 'Timeout for connection'.

I would like to know how to fix this in my code, if I'm doing something wrong.

@scottchiefbaker
Copy link
Owner

That sounds like a local IP/Subnet issue on the sending box. Your ESP32 has a subnet of /16 (255.255.0.0), does your local box also? Are you able to ping the ESP32 when the curl fails?

@Mathteus
Copy link
Author

I tried to ping the ESP32 right after trying to update the firmware, and I got the following result.

image

About ESP32 having a subnet (255.255.0.0) I don't know if I understood it right, but I manually put it in the init_wifi() function, setting the variable, according to the subnet of my machine.

IPAddress subnet(255,255,0,0);

@scottchiefbaker
Copy link
Owner

Everything looks OK to me. I suspect the issue isn't with WebOTA, but instead with basic IP connectivity between your Linux machine, and your ESP32.

@Mathteus
Copy link
Author

could you tell why it only works with ip 192.168.1.* ?

@Mathteus
Copy link
Author

sorry, I clicked wrong and ended up closing the issues

@scottchiefbaker
Copy link
Owner

I suspect the IP and subnet of your Linux machine, and your ESP32 are not the same.

@Mathteus
Copy link
Author

Mathteus commented May 23, 2022

but if that were the cause then no ip would work.
or am i wrong about?

I checked my machine's subnet and it's the same as ESP32

@Mathteus Mathteus reopened this May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants