Arduino connected but not working after V4 upgrade

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

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

Re: Arduino connected but not working after V4 upgrade

#11 Post by Mccluress »

I’m not using any special scripts. Just making sure stuff works after the move from simvim. G5’s for example on a pi air player with pins connected to arduino. Mega 2560 is recognized, pins are all on right channel and spot, nothing happens in the sim. Even if I’m flying the default G5 cessna 172. Nothing changes on air player or x plane.

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

Re: Arduino connected but not working after V4 upgrade

#12 Post by Sling »

Mccluress wrote: Wed Apr 28, 2021 10:31 am Do I need to connect my arduino into the raspberry or my computer? I’m plugged into the computer right now. I’ll try the raspberry next time I go up. Just at a loss right now.
The Arduino needs to be physically connected to the machine running the script that accesses the Arduino hardware.

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

Re: Arduino connected but not working after V4 upgrade

#13 Post by Mccluress »

I have the script running on the pi. I plugged it into there and got no change. Sorry I forgot to mention that I tried that before. It comes up on the pi USB port and says connected. Just doesn’t do anything.

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Arduino connected but not working after V4 upgrade

#14 Post by Ralph »

Did you add the Arduino to Air Player Raspberry Pi from within Air Manager?

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

Re: Arduino connected but not working after V4 upgrade

#15 Post by Mccluress »

I flashed it on air manager and then plugged it into the pi and hit the add arduino button and linked it to the Com port that came up for the pi if that’s what you mean. All from inside air manager yes.

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Arduino connected but not working after V4 upgrade

#16 Post by Ralph »

Sounds right. Maybe I've missed it, but which type of Arduino are you using?

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Arduino connected but not working after V4 upgrade

#17 Post by Ralph »

Oh wait, I see, a Mega2560. I will have to test next week.

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

Re: Arduino connected but not working after V4 upgrade

#18 Post by Mccluress »

I’m going to do a clean install of both X-Plane and fs2020 too just to see if something else is interfering with the plug in.

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

Re: Arduino connected but not working after V4 upgrade

#19 Post by jim_in_nh »

Back to the original question, I used a timer to check the Arduino connection status every second. (I first confirmed that the hw_connected() function worked as expected and it did.) But when the hw_connected() status goes true, and the HW setups finally run, I get this error message...

ERROR - logic.lua:864: Cannot initiate hardware ADC input outside of initial logic.lua execution

Makes me think that I'm going to need to kill time BEFORE the Arduino is connected, in the first pass of the script, and THEN run the HW setups all on the first pass of the script. In other words, the HW setups can't be inside a conditional response that is ever false. Is that true? Is that what this error message means?

Thanks as always,
Jim

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

#20 Post by Keith Baxter »

Jim.

100's
The hardware has to be declared outside a function on the initial pass. or in a function that is called on the initial pass. {referring to init functions}

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 

Post Reply