EdgeTX / edgetx

EdgeTX is the cutting edge open source firmware for your R/C radio
https://edgetx.org
GNU General Public License v2.0
1.58k stars 337 forks source link

Model Notes #1378

Closed koaxheli closed 2 years ago

koaxheli commented 2 years ago

Radiomaster TX16S

The checklist display is [missing] in Companion v2.6. It was still available in v2.5. screenshot_tx16s_22-01-07_18-58-40 screenshot_tx16s_22-01-07_19-00-44

General information EdgeTX "Santa" 2.6.0-RC2

pfeerick commented 2 years ago

Um... so what is the problem? :grin:

koaxheli commented 2 years ago

Radiomaster TX16S

That the checklist display in Companion v2.6. is missing, is not displayed.

pfeerick commented 2 years ago

Thanks... the difference a missing word makes! :)

Right, so with a model named fpv, and model notes named fpv.txt, it seems like simulator is looking for this file... :-O

f_open(E:/Documents/EdgeTX/RadioMaster TX16s/SD Card V2/SOUNDS/en/fpv/name.wav)

although Companion knows perfectly well it is in

image

I also don't recommend using the sd browser to find that file instead, unless you want simulator and companion to crash.

elecpower commented 2 years ago

Right, so with a model named fpv, and model notes named fpv.txt, it seems like simulator is looking for this file... :-O

f_open(E:/Documents/EdgeTX/RadioMaster TX16s/SD Card V2/SOUNDS/en/fpv/name.wav)

Simulator and radio always look for this file /model name/name.wav as a audio call out on radio boot. I use this feature.

pfeerick commented 2 years ago

Ok, so trying again, and it now goes beyond that - maybe I scrolled back and missed the lines after...

First at around 8 seconds is the attempt to view the model notes via the menu, and then at around 18s trying to view it via sd browser and eventual crash.

FirmwareDebug_22-01-08_21-18-04.zip

elecpower commented 2 years ago

at 18s f_open(E:/Documents/EdgeTX/RadioMaster TX16s/SD Card V2/C:/Users/pfeer/AppData/Local/Temp/etx-CfELgo/MODELS/fpv.txt) = INVALID_NAME (FIL 000000d62f7fedf0)

So combines both directories and appends file name so something definitely wrong with sd browser in simulator mode. Also it should halt after 1st failed attempt.

elecpower commented 2 years ago

From the log, the radio start up doesn't bother to look at the profile sd card for the checklist file. Checklist is displayed on radio start up for B&W radios tested with X9D+ simulator. There is different logic between deciding whether the Model Notes icon should be shown and actually trying to find and read the checklist file on clicking the icon.

pfeerick commented 2 years ago

