Board index FlightGear Support Interfacing

Help with interfacing FG and Arduino Pro Mini

Connecting two computers, using generic protocol, connecting with Matlab?

Help with interfacing FG and Arduino Pro Mini

Postby Kikokou-san » Wed Sep 06, 2017 8:09 am

Dear all,

I have a problem I do not manage to solve myself with interfacing FG and an Arduino Pro Mini board with a push-button and a potentiometer.

The problem is that FG is launching correctly, but get stuck at one moment during the splash screen displaying "Finalising position". It stays stuck here endlessly. The only solution I have is to unplug the USB cable, and immediately it goes to the next sequence (i.e. downloading sceneries) and then starts correctly. After I unplug, there is an error message displaying continuously in the console saying that something stopped the thread and that there is a serial IO read error but this is normal I guess as there is nothing connected to the USB/COM anymore...

But I don't know what's happening when FG is stuck (before I unplug the cable) and why it gets stuck... Any idea ?

My code is correct and my wiring is correct too (when I check the output of my Arduino within the Arduino IDE, it is exactly what I want : 0 all the time, 1 when it is pressed, line break between them). I even reduced the code and the wiring to only a push button (without potentiometer) supposed to control strobe light on the C172P to try to isolate the problem with no success until now.

I tried several things :
- Launching using Qt launcher or using command line : result is the same
- Escaping the port COM with the \\.\ symbols: result is the same
- Unplugging the Arduino after each use of Arduino IDE: result is the same
- Manually changing the port COM number: result is the same
- Changing the line separator in the .xml and in the Arduino code in case it was the "\n" caracter that was causing problems: result is the same
- Changing the quotes using aternatively " or ' in the Arduino code: result is the same
- Insert a time delay before sending the first data over the COM port just in case the problem came from FG not being able to interpretate the first packet received in case it is a partial packet: result is the same
- Uninstalling and reinstalling FlightGear....: result is the same

I followed all advices from http://wiki.flightgear.org/Howto:Use_Arduino_with_FlightGear, https://playground.arduino.cc/Main/FlightGear and https://sites.google.com/site/flightgeararduinoandlinux/

If you have any idea, please let me know...

I forgot to mention I am using FG 2017.2.1 and Windows 10.

Thank you so much

Best regards
Kiko
Kikokou-san
 
Posts: 26
Joined: Wed Mar 15, 2017 9:55 am

Re: Help with interfacing FG and Arduino Pro Mini

Postby Kikokou-san » Wed Sep 06, 2017 9:00 am

Just a few more comments :

- I already saw many other users on the forum having the same problem (FG stuck at "finalising position"), but no answer was really brought except using another method (telnet, udp, etc.)
- I launched FG with the option --log-level=bulk and it is quite interesting

Here is what I had in the console :
Code: Select all
is orphan '.dirindex'
file exists hash is good:MU32.threshold.xml
file exists hash is good:MU33.threshold.xml
file exists hash is good:MU34.threshold.xml
file exists hash is good:MU35.threshold.xml
file exists hash is good:MU38.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/3" child update took:3
fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

is orphan '.dirindex'
file exists hash is good:MU40.threshold.xml
file exists hash is good:MU41.threshold.xml
file exists hash is good:MU42.threshold.xml
file exists hash is good:MU48.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/4" child update took:3
fg_serial line = aR!

fg_serial line = A!

fg_serial line = A!

is orphan '.dirindex'
file exists hash is good:MU55.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/5" child update took:2
fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!L

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

is orphan '.dirindex'
file exists hash is good:MU62.threshold.xml
file exists hash is good:MU63.threshold.xml
file exists hash is good:MU65.threshold.xml
fg_serial line = 0)!

file exists hash is good:MU68.threshold.xml
file exists hash is good:MU69.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/6" child update took:3
fg_serial line = AR!

