Push script to air player

Support for connecting hardware to the Raspberry Pi GPIO

Moderators: russ, Ralph

Message
Author
bencorbe
Posts: 5
Joined: Mon Oct 11, 2021 3:36 pm

Push script to air player

#1 Post by bencorbe »

Hi guys !
I'm new to air manager and I have a networked raspberry pi 4 (air player) with two arduinos connected to it. I made a lua script for each arduino and when I do "Run" everything works great.
I would now like this script to be launched when starting my raspberry. I tried the "Push" button but when I restart air manager and power on my raspberry, the script doesn't start.
I must have missed something somewhere.
Basically when I open air manager, xplane and power on my raspberry, I would like everything to initialize correctly directly.
Anyone to help me with this?

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

Re: Push script to air player

#2 Post by Ralph »


bencorbe
Posts: 5
Joined: Mon Oct 11, 2021 3:36 pm

Re: Push script to air player

#3 Post by bencorbe »

Hello Ralph!
This is exactly the documentation that I followed but obviously it doesn't work. A popup opens 1 sec when I click on "Push" but nothing else happens and the player obviously does not have the code...

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

Re: Push script to air player

#4 Post by Ralph »

I've never heard that it does not work. It might be that there's an error in your script.

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

Re: Push script to air player

#5 Post by Sling »

Have you tried it with a single community instrument that is known to be working. If that works you can start adding in more instruments until it breaks and then you will have more information where the issue may be.

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

Re: Push script to air player

#6 Post by Ralph »

It might also help to download the log from Air Player in the Home tab (right click on Air Player). There could be something useful in there.

bencorbe
Posts: 5
Joined: Mon Oct 11, 2021 3:36 pm

Re: Push script to air player

#7 Post by bencorbe »

Hello everyone,

I tried with a silly code (just a permanently lit LED) but it doesn't seem to work any better.

Code: Select all

my_led = hw_led_add("ARDUINO_MEGA2560_I_D47", 0.5) 
Here is the log I have:

Code: Select all

19-10-2021 09:51:44 INFO SimRemoteServer: Accepted connection from 192.168.1.212
19-10-2021 09:53:40 INFO AirPlayer: Starting development instrument
19-10-2021 09:55:17 INFO AirPlayer: Starting development instrument
What is weird is that it goes well in development when I click on "Run" but nothing happens in the log when I click on "Push".
Either there's something I'm doing wrong or there's a bug somewhere...

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

Re: Push script to air player

#8 Post by Ralph »

Did you try any of the Raspberry Pi IO pins? Instead of an Arduino.

bencorbe
Posts: 5
Joined: Mon Oct 11, 2021 3:36 pm

Re: Push script to air player

#9 Post by bencorbe »

Hello Ralph,

I connected a led between my pin 12 and the ground on my raspberry pi 4 and tested this code:

Code: Select all

my_led = hw_led_add("RPI_V2_P1_12", 0.0)
hw_led_set(my_led, 0.5)
Unfortunately nothing works, neither the test nor the push.

On the other hand, when I do "run" with my arduino it works very well but the push does not work.

I don't understand any of this

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

Re: Push script to air player

#10 Post by Sling »

Can you post the code for the whole instrument you have loaded on the pi. Its difficult to establish what you actually have with just a few code lines. As an example you mention button but i don't see the button code.

Also can you explain what you are expecting the code you post to do upon start.

Post Reply