Jump to content
Sign in to follow this  
cstr-online

Arduino-Bridge with Nano Every

Recommended Posts

Hello,

I want to control the MSFS via physical switches and indicator.

My plan is to use the Arduino-Bridge.

I saw in the documentation, that the Bridge should work with Arduino-Nano-R3.

I board now two Arduino-Nano-Every, because I thought "Nano" is "Nano"... :-)

But now I can not get a connection to the Arduino-Boards. Is it possible, that the Bridge is not working with Arduino-Nano-Every?

What can I do?

Any idea?

Thank you for your kindly support!

BR

Christoph

(CSTR-Online)

Share this post


Link to post
Share on other sites
Posted (edited)
10 hours ago, cstr-online said:

I board now two Arduino-Nano-Every, because I thought "Nano" is "Nano".

No. The Nano R3 has the ATmega328 chip, and the Every has the ATMega4809. 

10 hours ago, cstr-online said:

Is it possible, that the Bridge is not working with Arduino-Nano-Every?

Yes, absolutely. The Bridge wants to flash a new binary sketch on that board, prebuilt for the ATmega328. And since the Every has a different chip, that will not work. 

10 hours ago, cstr-online said:

What can I do?

Any idea?

Use a compatible board. Or a different app, there are other sim-solutions for Arduino that are more powerful.

Just for completeness sakes: alternatives would be to use a LAN or WiFi shield and access the AAO WebAPI directly, or to build a CAN bus setup with the Arduino.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Hello,
To give additional information, use a Nano board (clone is OK) with ATMega328 and not ATMega168.

To continue on this thread, I use the LCD as output with my Arduino Nano and in the "RPN Code" field, I set:
(L:A32NX_EFIS_L_ND_MODE, enum) 0 == if{ 'LS' }
to display LS on the LCD when the knob is on LS
1/ (L:A32NX_EFIS_L_ND_MODE, enum) in the "RPN Code" field displays 0 on the LCD (OK)
2/ But (L:A32NX_EFIS_L_ND_MODE, enum) 0 == if{ 'LS' } is interpreted as text, whereas it is processed correctly in the script editor.
Syntax error? Something else?
Any help appreciated.
Didier

Share this post


Link to post
Share on other sites
Posted (edited)
48 minutes ago, DID92370 said:

Something else?

Are you using the proper syntax? You cannot just type RPN code into that field, you have to use the %..%!..! RPN string output format, as shown in the bridge's manual and the MSFS SDK doc.

It should look something like this:

%(L:A32NX_EFIS_L_ND_MODE, enum) 0 ==%{if}LS{else}  {end}

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Thanks Lorby for your quick answer. I understand that you can only dump variables of the sim eventually fomatted with %...% or !....!.

My project was to display on LCDs driven by Arduinos different information of the sim ACCORDING to statuses. Hence RPN code to evaluate these statuses.

Share this post


Link to post
Share on other sites
Posted (edited)
15 minutes ago, DID92370 said:

different information of the sim ACCORDING to statuses.

That is what the %..%{if}...{else}...{end} "conditional gauge strings" are for. Try the code that I posted above, theoretically it should do what you want. 

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Thanks for your help. I will try tomorrow as I'm back home with my desktop. Stay tuned.

Share this post


Link to post
Share on other sites

Hello,

Back home to try your proposal ..... and it works !!!! %(L:A32NX_EFIS_L_ND_MODE, enum) 0 ==%{if}LS{else}VOR{end}

Moreover, with the keywords you mentioned "conditional gauge strings", I discovered there is also the "case" statement ..... which would be better according to I want to achieve because I have several statuses to check.

In the MSFS SDK Doc, I found an example: %( 3 )%{case}%{ :0 }AIRPORT%{ :1 }INTERSECTION%{ :2 }NDB%{ :3 }VOR%{ :4 }MARKER%{end}

Unfortunately, when I set this string example in the "RPN field" of the Arduino bridge, it does not give VOR as stated in the description "A case statement can be used to select a text string from a group of strings. The case numbers do not have to be sequential. The example would produce the result: VOR"

I tried to modify the syntax in case there would be an error in the syntax of the example ..... without success.

Any idea? Thanks in advance for your help.

 

 

 

Share this post


Link to post
Share on other sites
Posted (edited)
41 minutes ago, DID92370 said:

Any idea?

Sorry, but "case" or "loop" are not supported, only the {if}. {If}s can be stacked inside one another if that helps?

These bridges are just hobby projects, and I only work on them if and when. I will put the {case} on the list of things to do, it hasn't been missed in the Bridges or AAO until now.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Oh oh .... stacked {if}s seem to be a good workaround. But sorry I'm not very familiar with the RPN Notation/conditional gauge strings. What would be the correct syntax? Made a few trials and did not find examples on the web.

Share this post


Link to post
Share on other sites
Posted (edited)
13 hours ago, DID92370 said:

Oh oh .... stacked {if}s seem to be a good workaround. But sorry I'm not very familiar with the RPN Notation/conditional gauge strings. What would be the correct syntax? Made a few trials and did not find examples on the web.

There are none, because the sim doesn't support that. Only the bridge. I would suggest to stick to the AAO and Bridge manuals. The RPN dialect is similar but not exactly the same. Especially AAO has more operators and additional commands.

This version has the {case} now. I am posting it here, because technically it already has the Plugin logic too - but there was no time to test it properly yet. Make sure to create a backup copy of the Bridge settings AppData\Local\LORBY_SI\ArduinoBridge

[snip]

Be mindful that the syntax is slightly different from the simuators variant (same as with the if)
%3%{case}{:0}AIRPORT{:1}INTERSECTION{:2}NDB{:3}VOR{:4}MARKER{end}

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

YOU DID IT !!!!! You are FANTASTIC Lorby. Thanks to you, the feasability of my project is achieved.

In a nutshell, the idea is to associate:
* HW: Behringer X-Touch Mini + Arduinos + LCD 2004
* SW: AAO + Arduino Bridge + Funatic Framework
in order to control aircraft in MSFS via physical knobs and switches in a friendly manner

Share this post


Link to post
Share on other sites

Version 1.03 b04 of the Arduino Bridge has been uploaded to the AAO website now.

The version can also be run in "Plugin Mode". Instead of unpacking the exe and the dll into a separate folder and starting it manually, you unpack them into \Documents\LorbyAxisAndOhs Files\Plugins\ArduinoBridge\

In plugin mode, the bridge will be started and stopped by AAO as required, and it no longer uses the WebAPI (so no more fiddling with ports). The bridge GUI can be accessed by clicking on the bridges' symbol in the task bar when it is running. But you can also still run the exe manually if you have larger configurations to do.


LORBY-SI

Share this post


Link to post
Share on other sites

So I bought an "Every" and I was able to adapt the Sketch to suit this controller. At least I hope that I did - I'm not sure that everything is working. The controller is apparantly very different from all the other Arduinos. But I cannot flash it on the board with my software, the uploader process is very different as well.

I can include the .hex files in the deliverable and you could then use avrdude to write the .hex on the device manually. 


LORBY-SI

Share this post


Link to post
Share on other sites

Lorby,

Seems there's a small issue when the bridge is run in "Plugin Mode". Downloaded 1.03 b04; all files in  \Documents\LorbyAxisAndOhs Files\Plugins\ArduinoBridge\

Bridge activated from the task bar and NANO is connected .... But the script in LCD does not work: nothing is displayed on LCD. Reactivating the connection does not solve the issue.

Whereas when the bridge is activated manually in standalone mode, the (same) script works and I get the display accordingly to the script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...