ExpressLRS icon indicating copy to clipboard operation
ExpressLRS copied to clipboard

3.0.0-RC1 Flash Fails with "Type Mismatch"

Open DocTrucker opened this issue 2 years ago • 18 comments

Current Behaviour

Flash update to a Happymodel 2.4ghz Tx module ( HAPPYMODEL_ES24TX_2400_TX ) fails. Web update suggests a 'Type Mismatch'. Force update via web also fails.

Steps to Reproduce

Using ExpressLRS configurator on Ubuntu options: Release: 3.0.0-RC1

Target: Device category: Happymodel 2.4 GHz Device: HappyModel ES24TX 2400 TX

Flashing Method: WIFI selected

Device options: Standard Mode selected

Regulatory domains: REGULATORY_DOMAIN_EU_CE_2400 enabled

Binding phrase setup: BINDING_PHRASE enabled Custom binding phrase specified.

Compatibility options UART_INVERTED enabled

Extra data: TLM_REPORT_INTERVAL_MS disabled

Network: AUTO_WIFI_ON_INTERVAL enabled Value 60 HOME_WIFI_SSID enabled Value specified HOME_WIFI_PASSWORD enabled Value specified

Other options: WS2812_IS_GRB disabled

Possible Solution (Not obligatory)

Actions: Tx Module auto appears on "WiFi Device Selection" after selecting "Enable WiFi" option on the LUA script (express 2.5.1) page under "WiFi Connectivity".

Tried both "BUILD" followed by using the webpage to load the firmware and "BUILD & FLASH"

Details

Your Environment

