-
Notifications
You must be signed in to change notification settings - Fork 7.6k
error in updating Firmware OTA on esp32 using LTE module #6644
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
Comments
@mudgalp Thanks! |
tried updating the Esp32 Arduino core to 2.0.2 still getting same response. please help here is the new log recorded out of the device. Thank you [4-28 01:42:27.3]Starting FOTA to update New Firmware |
waiting for response... |
Tried printing the error using Update.printError(Serial); here are the logs.its says Error Occurred. Error #: 6Stream Read Timeout' [5-10 09:42:22.3]<----------BOOTING UP THE DEVICE----------> //----------------------------------------------------------------------------------------------------------------- |
I have no LTE modem/module in order to test and reproduce the issue with your sketch. |
Apparently there is an issue with the communication to the OTA server over LTE, which is timing out. You can try to increase the timeout, by using Do it right after |
ok I'll try and get back to you. |
there is no error without the GSM/LTE module, it only occurs when the .bin file is being downloaded using GSM/LTE module and provided to the Update.WriteStream() function. i'm performing OTA using WIFi and httpUpdate, its works fine everytime. |
i'll try this and get back to you. |
tried this , Serial2.setTimeout(5000). |
I see. |
From #6727 there is a hint...
|
While on arduino 1.0.6 Try setting setRxBufferSize(1024); and flush(); directly before executing Update.writeStream(Serial2); It fixed the problem for me in arduino 1.0.6. However this method did not work for me in new framework even if i set buffer size to 4096 or more before begin of the serial. GSM modules tend to hang once in a while and then throwing large chunks of data at once and the buffer overflows. Try this way (arduino 1.0.6) Serial2.setRxBufferSize(1024); |
im using linux based http server made by my team. |
will try this and let you know. Thank you |
tried this, no response. |
I think this is the problem in your new framework not working issue. ### code
debug output>> [ 77722][E][HardwareSerial.cpp:494] setRxBufferSize(): RX Buffer can't be resized when Serial is already running. |
I know that, i moved this before serial begin and it still did not work in new framework. This solution only works for me in 1.0.6. Tried doing this in 1.0.6? |
|
i'll try that now. |
tried this... no success. |
I'm not using GSM Library and if i want to that this library does not support the LTE Module I'm using in my project. |
but i tried this method using my AT commands and getting issue in this loop. here the problem is that this while loop break before all data bytes downloads. that means the data available on the server will not be downloaded completely and this while loop will break.
|
There is a possible work around that may fix this issue. Pease try this code/example when starting Serial2 (used to communicate to the Modem and then receive the OTA firmware):
Please let me know if this solves the issue. |
Good Day all. 1-----------------------------------------
dear @SuGlider , I tried this but there is no difference in the problem. 2------------------------------------------------------------------------------------------- now the esp32 takes all the binary file and writes it to the ota partition successfully but it does not gets restart on the newer firmware version instead it gives me a different error as follows. the function i used
the logs i get...
dear @SuGlider please check the progress and help me get the solution. Thank you |
We have done a few updates to UART in the new Arduino Core 2.0.5 version.
|
Using Arduino Core 2.0.5, please try to setup the Serial used for OTA/LTE like this: void setup(){
Serial.setRxBufferSize(1024);
Serial.begin(115200,SERIAL_8N1,26,27);
Serial.setRxTimeout(1);
Serial.setRxFIFOFull(1);
Serial.flush();
} This will force that whenever a single byte arrives to the Serial Port, it will be made immediately available for |
After some testing with Arduino Core 2.0.5, the best configuration shall be: change is on void setup(){
Serial.setRxBufferSize(1024);
Serial.begin(115200,SERIAL_8N1,26,27);
Serial.setRxTimeout(1);
Serial.setRxFIFOFull(5);
Serial.flush();
}
|
I tested the code above, it did not help. Maybe i can record a video showing difference in updating on arduino 1.0.6 vs 2.0.5 so we can investigate and understand the problem better. |
After verifying the differences from UART v1.0.6 to 2.0.x, I see that because 2.0.x uses IDF UART driver, it is slower. Unfortunatelly, we can't move away from IDF. The issue with Update Library and Arduino Core 2.0.x is that Stream API is slower now...
I don't know how possible would be for you guys to make such code change and test it... |
I am goin
That is a pity. I am going to test that |
Please try using lastest master branch from Arduino ESP32 Github to build you application. This PR fixes I think that it may solve the timeout issue. Please use this setup:
|
Dear @mudgalp, Please provide me the files of the project. I don't need GSM library which you are using for this project rest library kindly share. Thanks |
Board
ESP32 DEV MODULE
Device Description
The device is a RS485 Based Modbus to 4G_LTE Dataloger device.
Consist of esp32-wroom module 4MB Flash Size.
MAX485CSA IC for Modbus Communication >> connected on serial1 at 9600 baudrate
Quectel 4G-LTE module EC200S for Operating in remote area(There is no wifi network) >> connected on serial2 at 115200 baudrate.
and other 12-24v to different power regulations.
all the debugging is done from serial0.
Hardware Configuration
#define ESP32_U1_TX 25 // MAX485_RX -->
#define ESP32_U1_RX 27 // MAX485_TX -->
#define ESP32_U2_TX 17 // GSM_RX -->
#define ESP32_U2_RX 16 // GSM_TX -->
#define MAX485_EN 26
#define LED 2
#define BUZZ 33
#define CONFIG 35
#define ADC 34
#define GSMPWR 32
#define GSMDTR 4
Version
v1.0.6
IDE Name
Arduino IDE
Operating System
Windows 11
Flash frequency
80Mhz
PSRAM enabled
no
Upload speed
921600
Description
hello everyone,
I'm working on a device in which I'm trying to do Firmware Over the air update of esp32-wroom module,
but i'm using another 4G-LTE module from Quictel (EC200S) to download the bin file from server.
everything looks fine but in the last it gives me error to update as >>Error Occurred. Error #: 6
here is the ota Function i'm using.
please help
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: