offer-shmuely / edgetx-x10-widgets

35 stars 3 forks source link

Flights Widget Not Recognized #12

Closed ammikey closed 1 year ago

ammikey commented 1 year ago

Radiomaster TX16s running edgetx 2.8.4. The radio is not recognizing the flights widget. Your The battery check and battery Analog widgets are working correctly. Thanks MJ

mixdup commented 1 year ago

Hi, I'm having the same problem: Flights not available in select widget list. Confirmed latest version is on radio SD card in WIDGETS folder. Radio: Radiomaster TX16s Mk2 EdgeTX: 2.9.0 release (previously on RC2 which did not work either) Happy o assist with any further debugging, let me know what you need to solve this issue. Cheers, Jay

offer-shmuely commented 1 year ago

In the file lib_log.lua Change in line 4

ENABLE_LOG_TO_FILE = true Turn radio off and then on, try to load the widget, and send me the log file app.log that will be created

mixdup commented 1 year ago

I changed the lib_log.lua file as suggested but still can't 'try to load' the widget as it does not appear in the widget selection list. I turned radio off/on a couple of times but can't find the app.log file.

offer-shmuely commented 1 year ago

Screenshot of the file system under /widgets/flights

mixdup commented 1 year ago

Sorry, can't screenshot for a couple of hours but folder downloaded fron git hub repo yesterday. Will upload screenshot in about 8hrs.... I'm at work now.

ammikey commented 1 year ago

I cleared the flight widget, reinstalled a new copy, changed the log file to true, rebooted the transmitter and the widget is still not in the list and no log file created. Here's a screenshot of the transmitters flights file folder. MJ Widget flight

ammikey commented 1 year ago

Flights is also not working in the edge tx simulator. The other widgets are. MJ

ammikey commented 1 year ago

I just installed an older copy of the Flights widget I had downloaded 6/28/23 and it works fine. The problem must be in the new widget LUA.

mixdup commented 1 year ago

I never had a previous version. I only tried the widget 2 days ago. I followed the method to install from RC Video Reviews https://youtu.be/QS9c5OvomKI?si=LAbRws8exMZEIwUI

offer-shmuely commented 1 year ago

What version do you see in the main.lua file Old-versio: xxxx New-version: xxx

mixdup commented 1 year ago

I had a look at the main.lua file in 'Flights' directory. I can't find reference to the above (Old-version: xxx, New-version: xxx) If I execute the script directly from the SD Card folder WIDGETS/Flights on the radio, there is a syntax error: Script syntax error ?:0: attempt to call field 'getSwitchIds' (a nil value)

getSwitchIds is referenced in the main.lua file lines 74-89:

-- backward compatibility local ver, radio, maj, minor, rev, osname = getVersion() local DEFAULT_ARM_SWITCH_ID = 1 local DEFAULT_MOTOR_CHANNEL_ID = 1 if maj == 2 and minor == 7 then -- for 2.7.x DEFAULT_ARM_SWITCH_ID = 117 -- arm/safety switch=SF DEFAULT_MOTOR_CHANNEL_ID = 204 -- motor_channel=CH3 elseif maj == 2 and minor >= 8 then -- for 2.8.x DEFAULT_ARM_SWITCH_ID = 125 -- arm/safety switch=SF DEFAULT_MOTOR_CHANNEL_ID = 212 -- motor_channel=CH3 end

local DEFAULT_ARM_SWITCH_ID = getSwitchIds("SF") -- arm/safety switch=SF local DEFAULT_MOTOR_CHANNEL_ID = getSwitchIds("CH3") -- motor_channel=CH3

Hope this helps?

mixdup commented 1 year ago

Looks like 'getSwitchIds' is not implemented in EdgeTX. Closest reference is getSwitchIndex. Possible typo?

mixdup commented 1 year ago

ok, so I tried replacing getSwitchIds with getSwitchIndex in the main.lua After radio restart the Flights widget is now listed & available. However, once it is selected the radio crashes into emergency mode. I wish I knew more about EdgteTX API & I would dive in & help debug...

mixdup commented 1 year ago

Can confirm Flights widget from EdgeTX 2.8.0 works on my TX16s MK2 with 2.9.0 Seems like the new Flights widget code needs a little adjustment. Great work on these widgets @offer-shmuely, they really are very useful & functional. Thank you for your efforts.

ammikey commented 1 year ago

.4 is working on al my radios and companion simulator. But .6 is not recognized by radios or the companion simulator. MJ

offer-shmuely commented 1 year ago

ok, now you gave me something to work with :-) please version 0.7 and let me know

ammikey commented 1 year ago

Version .7 is working well. Thank you Sir for all your work we really appreciate it! Question, is it possible to create a widget that can report the switches and switch names used in the mixer? I use almost all the switches and switch positions on the R-M TX16s. Though I try to set up all the aircraft with the same switches and switch positions some have to be setup differently. I fly 32 different aircraft, 4 of which are for search and rescue as well as looking for wild fires in very rural areas. Unfortunately, I cant always remember all the switch settings on all these aircraft and a screen widget showing that info would be very helpful. Thanks MJ

offer-shmuely commented 1 year ago

good to hear thanks for reporting the issue.

offer-shmuely commented 1 year ago

regarding your question, it is hard to write a widget that guess what do you like to see, automatically from the settings. however, yes, it is possible, to write a widget that display a pre define text that you wrote before to remind yourself.

please note: there is already very similar feature build in the system

add a file in the same name of your model image

now you will have "model notes" to see this text image

and if you enable the "display checklist", it will popup an selecting the model image

image