How / where to connect "Named Hardware"

Air Player Mini is a small version of Air Player running on the ESP32.

Moderators: russ, Ralph

Post Reply
Message
Author
termigrator
Posts: 9
Joined: Thu Dec 03, 2020 5:48 pm

How / where to connect "Named Hardware"

#1 Post by termigrator »

Hi,

i flashed a ESP32 Device and thereafter i see the Airplayer-Hardware in the Home-Tab. But I can't find a dialog-box where to configure the "Named Hardware". Pushing the instrument to the Air Player does not trigger a dialog too.

My Codesample:

Code: Select all

 local parkbrake_dref     = "1-sim/parckBrake" 
 
 function brake_hw_callback(position)
  print(position)
  if position == 1 then
    xpl_dataref_write(parkbrake_dref, "INT", 1)
  else
    xpl_dataref_write(parkbrake_dref, "INT", 0)
  end
end


 hw_switch_id = hw_switch_add("PARKINGBRAKE", 1, brake_hw_callback)
The Airplayer shurely is not able to guess, to which gpio-pi i connected the parkingbrake swith. But: how do i configure the gpio-pin?

Best regards

Robert Krüger

User avatar
jph
Posts: 2252
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: How / where to connect "Named Hardware"

#2 Post by jph »

termigrator wrote: Sun Mar 07, 2021 11:56 am Hi,

i flashed a ESP32 Device and thereafter i see the Airplayer-Hardware in the Home-Tab. But I can't find a dialog-box where to configure the "Named Hardware". Pushing the instrument to the Air Player does not trigger a dialog too.

My Codesample:

Code: Select all

 local parkbrake_dref     = "1-sim/parckBrake" 
 
 function brake_hw_callback(position)
  print(position)
  if position == 1 then
    xpl_dataref_write(parkbrake_dref, "INT", 1)
  else
    xpl_dataref_write(parkbrake_dref, "INT", 0)
  end
end


 hw_switch_id = hw_switch_add("PARKINGBRAKE", 1, brake_hw_callback)
The Airplayer shurely is not able to guess, to which gpio-pi i connected the parkingbrake swith. But: how do i configure the gpio-pin?

Best regards

Robert Krüger
Hi Robert,
I am unsure exactly what you mean, but, please check the spelling of the code in the line -

Code: Select all

 local parkbrake_dref     = "1-sim/parckBrake"
The second parkbrake appears to have an additional 'c' as you have written 'parCkbrake' as opposed to parkbrake ?

Joe
“Everything in moderation, including moderation.”
“Experience is merely the name men gave to their mistakes.”
Joe (CISSP) -IT security consultant

termigrator
Posts: 9
Joined: Thu Dec 03, 2020 5:48 pm

Re: How / where to connect "Named Hardware"

#3 Post by termigrator »

Hi Joe,

this typo is on the sim-side (Flightfactor Airbus a350), not on my code-side. This dataref is working with an Arduino-Nano without problems.

In Addition: it was a little tricky and cost me half an hour to find this dataref in the sim, because of that typo!

Best Regards

Robert Krüger

termigrator
Posts: 9
Joined: Thu Dec 03, 2020 5:48 pm

Re: How / where to connect "Named Hardware"

#4 Post by termigrator »

Hi everyone,

I have now found the solution myself: there is no solution.

I found a note in the wiki-documentation that only the hardware interface (which is no longer recommended) can be used with the ESP32 chip.

This is a little pity, because there is a lot of potential in an ESP32-based solution.

Best regards

Robert Krüger

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

Re: How / where to connect "Named Hardware"

#5 Post by Sling »

It’s simple just don’t use named hardware. If it’s just for yourself then fixing the hardware id’s in code is better anyway IMHO.

Post Reply