Hardware: Ubuntu ExpressLRS Configurator: expresslrs-configurator_1.4.2_amd64.deb Tx: Jumper T16 Pro Tx module: Happymodel ES24TX 2.4G ExpressLRS Micro TX Transmitter ( https://www.ebay.co.uk/itm/164983737086 ) Existing ExpressLRS version on Tx Module 2.5.1

Attached files

ExpressLRSBuildLog_20220728083828689_FailWifiUpdate.txt ExpressLRSBuildLog_20220728084249717_BuildOnly.txt WebUpdateFail (Home network details specified, but removed from screen capture image)

DocTrucker avatar Jul 28 '22 09:07 DocTrucker

Yes, thats correct, because the targets are now Unified targets, you will need to select Flash anyway.

pkendall64 avatar Jul 28 '22 18:07 pkendall64

Please share a link to something discussing hiw to build firmware with ELRS configuratir for "Unified targets".

I pressed force anyway and it failed to update.

DocTrucker avatar Jul 29 '22 06:07 DocTrucker

I will run the force anyway and capture screenshots of the results. Is it perhaps something to do with the fixes applies to force wifi flash needing to be applied to the website flash?

https://github.com/ExpressLRS/ExpressLRS/pull/1600

DocTrucker avatar Jul 29 '22 06:07 DocTrucker

These are the screen shots of the webpage update process and it's ultimate failure even after force flash - bad size error.

I tried with the 3.0.0-rc1 lua script and had the same result.

01_220729_ELRS_Update

02_220729_ELRS_Update

03_220729_ELRS_Update

04_220729_ELRS_Update

DocTrucker avatar Jul 29 '22 08:07 DocTrucker

You will probably be better opening it up and flashing using the the USB connector and choosing UART flash in configurator.

pkendall64 avatar Jul 29 '22 08:07 pkendall64

This is the resulting logs from the "Build & Flash" and "Force Flash" options on the ELRS Configurator.

07_220729_ELRS_Update

ExpressLRSBuildLog_20220729083336281_BuildAndFlashFail.txt

ExpressLRSBuildLog_20220729083145272-ForceFlashFail.txt

DocTrucker avatar Jul 29 '22 08:07 DocTrucker

The UART and WiFi flashing from configurator isn't working for me at all. Only way I have had successful updates is via the webpage. Webpage update fails with bad size.

I suspect this is two issues; the configurator isn't happy on my Ubuntu machine, & the bad size issue on the webpage based update.

DocTrucker avatar Jul 29 '22 09:07 DocTrucker

The "Bad Size" issue is because the upload page doesn't seem to be supplying the X-FileSize header with size of the binary file. You could try from the command line using curl. Find the bin file, ls -al firmware.bin, to get the file size and put then in the place of xxx below.

curl -F [email protected] -H "X-FileSize: xxx" http://elrs_tx.local/upload?force

pkendall64 avatar Jul 29 '22 09:07 pkendall64

Will have a look at that later. Why would that be an issue post 3.0.0-rc1 with force flash, but not 2.5.1 with normal flash?

DocTrucker avatar Jul 29 '22 09:07 DocTrucker

It shouldn't, Ive been over that code so many times! You could even try opening the web-page on the module with ?force at the end of the URL so it will just do the force and not check for the mismatch. i.e. http://elrs_tx.local/?force Also try with the module really close to the wifi router as well.

pkendall64 avatar Jul 29 '22 09:07 pkendall64

Also, you should join the discord server and ask in the help-and-support channel, there will be plenty of helpful folk there who can help too.

pkendall64 avatar Jul 29 '22 09:07 pkendall64

Yeah, trying to get on discord but they decided I was a spam bot on log in and blocked me until late last night!

Thanks for your help.

DocTrucker avatar Jul 29 '22 09:07 DocTrucker

Curl not behaving properly either...

08_220729_ELRS_Update_CurlCMD

DocTrucker avatar Jul 29 '22 13:07 DocTrucker

http://elrs_tx.local/?force still results in a Targets mismatch warning. Ultimately fails in the same manner anyway.

DocTrucker avatar Jul 29 '22 13:07 DocTrucker

UART flashing issue solved. Power only USB lead! :-D

Think the wifi build and flash issues relate to curl, as when I manually run curl it fails to find the file, despite ls having justbreported its size fine.

Type mismatch and bad size issues remain.

DocTrucker avatar Jul 29 '22 14:07 DocTrucker

I'm glad you got it sorted, but it seems odd that curl is broken on your system!

pkendall64 avatar Jul 29 '22 19:07 pkendall64

Currently having the same problem with the slim pro series, will try to do it via uart but flashing via wifi does not work (exact same problem)

tomhorst2004 avatar Jul 29 '22 21:07 tomhorst2004

Exactly same story here - but succesfull via USB!

SplinterII avatar Jul 30 '22 18:07 SplinterII

same problem here (2.5.1 -> 3.0.0rc2): curl -F [email protected] -H "X-FileSize: 1455061" -X POST http://192.168.1.228/forceupdate results in {"status": "ok", "msg": "Update cancelled"} !?

fraro avatar Aug 29 '22 20:08 fraro

forceupdate is the command to complete an update after an upload. You need upload?force instead which will do the upload and assume you want to force flash the device. I that does not work, then a UART flash is required.

pkendall64 avatar Aug 29 '22 21:08 pkendall64

Since UART seems to be the only way, I would like to drop https://www.youtube.com/watch?v=yJ8Gu9XVjV0 for the next BetaFPV micro 1W users spending hours to get the UART (USB-C) update working :-/ Now my TX is on 3.0.0RC2, which hopefully solves an issue on the RX (PWM) side with my ESC...

fraro avatar Aug 29 '22 21:08 fraro

We've figured out the issue and provided a solution in the pinned comments in the #help-and-supprt channel on discord.

pkendall64 avatar Sep 02 '22 02:09 pkendall64

This solved the issue for my HappyModel ES24TX Pro :smile:

For anyone who doesn't want to search for the pinned message on the discord:

deadbyte — 09/01/2022

Regarding "Bad Size Given" on some TX modules being flashed to 3.x, here's your fix: https://github.com/pkendall64/repartitioner#what-is-this use the Releases page: https://github.com/pkendall64/repartitioner/releases/tag/1.0 and download the repartitioner.bin and flash it first to your tx module, once flashed, exit the lua script and relaunch it, then reactivate the WiFi on the module and upload the 3.x firmware tagging @V-22 @commanderguy3001

mazzus avatar Sep 21 '22 21:09 mazzus