Page 2 of 4

Re: Air Player - how to add hardware?

Posted: Thu Oct 22, 2020 10:29 am
by uptimist
Thanks Keith - I’ll use code post style next time.

It repeated trim command as experimenting with right amount of trim per input on my aircraft. Not very elegant but it works.

I’m not sure what you want me to try? It’s basically the same code? I mean I can try but...

Re: Air Player - how to add hardware?

Posted: Thu Oct 22, 2020 10:35 am
by uptimist
I ran your simplified code, same error.
logic.lua:10: Illegal argument list

Re: Air Player - how to add hardware?

Posted: Thu Oct 22, 2020 10:48 am
by uptimist
And also if I run the G5 panel, and then look at the log from Air Player I see these errors:

22-10-2020 11:33:35 INFO SiRunner: Generic - Garmin G5: logic.lua:79: Failed to bind hardware id's to connected hardware
22-10-2020 11:33:35 INFO SiRunner: Generic - Garmin G5: logic.lua:79: Failed to bind hardware id's to connected hardware
22-10-2020 11:33:35 ERROR SiRunner: Generic - Garmin G5: logic.lua:102: Illegal argument list
22-10-2020 11:33:35 ERROR SiRunner: Generic - Garmin G5: logic.lua:102: Illegal argument list
22-10-2020 11:33:35 INFO SiRunner: Generic - Garmin G5: logic.lua:125: Failed to bind hardware id's to connected hardware
22-10-2020 11:33:35 INFO SiRunner: Generic - Garmin G5: logic.lua:125: Failed to bind hardware id's to connected hardware

So it seems like not a code problem? But something to do with Air Player not recognizing Arduinos. I am guessing something weird going on on that PC but hard to diagnose. In device manager it shows devices as "working properly". And if I run Air Manager on that PC (the same one that I am running Air Player on), then the boards show up in the devices list. But for some reason Air Player is not seeing them.

The only other thing I can think of doing, unless you have some other idea, is to move AP to another PC (I have another windows laptop) and try it on that. Then I would know it's specific to the one PC.

Re: Air Player - how to add hardware?

Posted: Thu Oct 22, 2020 10:49 am
by Keith Baxter
uptimist wrote: Thu Oct 22, 2020 10:35 am I ran your simplified code, same error.
logic.lua:10: Illegal argument list
Hi,

Ok that means Air Player does not like named hardware. I did see Corjan have a look at this thread. Sure he is going to check.

Keith

Re: Air Player - how to add hardware?

Posted: Thu Oct 22, 2020 10:55 am
by Keith Baxter
Hi,

Did you try this.

Code: Select all

hw_dial_id = hw_dial_add(hw_id_a, hw_id_b, type, callback)
Keith

Re: Air Player - how to add hardware?

Posted: Thu Oct 22, 2020 11:01 am
by Sling
You are moving the Arduino between machines while you test this right?

If so you could try adding the dial sometime after the initial script runs. You can do this by placing the add in a timer callback. Worth a shot.

Re: Air Player - how to add hardware?

Posted: Thu Oct 22, 2020 11:11 am
by uptimist
Thanks guys, appreciate the suggestions, but I need the G5 panel to work with hardware on Air Player, and I don't have access to that code (and I assume it's code well written which supports being run on Air Player). So I'm not sure there's a purpose in experimenting with changes to my own code?

To answer the other question, yes, I am moving the Arduino boards to the AP machine, and they show up in device manager on that machine as "USB Serial Device (COM3)" and 4.

Re: Air Player - how to add hardware?

Posted: Thu Oct 22, 2020 11:20 am
by Keith Baxter
uptimist wrote: Thu Oct 22, 2020 11:11 am Thanks guys, appreciate the suggestions, but I need the G5 panel to work with hardware on Air Player, and I don't have access to that code (and I assume it's code well written which supports being run on Air Player). So I'm not sure there's a purpose in experimenting with changes to my own code?

To answer the other question, yes, I am moving the Arduino boards to the AP machine, and they show up in device manager on that machine as "USB Serial Device (COM3)" and 4.
Hi,

100% behind you.

Trying the test code not your code using ...

Code: Select all

hw_dial_id = hw_dial_add(hw_id_a, hw_id_b, type, callback)
We are trying to isolate the issue so that Corjan can fix if it is an AP issue. There should be no need to alter code to adapt.

Using hardware ID on the test instrument would indicate if AP has an issue with named hardware which looks likely. Or the issue lies with your hardware setup.

By The Way. you using AM3.7 on both AP and AM. Or you running AP3.7 and AM4 beta?

Keith

Re: Air Player - how to add hardware?

Posted: Thu Oct 22, 2020 1:11 pm
by uptimist
OK I ran the modified code as suggested, but didn't change anything. Runs ok locally, get an error running on Air Player.
AM version is 3.7.10.
I can't see where the AP version is shown, but it was default version downloaded and installed this week

Code: Select all

function trimwheel_callback(direction)
    if direction == 1 then
        fsx_event("ELEV_TRIM_UP")
        print("Trim UP")
    else 
        fsx_event("ELEV_TRIM_DN")
         print("Trim DN")      
    end
end
-- hw_dial_add("Trim Wheel", trimwheel_callback)
hw_dial_add("ARDUINO_UNO_A_D5", "ARDUINO_UNO_A_D6", "TYPE_1_DETENT_PER_PULSE", trimwheel_callback)

Re: Air Player - how to add hardware?

Posted: Thu Oct 22, 2020 2:32 pm
by Keith Baxter
Hi,
Do you get the error on named hardware if you do not assign the hardware in the console?

If you don't get the error then my guess is your issue is arduino connection to the AP pc

Else I am stumped. and @Ralph or Corjsn needs to intervene.

Keith