fg_serial line = `R!H

fg_serial line = 0)!

is orphan '.dirindex'
file exists hash is good:MU70.threshold.xml
file exists hash is good:MU71.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/7" child update took:2
fg_serial line = A!H

fg_serial line = 0)R!

is orphan '.dirindex'
file exists hash is good:MU84.threshold.xml
file exists hash is good:MU85.threshold.xml
file exists hash is good:MU86.threshold.xml
file exists hash is good:MU89.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/8" child update took:4
fg_serial line = aR!

fg_serial line = aR!

fg_serial line = 0)R!

fg_serial line = 0)!

is orphan '.dirindex'
file exists hash is good:MU97.threshold.xml
file exists hash is good:MU98.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/9" child update took:2
fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = aR!

is orphan '.dirindex'
file exists hash is good:MUBA.groundnet.xml
file exists hash is good:MUBA.threshold.xml
file exists hash is good:MUBA.twr.xml
file exists hash is good:MUBR.threshold.xml
file exists hash is good:MUBY.groundnet.xml
file exists hash is good:MUBY.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/B" child update took:3
fg_serial line = 0)!H

fg_serial line = 0)!

fg_serial line = AR!L

is orphan '.dirindex'
file exists hash is good:MUCA.groundnet.xml
file exists hash is good:MUCA.threshold.xml
file exists hash is good:MUCC.groundnet.xml
file exists hash is good:MUCC.ils.xml
file exists hash is good:MUCC.threshold.xml
file exists hash is good:MUCC.twr.xml
file exists hash is good:MUCF.groundnet.xml
file exists hash is good:MUCF.threshold.xml
file exists hash is good:MUCL.groundnet.xml
file exists hash is good:MUCL.threshold.xml
file exists hash is good:MUCL.twr.xml
file exists hash is good:MUCM.groundnet.xml
file exists hash is good:MUCM.threshold.xml
file exists hash is good:MUCM.twr.xml
file exists hash is good:MUCU.groundnet.xml
fg_serial line = 0)R!

file exists hash is good:MUCU.ils.xml
file exists hash is good:MUCU.threshold.xml
file exists hash is good:MUCU.twr.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/C" child update took:8
fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!L

is orphan '.dirindex'
file exists hash is good:MUFL.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/F" child update took:1
fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = aR!

fg_serial line = A!L

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = A!L

is orphan '.dirindex'
fg_serial line = 0)R!

file exists hash is good:MUKW.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/K" child update took:5
fg_serial line = aR!

fg_serial line = aR!

fg_serial line = 0)R!

fg_serial line = aR!

fg_serial line = AR!

fg_serial line = 0)R!

is orphan '.dirindex'
file exists hash is good:MUGM.groundnet.xml
file exists hash is good:MUGM.threshold.xml
file exists hash is good:MUGM.twr.xml
file exists hash is good:MUGT.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/G" child update took:4
fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!

is orphan '.dirindex'
file exists hash is good:MUHA.groundnet.xml
file exists hash is good:MUHA.ils.xml
fg_serial line = AR
Input line does not end with expected line separator.
file exists hash is good:MUHA.threshold.xml
file exists hash is good:MUHA.twr.xml
file exists hash is good:MUHG.ils.xml
file exists hash is good:MUHG.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/H" child update took:4
fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

is orphan '.dirindex'
file exists hash is good:MULB.threshold.xml
file exists hash is good:MULM.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/L" child update took:3
fg_serial line = A!

fg_serial line = A!L

fg_serial line = AR!

fg_serial line = `R!

fg_serial line = AR!

fg_serial line = A!L

is orphan '.dirindex'
file exists hash is good:MUMO.threshold.xml
file exists hash is good:MUMZ.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/M" child update took:2
fg_serial line = 0)R!L

fg_serial line = 0

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

is orphan '.dirindex'
file exists hash is good:MUNB.threshold.xml
file exists hash is good:MUNG.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/N" child update took:1
fg_serial line = AR!

fg_serial line = AR!

is orphan '.dirindex'
file exists hash is good:MUPB.threshold.xml
file exists hash is good:MUPR.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/P" child update took:2
fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

is orphan '.dirindex'
file exists hash is good:MUSA.threshold.xml
file exists hash is good:MUSC.threshold.xml
file exists hash is good:MUSL.threshold.xml
file exists hash is good:MUSN.threshold.xml
file exists hash is good:MUSS.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/S" child update took:3
fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

is orphan '.dirindex'
file exists hash is good:MUTD.groundnet.xml
file exists hash is good:MUTD.threshold.xml
file exists hash is good:MUTD.twr.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/T" child update took:2
fg_serial line = 0

fg_serial line = A!

fg_serial line = aR!

