I want to program ESP32 using OTA. But based on my research in internet I got to know that to do this, the esp32 and the computer(used to upload code) should be connected in the same wifi network. What if I wish to do this with different wifi network. For example, if I am in USA, I wish to upload the new code to the esp32 in India. Is it possible to do this thing? Can anyone answer this question?
Share
Yup, you can.
Try to use any one cloud service provider, like AWS, GCP, Azure resources to establish an OTA
Hello,
Yes it can be possible but for that you need to connect your ESP32 module to router or hot spot who has external network then only you can able to access it.
Would ypu please let me know that are you using Arduino IDE or ESP32 IDF for programming perspective into ESP32?
Regards,
Ritesh Prajapati
External network means? Can you explain please?
Hello,
External network means internet should be connected from your ESP32 Device.
Yes, it is possible to perform OTA updates on an ESP32 from a different Wi-Fi network, even if you are physically located in a different country. The requirement for both the ESP32 and the computer to be on the same Wi-Fi network is a common scenario for convenience, but it’s not a strict limitation.
The ESP32 can connect to any Wi-Fi network with internet access, and you can set up your ESP32 to listen for OTA updates on a specific port. As long as your ESP32 is accessible from the internet (using its IP address and the designated port), you can initiate an OTA update from your computer in the USA to the ESP32 in India.
Here are the general steps to achieve this:
1. Configure the ESP32 for OTA:
Set up your ESP32 to be capable of receiving OTA updates. Make sure you have the necessary libraries and code in place to handle OTA updates.
2. Port Forwarding:
In the router settings of the network where your ESP32 is connected (in India), you need to configure port forwarding to route incoming connections on the OTA port to the local IP address of your ESP32.
3. Determine ESP32’s Public IP:
Find out the public IP address of the network in India where your ESP32 is connected. You can use online services like “WhatIsMyIP” to determine this IP.
4. Update Code from USA:
From your computer in the USA, you can initiate the OTA update by sending the firmware to the ESP32’s public IP address using the specified port. This may involve using specialized tools or scripts, depending on your development environment.
5. Firewall and Security Considerations:
Keep in mind that security and firewall settings can affect this process. Ensure that your ESP32’s firewall allows incoming connections on the designated OTA port. You might also want to consider implementing security measures like authentication and encryption for the OTA process to ensure the integrity of the updates.