Arduino connected but not working after V4 upgrade

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Message
Author
jschnurr
Posts: 10
Joined: Sat Mar 30, 2019 5:56 pm

Re: Arduino connected but not working after V4 upgrade

#21 Post by jschnurr »

I too have the same problem. Hardware was working fine with AM 3.7. Upgraded to AM 4.0.

Reflashed the (chinese knockoff) UNO from AM 4.0. Updated the plugins for FSX.

In the Home tab, it shows the Arduino as connected.

But the hardware only works from the "Create/Edit" tab when you click "Run". Only the hardware for the single instrument runs at that time. No errors are shown on the Console.

It's like the hardware isn't "starting" unless the "Run" button is pressed. However, changing the heading bug directly in FSX, for example, does change the heading bug on the AM instrument. The Instruments are working, just not the hardware.

Been poking around for an hour at this. Can't figure out what where the problem is. I'll watch to see if any solutions come up on this thread.

Edit: Ok, restarted the sim a couple times, restarted AM a few times, and restarted the panel a few times. Now it's working.
Not sure where the problem was ¯\_(ツ)_/¯

jim_in_nh
Posts: 40
Joined: Sat Apr 11, 2020 11:54 am

Re: Arduino connected but not working after V4 upgrade

#22 Post by jim_in_nh »

So I need to execute my hardware set-ups on the first pass through the H/W script AND not do that until the Arduino is connected...

I've confirmed that I can detect when the Aurduino is connected or not with the hw_connected() function, and I also set-up a watchdog timer in case the Arduino never connects, and for now, I'm using the timer ONLY to see if I can simply hold-off execution of the HW setups for 4 sec

I've tried while-do and repeat-until loops to make the script wait - just crashes...

A timer wont work because the timers don't stop execution, they setup a timed interrupt.

Placing the HW setups inside an "if statement" wont work because they wont run on the first pass through the script

Obviously there is there a dedicated function or technique to suspend script execution because not everyone is having this problem, but I'm not seeing it yet. The digging continues...

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: Arduino connected but not working after V4 upgrade

#23 Post by Corjan »

Hi,


It shouldn't be so hard. Air Manager should dynamically connect to hardware without having to go through hoops in the lua code.

Is there a small lua example I could use to reproduce this issue?


Corjan

jim_in_nh
Posts: 40
Joined: Sat Apr 11, 2020 11:54 am

Re: Arduino connected but not working after V4 upgrade

#24 Post by jim_in_nh »

I agree. In 3.7.10 it all worked automatically with no issue. In v4, my HW script works perfectly as long as I manually launch it in the create/edit tab and wait for the Arduino to show "connected" on the AM Home tab.
I also removed my hw script from the panel and re installed it. Same result, although I just did this again and noticed that in the instrument add list, there are two each of my h/w scripts (only one is active - others are older versions), but there is only one copy of each in my create/edit tab. Maybe unrelated but interesting.

Would a stripped-down copy of my script be the type example you are looking for?

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: Arduino connected but not working after V4 upgrade

#25 Post by Corjan »

Hi,

Yes, the smaller the better.
Please note that it should still present the issue off course.

Corjan

Mccluress
Posts: 30
Joined: Wed Apr 28, 2021 10:28 am

Re: Arduino connected but not working after V4 upgrade

#26 Post by Mccluress »

I just saw the download log ability for the pi so I did that. Every one of my connections is saying “failed to bind hardware id’s to connected hardware.” I’m not using any special scripts. Just the ones downloaded from within air manager for hardware.

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Arduino connected but not working after V4 upgrade

#27 Post by Sling »

Corjan wrote: Fri Apr 30, 2021 8:50 am Hi,


It shouldn't be so hard. Air Manager should dynamically connect to hardware without having to go through hoops in the lua code.

Is there a small lua example I could use to reproduce this issue?


Corjan
Corjan,

I don’t think this is an issue of the connection happening but just when in the AM and instrument start sequence.

Let’s take an example of an instrument that has built in hardware features that is set to auto start after AM has started. If the hardware has not been recognised when this happens the hardware binding will fail.

That’s an example of my understanding of what the guys may be experiencing.

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Arduino connected but not working after V4 upgrade

#28 Post by Sling »

jim_in_nh wrote: Fri Apr 30, 2021 10:00 am I agree. In 3.7.10 it all worked automatically with no issue. In v4, my HW script works perfectly as long as I manually launch it in the create/edit tab and wait for the Arduino to show "connected" on the AM Home tab.
I also removed my hw script from the panel and re installed it. Same result, although I just did this again and noticed that in the instrument add list, there are two each of my h/w scripts (only one is active - others are older versions), but there is only one copy of each in my create/edit tab. Maybe unrelated but interesting.

Would a stripped-down copy of my script be the type example you are looking for?
I just posted what I think is happening but I have a question related to that. If you wait until the Arduino is connected (appears at the bottom of the home tab left pane) and then run the panel does it still fail. If it does my theory on your particular issue does not run true because you have waited for the board to be recognised before trying to bind.

I hope this makes sense.

I might have to test this for myself because it intrigues.

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Arduino connected but not working after V4 upgrade

#29 Post by Keith Baxter »

Hi,

Yes i suspect what Tony says. On my system AM4 beta it takes about about 10-12 seconds for the grayed out arduinos to be become recognized. By that time the instrument script is well on it,s way.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: Arduino connected but not working after V4 upgrade

#30 Post by Corjan »

Hi,


I think I managed to find the issue.

Would you mind installing this AM BETA version and try again?
https://www.siminnovations.com/api4/dow ... n=HOME_USE


Corjan

Post Reply