fg_serial line = 0)R!

is orphan '.dirindex'
file exists hash is good:MUVR.groundnet.xml
file exists hash is good:MUVR.ils.xml
file exists hash is good:MUVR.threshold.xml
file exists hash is good:MUVR.twr.xml
file exists hash is good:MUVT.groundnet.xml
file exists hash is good:MUVT.threshold.xml
file exists hash is good:MUVT.twr.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/U/V" child update took:4
fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = AR!

is orphan '.dirindex'
file exists hash is good:MZ10.threshold.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/Z/1" child update took:1
fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = 0)!

is orphan '.dirindex'
file exists hash is good:MZ31.groundnet.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/Z/3" child update took:1
fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = AR!

is orphan '.dirindex'
file exists hash is good:MZBZ.threshold.xml
file exists hash is good:MZBZ.twr.xml
after update of:Path "C:/Users/elkouch/Documents/FlightGear/TerraSync/Airports/M/Z/B" child update took:2
fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!

Failed to sync'Airports/M'
fg_serial line = 0)!X

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = A!X

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!X

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = AR!X

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = AR!L

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = 0)!X

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = 0)!

fg_serial line = 0)!H

fg_serial line = 0)R!H

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = `R!

fg_serial line = AR!L

fg_serial line = 0)R!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!L

fg_serial line = 0)!H

fg_serial line = 0)!X

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!\

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = aR!L

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = 0)R!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)!X

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = A!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = 0)R!X

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!L

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = 0)!X

fg_serial line = a!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = 0

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = 0)R
Input line does not end with expected line separator.
fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = 0)R
Input line does not end with expected line separator.
fg_serial line = A!H

fg_serial line = 0)R!

fg_serial line = 0)!L

fg_serial line = 0)!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = 0)!L

fg_serial line = 0

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!L

fg_serial line = 0)!H

fg_serial line = 0)!L

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)R!H

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = AR!X

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = `R!L

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = A!X

fg_serial line = 0)R!

fg_serial line = 0)R !

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = aR!L

fg_serial line = 0)!L

fg_serial line = 0)!X

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = aR!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!X

fg_serial line = 0)R!L

fg_serial line = aR!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = 0)R!

fg_serial line = `R!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = AR!X

fg_serial line = 0      !

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = aR!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = aR!X

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = AR!X

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!H

fg_serial line = 0!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = A!L

fg_serial line = 0R!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!H

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = aR !

fg_serial line = AR!L

fg_serial line = 0)!L

fg_serial line = 0)!X

fg_serial line = 0)!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = `R!L

fg_serial line = 0

fg_serial line = 0)!

fg_serial line = 0)R
Input line does not end with expected line separator.
fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = aR!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = aR!X

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!X

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = aR!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = AR!H

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = 0)R!L

fg_serial line = 0

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = 0)!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = 0)!L

fg_serial line = 0!X

fg_serial line = 0)R !

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = A!H

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = aR!H

fg_serial line = 0)!

fg_serial line = AR
Input line does not end with expected line separator.
fg_serial line = aR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = AR!

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = `R!L

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!X

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = 0)!L

fg_serial line = 0!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = aR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = 0)R
Input line does not end with expected line separator.
fg_serial line = AR!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!L

fg_serial line = 0)R!

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = A!X

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = aR!H

fg_serial line = 0)!

fg_serial line = 0)R!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!H

fg_serial line = 0)!

fg_serial line = 0)R!

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = A!H

fg_serial line = 0)!

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = 0)!H

fg_serial line = 0)R!X

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = A!X

fg_serial line = 0      !L

fg_serial line = 0)!

fg_serial line = 0!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = 0)R!H

fg_serial line = 0)R!H

fg_serial line = 0

fg_serial line = AR!

fg_serial line = aR!

fg_serial line = A!X

fg_serial line = aR!

fg_serial line = A!

fg_serial line = 0)!L

fg_serial line = 0)R!L

fg_serial line = 0)R!L

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = 0)!L

fg_serial line = 0

fg_serial line = A!

fg_serial line = aR!

fg_serial line = AR!

fg_serial line = A!X

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = aR!L

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = aR!H

fg_serial line = 0)R!L

fg_serial line = 0)!L

fg_serial line = 0)!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR
Input line does not end with expected line separator.
fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = 0)R!L

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0      !

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = 0)R!

fg_serial line = aR!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = aR!

fg_serial line = A!L

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = aR!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR !L

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = 0)!H

fg_serial line = 0)R!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0!

fg_serial line = aR!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)R !L

fg_serial line = 0)R
Input line does not end with expected line separator.
fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = `R!

