-
Notifications
You must be signed in to change notification settings - Fork 0
Setup Steps for Raspberry Pi
Raspberry Pi based Electronic Flight Information System (PiEfis)
-
sudo raspi-confignote: raspi-config changes from time to time so the selections below may not exactly match the version of raps-config installed on you Pi.- -> 1 System Options -> S5 Boot / Auto Login -> B2 Console Autologin
-
The following are optional
- If you want to use Wi-Fi the country needs to be set.
- -> 5 Localisation Options -> L4 WLAN Country -> select appropriate country
- -> 1 System Options -> S1 Wireless LAN -> set the SSID and password as appropriate
- If you want to change the host name so that it is easier to find on your network.
- -> 1 System Options -> S4 Hostname
- If you want to be able to SSH to your PiEfis. (This can be helpful while setting everything up.)
- -> 3 Interface Options -> P2 SSH
First update package list and update all installed packages
sudo apt updatesudo apt full-upgrade
The following packages install the required library to support WebGL, X11 (the graphical interface) the browser, uncluttered (to hide the mouse pointer)
sudo apt install libgles2sudo apt install --no-install-recommends xserver-xorg x11-xserver-utils xinitsudo apt install --no-install-recommends chromium-browsersudo apt install unclutter
Follow the steps to enable your CAN interface. This will generally involve turning on the SPI interface and enabling the appropriate overlay for your CAN interface. For CAN interfaces based on the Microchip MCP2515 you will likely need to do the following, but you should always check the instructions for your interface. The steps below are just for reference:
-
sudo raspi-config- -> 3 Interface Options -> P4 SPI - enable the SPI interface. note: SPI is enabled in /boot/config.txt by adding or uncommenting the line shown below. This is what enabling the SPI option in raspy-config does.
dtparam=spi=on
- Edit /boot/config.txt using the command
sudo nano /boot/config.txt - Add the following line at the end of the file.
dtoverlay=mcp2515-can0,oscillator=12000000,interrupt=25,spimaxfrequency=2000000
- You need to check the frequency of the oscillator/crystal on your CAN board and ensure that the frequency entered into the config.txt file matches. If you find your board doesn't work you can try reducing the spimaxfrequency value. Some boards need 1000000.
- To save the file and exit the nano editor type
ctrl-sandctrl-x.
If required, follow instructions on https://www.raspberrypi.org/forums/viewtopic.php?t=24679#p227301 to set the proper resolution
mkdir ~/Python_Avionicsmkdir ~/Python_Avionics/support- Copy the files from
RPi4andRPi4/supportin the repo to~/Python_Avionicsand~/Python_Avionics/support
sudo apt install --no-install-recommends python3-pipsudo pip3 install asynciosudo pip3 install aiohttpsudo pip3 install python-can
- Edit /boot/config.txt using the command
sudo nano /boot/config.txtand add the lines below at the end of the file. This will enable turbo mode for 60 seconds to speed up booting. The splash screen will be disabled and the boot delay is set to 0 seconds
initial_turbo=60
disable_splash=1
boot_delay=0
- Add
quietto/boot/cmdline.txt. note: Originally includedfast bootafterquiet
- Copy the file
linux/interface-canfrom the repo to the directory/etc/network/interfaces.d - Add contents of
linux/.xinitrcfrom repo into file~/.xinitrc - Add contents of
linux/.bash_profilefrom repo into file~/.bash_profile - Copy the file
linux/piefis.servicefrom repo to/etc/systemd/system/piefis.service sudo systemctl enable piefis.servicesudo /sbin/ip link set can0 up type can bitrate 500000
-
sudo systemctl disable ssh# If you don't need SSH to access the Pi -
sudo systemctl disable hciuart# Disables the UARTS so you cannot connect vi Serial -
sudo systemctl disable nmbd# If you have samba installed -
sudo systemctl disable smbd# If you have samba installed -
sudo systemctl disable systemd-timesyncd# Disables time sync across the network -
sudo systemctl disable wpa_supplicant# Disables WPA for wifi network connections -
sudo systemctl disable rpi-eeprom-update# Disables eeprom updates on boot -
sudo systemctl disable raspi-config# Disables rasps-config from updating the system on boot -
sudo systemctl disable dhcpcd# Disables dhcp
Now when you reboot the system should start into startx and run Chromium with http://localhost:8080.