ESP32 remote firmware update options

Thread Starter

zazas321

Joined Nov 29, 2015
936
Are you sure that he has demonstrated that “his” Apache server will serve files? The only post referring to that was post #27, and his code referred to a random test server on the Internet.

Or am I wrong? Only the TS can definitely answer if his XAMP server on a Windows box will serve files.

BTW, what version of XAMP and Windows is he using? And what’s his comfort level with Linux?
Hello. What do you exactly mena when you say if XAMP server will serve files?
In my htdocs folder, I have the required binary file and when I type http://192.168.1.247/esp.bin in the browser, this will initiate a download of a binary file.


I use windows 10 and XAMPP v3.2.4.
 

Thread Starter

zazas321

Joined Nov 29, 2015
936
I was thinking about it over the night and realised something quite silly! Obviously it is not going to let me connect to the server over the GSM when I try to connect to a IP address (192.168.1.247) because it is not a local connection (My ESP32 is not connected to the WIFI, just using the GSM). I have tried to connect my phone to a different wifi network and try to put 192.168.1.247 to the browser - nothing happens. Which means my apache server only allows clients to connect if they are connected to the same WIFI network to my PC on which the server is being handled.

Can this be fixed by modifying XAMPP settings or it is more serious than that? I am now reading more about the servers and how can this be fixed.

Perhaps I must to give this IP address a domain name , would that help? For example instead of using 192.168.1.247 I would use something like www.mytestserver.com

Also, I think I must do port forwarding to allow remote connections is that right? I havent done it yet
 
Last edited:

Thread Starter

zazas321

Joined Nov 29, 2015
936
Hello. I have used free DNS service for 1 month :https://www.noip.com/

and I have added a port forwarding rule in my router settings. I can confirm that this fixed the problem ! I have sucesfully managed to do OTA firmware update through the GSM. As you can see from the serial monitor below, I have uploaded a simple Read device ID sketch. Thats great! Now I know how to perform OTA without needing the wifi


1617948306226.png
 

Ya’akov

Joined Jan 27, 2019
9,170
I was thinking about it over the night and realised something quite silly! Obviously it is not going to let me connect to the server over the GSM when I try to connect to a IP address (192.168.1.247) because it is not a local connection (My ESP32 is not connected to the WIFI, just using the GSM). I have tried to connect my phone to a different wifi network and try to put 192.168.1.247 to the browser - nothing happens. Which means my apache server only allows clients to connect if they are connected to the same WIFI network to my PC on which the server is being handled.

Can this be fixed by modifying XAMPP settings or it is more serious than that? I am now reading more about the servers and how can this be fixed.

Perhaps I must to give this IP address a domain name , would that help? For example instead of using 192.168.1.247 I would use something like www.mytestserver.com

Also, I think I must do port forwarding to allow remote connections is that right? I havent done it yet
I mentioned that oyu have to use your router to port forward. I'm sorry I missed that you weren't using your outside address.

How are you connected to the Internet? Is is a business network?

By the way, this is one reason I initially suggested dropping $5 on a VPS.
 

Ya’akov

Joined Jan 27, 2019
9,170
By the way, sorry I didn't spot the addressing, I should have but I was distracted by the ESP32 serial monitor saying "connected" and really couldn't read through all of your code properly.
 

Thread Starter

zazas321

Joined Nov 29, 2015
936
@Yaakov Hello sir. It is me again! Maybe you know if there is a way to achieve the same results without port forwarding? I am able to perform OTA at home where I have configured DNS and port forwared. Now I am at a different location and I have created a mobile hotspot using my mobile phone. I have connected to this network using my computer and created the XAMPP server. However, it timeouts when I try to perform the OTA as previously. Is there any way to do this without performing port forwarding and etc.. ?
 

Ya’akov

Joined Jan 27, 2019
9,170
@Yaakov Hello sir. It is me again! Maybe you know if there is a way to achieve the same results without port forwarding? I am able to perform OTA at home where I have configured DNS and port forwared. Now I am at a different location and I have created a mobile hotspot using my mobile phone. I have connected to this network using my computer and created the XAMPP server. However, it timeouts when I try to perform the OTA as previously. Is there any way to do this without performing port forwarding and etc.. ?
Since the ports have to be reachable, you will probably need a tunnel of some kind. The idea is that if the mobile provider is blocking access to the device, the device itself will have to establish an outgoing connection that acts as an incoming tunnel.

If the two ends were normal operating systems, I would probably use an ssh tunnel, but there are other options.I don't know if this library is relevant https://www.arduino.cc/reference/en/libraries/libssh-esp32/ but the idea is to have the remote device establish the connection and provide a way to access the ports. The ssh tunnel does this.

I am pretty sure you can find something if you search for "ESP32 tunneling". I can help more if you find something that looks like a solution.
 
Hello. I have used free DNS service for 1 month :https://www.noip.com/

and I have added a port forwarding rule in my router settings. I can confirm that this fixed the problem ! I have sucesfully managed to do OTA firmware update through the GSM. As you can see from the serial monitor below, I have uploaded a simple Read device ID sketch. Thats great! Now I know how to perform OTA without needing the wifi


View attachment 234886
Hi
zazas321

I'm currently working on the same, could you please some reference code here

Hope it will helps
 
Top