fg_serial line = A!L

fg_serial line = 0)!L

fg_serial line = 0!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR
Input line does not end with expected line separator.
fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = aR!

fg_serial line = 0)!

fg_serial line = AR!X

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)!L

fg_serial line = 0)!L

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = AR!H

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = 0)R!

fg_serial line = `R!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = `R!

fg_serial line = A!X

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = AR!L

fg_serial line = 0      !

fg_serial line = 0)!H

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = 0)!X

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!L

fg_serial line = 0)R!H

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = AR!

fg_serial line = 0)R
Input line does not end with expected line separator.
fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = `R!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = 0)!L

fg_serial line = 0      !

fg_serial line = AR!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = AR!X

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = AR!L

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = AR
Input line does not end with expected line separator.
fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!L

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = AR!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = `R!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = 0)!L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = `R!L

fg_serial line = 0)!L

fg_serial line = 0

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = aR!

fg_serial line = `R!X

fg_serial line = a!

fg_serial line = A!X

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0      !L

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)R!L

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!H

fg_serial line = 0)!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = a!

fg_serial line = 0)R!

fg_serial line = 0)R!

fg_serial line = A!L

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = a!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)R!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = `R!

fg_serial line = A!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!H

fg_serial line = AR!

fg_serial line = aR !L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = 0!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = `R!L

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = 0)!X

fg_serial line = AR!L

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = A!

fg_serial line = aR!L

fg_serial line = aR!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = aR!L

fg_serial line = 0)!

fg_serial line = 0)R!

fg_serial line = AR !

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = A!L

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = aR!L

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!L

fg_serial line = 0)!L

fg_serial line = 0!

fg_serial line = A!

fg_serial line = AR!

fg_serial line = aR!

fg_serial line = aR!

fg_serial line = A!L

fg_serial line = 0)!X

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = `R!X

fg_serial line = 0)R!

fg_serial line = `R!X

fg_serial line = 0)R!L

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = 0)!X

fg_serial line = 0)!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = aR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = a!L

fg_serial line = 0)!

fg_serial line = 0)!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = aR!L

fg_serial line = 0)R!

