Forums » Req. WJ2(ESP32) support »
OTA not working
Added by Costantino Piva 2 months ago
Hello Waijung2 Support, I'm trying to implement the OTA firmware update on a project, I was trying your example first (the one in Station Mode) and I encountered this error, both by generating my link and by leaving yours (I checked if it was active and it was).
Can you check why this is happening? Thank you
Replies (11)
RE: OTA not working
-
Added by Parth Maheshwari (พาร์ท) 2 months ago
Hello,
Apologies for the delayed response. We will begin investigating this and will have an update for you as soon as possible.
Regards,
Parth
RE: OTA not working
-
Added by Parth Maheshwari (พาร์ท) about 2 months ago
Hello,
Please check #34802#note-7 for the update and fix.
Regards,
Parth
RE: OTA not working
-
Added by Parth Maheshwari (พาร์ท) about 2 months ago
The patch file has also been uploaded here in case you or someone else requires it in the future. It should help solve the issue.
Regards,
Parth
RE: OTA not working
-
Added by Costantino Piva about 1 month ago
Hello Parth,
Thank you for the support, but unfortunately a new error came out. I downloaded and substituted the patch file you published but when I built the first model of the example this error comes out, even without modifying the model
Error:C:/wajiung2_Tests/OTA/esp32_ota_sta_demo1_esp32_build_system/main/waijung2_hwdrvlib.c:68:9: error: 'HTTP_EVENT_REDIRECT' undeclared (first use in this function); did you mean 'HTTP_EVENT_HEADER_SENT'?
which redirects to the following c code.
Thank you again for the support.
Best reguards
Costantino
RE: OTA not working
-
Added by Parth Maheshwari (พาร์ท) about 1 month ago
Hello Constantino,
We believe you are running into this error because you used the patch file for Waijung v25.4a while you are actually using v24.1a. My apologies for causing the confusion as I had redirected you to this in the most recent message.
The patch file you need for your version is actually uploaded in a separate issue here.
Kindly follow the same steps and let us know how it goes.
Hope this helps.
Regards,
Parth
RE: OTA not working
-
Added by Costantino Piva 25 days ago
Hello Parth,
Thank you very much, now it works fine but I cannot do one thing. I would like to build a model on esp32 and when I have a newer version of the software upload it on the device via OTA Station Mode but it seems that the model must have the sharable link already integrated, preventing me to update it when the source file changes. Let's say I generate a model and after a month I want to update it via OTA Station Mode, how can I do it? Thank you for the support.
Regards,
Costantino
RE: OTA not working
-
Added by Parth Maheshwari (พาร์ท) 24 days ago
Hello Constantino,
Glad it is working for you now.
If you would like to build a model on ESP32 and upload a newer version of the software at a later point in time, that is what OTA AP mode was designed for. Have you had the chance to look at that example? With the OTA AP mode there is an embedded web server that you can use to upload the new file from the client itself whenever you want.
Hope that helps.
Regards,
Parth
RE: OTA not working
-
Added by Costantino Piva 18 days ago
Hello Parth,
yes I've had a look at it, maybe too fast, because I understood that to upload the update it is mandatory to connect to the wifi of the device, so I must be in the proximity of it and can't do it if I'm in another building. Correct me if my understanding of the example is incorrect. Thank you for the patience.
Best regards,
Costantino
RE: OTA not working
-
Added by Parth Maheshwari (พาร์ท) 10 days ago
Hello Constantino,
Yes your understanding of the AP mode example is correct i.e. you do need to be in the proximity of the device to log in to the embedded web server to upload a newer version of the software.
Currently the embedded web server is only hosted on the device in AP mode so uploading a newer version of the software in STA mode via a web server is not an option with the current demos. Let me check the possibilities to see what can be done before getting back to you.
Thank you for your patience.
Regards,
Parth
RE: OTA not working
-
Added by Parth Maheshwari (พาร์ท) about 24 hours ago
Hello Consantino,
There are a few possibilities to achieve what you would like to do.
As mentioned earlier, currently the embedded web server is hosted on the device in AP mode, which only allows you to upload a newer version while you are in the proximity of the device. Since you would like to do this in STA mode, the options are:
Option 1: Accessing the device remotely to upload a newer version of the software whenever you like. For this to happen:- The embedded web server must be hosted in STA mode as well. We must make changes to the OTA block for this.
- A VPN server on which your device can register as a VPN client must be set up on your end. This will allow your device to have a dedicated public IP that is hosted on the VPN server. Then, through another VPN client using the VPN tunnel, you can access your device's web server in STA mode.
Option 2: When you have the .bin file of the newer software ready, you upload it to the same google drive link. The OTA block must be modified by us such that it intermittently checks for newer software versions on the google drive. If there is a new version it automatically updates it.
Option 2 is definitely the simpler solution as Option 1 requires setting up a VPN server on your end. However, both options require us to modify the OTA block and conduct testing on our end , which we will put into our to-do list and get to it as soon as possible.
Regards,
Parth