flyonspeed / tronview Goto Github PK
View Code? Open in Web Editor NEWProject for connecting efis flight data to a HUD or 2nd screen. Written in Python. And designed to run on a Raspberry Pi.
License: GNU General Public License v3.0
Project for connecting efis flight data to a HUD or 2nd screen. Written in Python. And designed to run on a Raspberry Pi.
License: GNU General Public License v3.0
In info, it says that setup.sh is under TronView/util. It is supposed to be under TronView/util/rpi. Simple fix by changing the location in the setup instructions
The latest commit where the scripts were reformatted to Python 3 standards prevents them from running on the default Python version on the RPi.
I used this link to figure out how to change the default version of Python from 2.7 to the the 3.5 version which is also installed.
https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux
Would be nice if we could run the project on other OS's like Windows and Mac by loading the appropriate versions of Python and Pygame on them. As it sits today there are some issues that prevent this from working:
The screen size discovered by Pygame ends up being the Windows display size which in most cases will be way too big. Some sort of solution to detect what platform it is running on would be good to work out the logic on the screen size arguments.
Currently demo mode does not work when running on Windows and I have not discovered why. The Hud display opens and appears normal but it is not stepping thru the demo files to simulate the EFIS data stream. It basically just sits and appears frozen.
Switching the HUD display to text mode while its already running in demo mode causes a crash with an error about 'clear' not being a program or executable.
Launching the HUD display normal and text mode where it is trying to access the serial port causes an error because the serial port access is different on the RPi vs others like Windows. Again if some sort of solution to detect what platform it is running on might be a way to work out the arguments.
Anyone volunteer to take on the challenge?
When running in the diagnostic text mode and the esc key is pressed, program crashes trying to load a screen module.
Add scripting to setup.sh that adds Python 3.x to the available versions and makes it the default for running Python scripts.
Kivic Hud confirmed to work using the composite video output of the RPi 3B+. Had to customize the config.txt file to get the correct overscan settings. So far so good....
This is a todo for me. I would like to convert the calculations that were developed inside of serial_g3x input module to reusable functions that can have the appropriate variables passed in with the results passed out. This would make it easier for anyone to use them in the future on other input modules. I need to learn how to properly do this before I make a go at it.
Hi ๐
I posted this a while ago, figured you might be interested! You have actual experience building HUDs, so would very much value your input!
Question for you while I'm here... have you found any docs on Dynon's Wifi TCP/UDP data stream protocol? Not sure if it's just the same protocol as the serial port or what, but cant find anything for docs on it. I don't have access to any decent avionics to play with ๐
I have set it up using the instructions in TronView/docs/rpi_setup.md.
I have two issues that prevent me from running the application with the example data. When I run the main.py file, the screen shows the example display correctly, but it is a static image as the python file hits an exception and does not continue to run.
(1) During setup.sh, when trying to install python-pygame and python-serial, they are not available. See below:
Errors installing python-pygame and python-serial:
pi@raspberrypi:~/efis_to_hud $ util/rpi/setup.sh
Setup Pi for running HUD software? (y or n)
y
Enabling serial port
disable splash image
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-pygame is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package python-serial is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-serial' has no installation candidate
E: Package 'python-pygame' has no installation candidate
E: Unable to locate package python-pyaudio
(2) When trying to run main.py with example data, I get an exception in Thread-1.
pi@raspberrypi:~/efis_to_hud $ sudo python main.py -i serial_d100 -e
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Creating DataRecorder dir: /flightlog/
armv7l
Running on RaspberryPi
Input data module 0: serial_d100
armv7l
Opening Logfile: lib/inputs/_example_data/dynon_d100_data1.txt
speed distance format: mph
temperature format: C
Loading screen module: Default
pygame-menu 4.3.6
No protocol specified
No protocol specified
sys.platform:linux
platform.machine:armv7l
default to XDisplay :10.0
Init Screen: Default 1920x1080
Init Mod: ArtificalHorz 1920x1080
Init Mod: Horizon 1920x1080
HUD x degree_per_pixel: 0.006771
Init Mod: HUD AOA 120x1070
Init Mod: Slip Skid 250x50
Init Mod: Menu 400x300
Init Mod: Traffic Scope 400x400
SmartDisplay drawable offset: 0,0 to 1920,1080
SmartDisplay New screen width/height: 1920,1080
SmartDisplay center x/y: 960,540
SmartDisplay real center x/y: 960,540
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/home/pi/efis_to_hud/main.py", line 52, in run
shared.aircraft = shared.CurrentInput.readMessage(shared.aircraft)
File "/home/pi/efis_to_hud/lib/inputs/serial_d100.py", line 108, in readMessage
self.ser.flushInput() # flush the serial after every message else we see delays
AttributeError: '_io.TextIOWrapper' object has no attribute 'flushInput'
This was all being done on a fresh install of Raspberry Pi OS (32 bit), kernel 5.15, debian version 11.
Any help would be great! I would love to get this up and running to pull EFIS and EMS data from my Dynon D100 series device in real time.
Chris,
Can you give us a little history on what IDE you are using for your Python script development and what OS you are running it in? Maybe a little detail around your workflow.
Have you been able to emulate the HUD using Python for Windows? Do you think this is possible?
I assume this repository is the working copy of the HUD and the reorganization/rework you are doing will come in a later repository you will share with us?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.