fg_serial line = 0)!X

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = `R!

fg_serial line = a!

fg_serial line = A!

fg_serial line = 0)R !

fg_serial line = aR!

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = aR!H

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)R!L

fg_serial line = 0)!

fg_serial line = aR!

fg_serial line = A!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = aR!

fg_serial line = AR!

fg_serial line = A!

fg_serial line = A!L

fg_serial line = 0!

fg_serial line = AR!

fg_serial line = AR!

fg_serial line = 0)R!

fg_serial line = A!

fg_serial line = A!

fg_serial line = a!

fg_serial line = A!L

fg_serial line = 0)R!X

fg_serial line = 0)!

fg_serial line = AR!L

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = 0)!X

fg_serial line = 0)!

fg_serial line = A!

fg_serial line = A!

fg_serial line = A!

fg_serial line = 0)R!

fg_serial line = 0)!

fg_serial line = A!



It looks like the end of line separator is not correctly interpretated by FG OR not correctly transmitted to FG.

In my Arduino code, I however have the following

Code: Select all
int switchPin = 10;    // switch on pin 10

void setup() {
  Serial.begin(9600);          // open serial connection
  pinMode(switchPin, INPUT);   // pin 10 declared as input
}

void loop() {

  Serial.print(digitalRead(switchPin));   // read and print switch state
  Serial.print("\n");
}


And in my .xml file in the protocols folder the following :

Code: Select all
<?xml version="1.0"?>

<PropertyList>

<generic>
    <input>
        <line_separator>\n</line_separator>
        <var_separator>,</var_separator>

        <chunk>
            <name>strobe</name>
            <node>/controls/lighting/strobe</node>
            <type>bool</type>
        </chunk>

    </input>
</generic>

</PropertyList>


I still don't know what is the problem exactly, but at least I know that the problem seems to come from the end of line separator...
Kikokou-san
 
Posts: 26
Joined: Wed Mar 15, 2017 9:55 am

Re: Help with interfacing FG and Arduino Pro Mini

Postby Kikokou-san » Thu Sep 07, 2017 8:47 am

Here are the news :

When I came back to "\n" as line separator, the start up phase began correctly until I continuously had messages in the console : fg_serial line = 0. So it still stays stuck, but at least the characters look to be correctly interpretated.

When I pressed the push button, the message became fg_serial line = 1 but something like 10 seconds after I pressed it, so there is a big latency (I don't know why).

Also, in fgfs_log, I noticed the following line being repeated endlessly :
Code: Select all
io:3:G:\Jenkins\workspace\Windows-release\simgear\simgear\io\sg_serial.cxx:122:fg_serial line = 0


So I went to check sg_serial.cxx and found the following :
Code: Select all
// Read data from port.  If we don't get enough data, save what we did
// get in the save buffer and return 0.  The save buffer will be
// prepended to subsequent reads until we get as much as is requested.

int SGSerial::read( char *buf, int length ) {
    int result;

    // read a chunk, keep in the save buffer until we have the
    // requested amount read

    char *buf_ptr = save_buf + save_len;
    result = port.read_port( buf_ptr, length - save_len );
   
    if ( result + save_len == length ) {
        std::strncpy( buf, save_buf, length );
   save_len = 0;

   return length;
    }
   
    return 0;
}


// read data from port
int SGSerial::readline( char *buf, int length ) {
    int result;

    // read a chunk, keep in the save buffer until we have the
    // requested amount read

    char *buf_ptr = save_buf + save_len;
    result = port.read_port( buf_ptr, SG_IO_MAX_MSG_SIZE - save_len );
    save_len += result;

    // look for the end of line in save_buf
    int i;
    for ( i = 0; i < save_len && save_buf[i] != '\n'; ++i );
    if ( save_buf[i] == '\n' ) {
   result = i + 1;
    } else {
   // no end of line yet
   return 0;
    }

    // we found an end of line

    // copy to external buffer
    std::strncpy( buf, save_buf, result );
    buf[result] = '\0';
    SG_LOG( SG_IO, SG_INFO, "fg_serial line = " << buf );

    // shift save buffer
    for ( i = result; i < save_len; ++i ) {
   save_buf[ i - result ] = save_buf[i];
    }
    save_len -= result;

    return result;
}


This at least explains why setting a different character than "\n" for the end of line was not working, because "\n" is wirtten in hard as end of line character so I guess what we put in the xml protocol file has no impact..

However, I still do not understand why FG stays stuck here and continuously displays fg_serial line = 0.......
Kikokou-san
 
Posts: 26
Joined: Wed Mar 15, 2017 9:55 am

Re: Help with interfacing FG and Arduino Pro Mini

Postby kbumbaz » Tue Jun 05, 2018 7:26 am

Dear Kikokou-san,

Have you been ablo to solve it ? or to find a way to interface your arduio.
I begin to be mad as my FG stuck at "finalising position". I can't beleive that on youtube you can see tons of DIY project and that in reality not ? realy strange, are we missing somehting really simple :twisted:

Thank you.
kbumbaz
 
Posts: 2
Joined: Tue Jun 05, 2018 7:00 am

Re: Help with interfacing FG and Arduino Pro Mini

Postby APower » Fri Aug 03, 2018 9:38 pm

I got my arduinos back online after upgrading my machine & Flightgear. I am using a Leonardo as a "joystick" & using a Mega2560 as a serial input.
Window 10 64-bit
i7-8700k
16 gb
Flightgear 2018.2.2

I was experiencing the same hanging. I tried many different things to figure out what was wrong.

I can now turn the problem on and off. To make the serial in function correctly, I open Arduino ide 1.0.5-r2-windows (1.6.8 will not do the trick). I open it, start the serial monitor to make sure the Mega is giving good input. Turn off the serial monitor but leave arduino ide running. Start fgfs.exe from my batch file. It is now working predictably.

I am now working through switching from FG_Panel to Phi. I am struggling with the 172p instrument panel not updating automatically / timely.
APower
 
Posts: 3
Joined: Fri Jan 02, 2015 5:58 pm


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 2 guests