There are three ways to look at this at - you can enable the checklist (which I didn't), you can view the model notes directly / via the menu (which I did), or via the sd browser (which I did). If you enable the checklist it doesn't show up. If you attempt to view the model notes it doesn't show up. If you attempt to view the model notes through the sd browser - it stops working ;)

At the end of the day, something is wrong with the path, which is what is setting everything off.

elecpower commented 2 years ago

When the target radios are compiled in simu mode any file access code needs to check both sd paths (primary and if not found then profile). Depending on how the libsim is started Companion (etx) or Simulator (data file, data folder, sd card) depends on what is in the primary path. It is not practical to have one merged path, as every file in the profile path would have to be copied to the temp path on every simulator launch (hot beverage time).

piotrva commented 2 years ago

Yup, reading a file using SD browser crashes the sim, and notes are not being displayed. It gets into infinite loop of opening the file: 93.14s: f_open(/src/build-tx16/SDCARD_SIM/tmp/etx-lDHiie/MODELS/New_model.txt) = INVALID_NAME (FIL 0x7fe21a8c5690) 93.14s: not found That does not stop even when simulator is closed (or it is just so much terminal data that it keeps going after simulation is disabled... Do you know if it is a thing on other colorlcd radios? As this stops me for now on preparing #1417 for them...

pfeerick commented 2 years ago

Right, so this is something very specific to the Simulator data file / launch through Companion mode - as if you run Simulator standalone, and instead use the data folder or sd image modes, everything works properly.

pfeerick commented 2 years ago

What I found rather odd was this... when in data file mode, it correctly identified the existence of the file, but then changed into the tempoary unzip directory for ETX data file. btw, if you shove the model notes into that tempoary folder, that works also...

207.54s: f_stat(C:/ETX/SD/MODELS/ParkMaster.txt) = OK
207.54s: [ViewMain] Focus lost
208.40s: [ViewMain] Focus gained
208.40s: f_chdir(C:/Users/pfeer/AppData/Local/Temp/etx-zkwtwq/MODELS)
208.40s:    not found
208.40s: f_stat(ParkMaster.txt) = error 2 (No such file or directory)
208.40s:    not found
208.40s: f_stat(ParkMaster.txt) = error 2 (No such file or directory)
208.40s:    not found
208.40s: f_stat(model1.txt) = error 2 (No such file or directory)
208.40s:    not found
208.40s: f_stat(model1.txt) = error 2 (No such file or directory)
piotrva commented 2 years ago

@pfeerick it is not odd, but intentional, as editing things in Companion does not mess up with backed-up contents of SD-Card on your drive - instead it creates a "tmp" and sets radio.yml and modelXX.yml there based on actual settings in Companion. Issue is that it should symlink or copy there matching checklist files.

piotrva commented 2 years ago

And I do confirm that making a copy of requested files: root@632a9d1ebdc8:/tmp/etx-fcyfGF/MODELS# cp /src/build-tx16/SDCARD_SIM/MODELS/New_model.txt New_model.txt allows to bypass a problem for now ;)

piotrva commented 2 years ago

As for fix for development purposes one may use following script, after correcting paths: fix_notes.sh

pfeerick commented 2 years ago

@pfeerick it is not odd, but intentional, as editing things in Companion does not mess up with backed-up contents of SD-Card on your drive - instead it creates a "tmp" and sets radio.yml and modelXX.yml there based on actual settings in Companion. Issue is that it should symlink or copy there matching checklist files.

No, I don't think that is quite right - have another read of what Neil said above - there are two paths it is supposed to use, and to me that log is suggesting that for some reason it is switching paths even though the first path was correct. Either that, or maybe it is switching paths to read something, and not setting it back.

pfeerick commented 2 years ago

@eshifri Can you play with this one... I've finally spotted the actual culprit (and who was responsible... but I won't name names :P) ...

Basically getting rid of this, and using a full, rather than a relative path, somewhat similar to what the B&W radios do, will resolve this... but I've not been able to get it completely working again... 😆

https://github.com/EdgeTX/edgetx/blob/6648dffc8c89d34fd26aba544e507d3cf3b20e47/radio/src/gui/colorlcd/view_text.cpp#L214

eshifri commented 2 years ago

Sorry, I'm a little bit at a loss... The problem is not related to the lvgl fix (referenced above), correct? This code is much older. Is the problem in the Simulator or in Companion? Looks like Simulator is working for me. If it is in Companion, does the Companion use this file?

Or, in other words: how do I reproduce the problem? :-)

pfeerick commented 2 years ago

Yes, this is indeed the issue raised. Basically, it is in two parts - if you have the show checklist option enabled, the model notes will not be displayed on colorlcd, it seems due to the chdir call confusing simu. And while the view notes icon will show, in the menu, it will fail to actually do anything, for the same reason.

I. E. With a colorlcd profile, create a sd card path with a model notes file, and then configure a model to show preflight checklist and try it in companion simulator. It won't show. And then try to view model notes via the main menu. On radio this is all fine, just simulator that is confused due to the dual path handling it does. :( B&W model notes path handling works fine in simulator also. ;)

The bug seems to go back to the initial view text implementation, only cosmetic code changes in that bit of code since, and this issue predates all of that anyway.