Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

RPI 3B (to start with)

Install the latest version of Raspbian and configure to work headless.

Afterwords, update:

sudo apt update

Airtunes

This tutorial  involves configuring the the open-source AirPlay receiver called Shairport Sync. Most of the contents found in in this section were directly lifted from here.

This software allows the Raspberry Pi to act as an AirPlay receiver by implementing Apple’s proprietary protocols so that it can stream music, from the output audio jack to the auxiliary input of the FJ’s amplifier.

This setup will allow you to play music from any AirPlay-enabled device to your Raspberry Pi meaning you can use any iPhone and some Android products with a compatible app installed.

  1. First. we need to install several different packages, run the following commands on your Raspberry Pi to install all of the packages that we need.

sudo apt install autoconf libtool libdaemon-dev libasound2-dev libpopt-dev libconfig-dev
sudo apt install avahi-daemon libavahi-client-dev
sudo apt install libssl-dev 
  1. We will now clone the shairport-sync source to OpenFJ.

cd ~
git clone https://github.com/mikebrady/shairport-sync.git

We can now build and install the Shairport software.

cd shairport-sync
autoreconf -i -f
./configure --with-alsa --with-avahi --with-ssl=openssl --with-systemd --with-metadata

The autoreconf command setups the basic config file. The configure command further sets up the build system, telling it to utilize the ALSA audio backend, the Avahi network and set it to use OpenSSL for encryption.

  1. With the configuration process now completed we can compile Shairport-sync and install it.

make
sudo make install
  1. To enable the Shairport Sync software to start automatically at system startup:

sudo systemctl enable shairport-sync
sudo service shairport-sync start 

On an AirPlay-enabled device Openfj should appear in the devices list.

  1. There are several different things we can do to improve the sound quality. The first of these is to change update the RPI firmware to a newer version of the audio driver.

sudo rpi-update

 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Performing self-update
 *** Relaunching after update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
FW_REV:8e2a862c9c7a0cc5cd505c8f89761d723af8768c
 *** We're running for the first time
 *** Backing up files (this will take a few minutes)
 *** Backing up firmware
 *** Backing up modules 6.1.0-rpi4-rpi-v8
WANT_32BIT:0 WANT_64BIT:1 WANT_PI4:1 WANT_PI5:1
#############################################################
WARNING: This update bumps to rpi-6.1.y linux tree
See: https://forums.raspberrypi.com/viewtopic.php?t=344246

'rpi-update' should only be used if there is a specific
reason to do so - for example, a request by a Raspberry Pi
engineer or if you want to help the testing effort
and are comfortable with restoring if there are regressions.

DO NOT use 'rpi-update' as part of a regular update process.
##############################################################
Would you like to proceed? (y/N)
 *** Downloading specific firmware revision (this will take a few minutes)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 26  144M   26 37.5M    0     0  5043k      0  0:00:29  0:00:07  0:00:22 6101k
100  144M  100  144M    0     0  5514k      0  0:00:26  0:00:26 --:--:-- 4939k
 *** Updating firmware
 *** Updating kernel modules
 *** depmod 6.1.63-v8-16k+
 *** depmod 6.1.63-v8+
 *** Updating VideoCore libraries
 *** Using SoftFP libraries
 *** Updating SDK
 *** Running ldconfig
 *** Storing current firmware revision
 *** Deleting downloaded files
 *** Syncing changes to disk
 *** If no errors appeared, your firmware was successfully updated to 8e2a862c9c7a0cc5cd505c8f89761d723af8768c
 *** A reboot is needed to activate the new firmware
  1. Once the firmware update has completed, turn off the RPI and remove the SD Card, and mount into a reader connected to a computerto modify the RPI /boot/config.txt on the SD Card, with the following new line to this file.

audio_pwm_mode=2
  1. Insure the analog jack is the main audio out and not the HDMI output.
    We can utilize the following command in the Raspberry Pi’s terminal to do this.

amixer cset numid=3 1
  1. Now modify the volume db Range that Shairport uses by changing the configuration file:

sudo vi /usr/local/etc/shairport-sync.conf

Find

//      volume_range_db = 60 ;Copy

Replace with

        volume_range_db = 30;
  1. Finally, reboot OpenFJ:

sudo reboot

GPS NMEA

  1. Plug in the Garmin 296 GPS with a USB cable.

Does the RPI see the UPS?

mtb@openfj:~ $ lsusb
Bus 001 Device 004: ID 091e:0003 Garmin International GPS (various models)
Bus 001 Device 005: ID 0424:7800 Microchip Technology, Inc. (formerly SMSC) 
Bus 001 Device 003: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Install gpsd

sudo apt-get install gpsd gpsd-clients  

Deactivate gpsd

sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket

Start gpsd manually

sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock

Test (this may take several minutes to update, depending on GPS signal)

cgps -s

┌─ssssssssssssssssssssssssssssssssssssssssss┐┌─aaaaaaaaaaaaaaaaaSeen  0/Used  0┐
│ Time:        2023-11-22T16:36:14.000Z (18)││GNSS   PRN  Elev   Azim   SNR Use│
│ Latitude:         41.40120225 N           ││                                 │
│ Longitude:         2.15600508 E           ││                                 │
│ Alt (HAE, MSL):        n/a,       n/a     ││                                 │
│ Speed:             0.07 km/h              ││                                 │
│ Track (true, var):   184.0,   1.0     deg ││                                 │
│ Climb:           n/a                      ││                                 │
│ Status:         2D FIX (5 secs)           ││                                 │
│ Long Err  (XDOP, EPX):  n/a ,  n/a        ││                                 │
│ Lat Err   (YDOP, EPY):  n/a ,  n/a        ││                                 │
│ Alt Err   (VDOP, EPV):  n/a , +/- 75.5 m  ││                                 │
│ 2D Err    (HDOP, CEP):  n/a , +/- 53.2 m  ││                                 │
│ 3D Err    (PDOP, SEP):  n/a , +/- 92.4 m  ││                                 │
│ Time Err  (TDOP):       n/a               ││                                 │
│ Geo Err   (GDOP):       n/a               ││                                 │
│ ECEF X, VX:              n/a    n/a       ││                                 │
│ ECEF Y, VY:              n/a    n/a       ││                                 │
│ ECEF Z, VZ:              n/a    n/a       ││                                 │
│ Speed Err (EPS):        n/a               ││                                 │
│ Track Err (EPD):        n/a               ││                                 │
│ Time offset:            0.025000578 s     ││                                 │
│ Grid Square:            JN11bj86          ││                                 │
└─aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa┘└─eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee┘

Edit the gpsd configuration file:

mtb@openfj:~ $ cat /etc/default/gpsd 

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES=""

# Other options you want to pass to gpsd
START_DAEMON="true"
GPSD_OPTIONS="/dev/ttyUSB0"

# Automatically hot add/remove USB GPS devices via gpsdctl
USBAUTO="true"
GPSD_SOCKET="/var/run/gpsd.sock"

Enable the gpsd service

sudo systemctl enable gpsd.socket
sudo systemctl start gpsd.socket

location

gpspipe -r

gpsbabel

foxtrotgps

gpsmon

time

sudo apg-get install ntp

sudo vi /etc/ntpsec/ntp.conf

ntpq -p

LTE modem

FindMyCar

OBD-II - over bluetooth

Camera Module

ALPR

People counter

360?

Environmental sensors

SDL

pwnagotchi

WIGLE

TPMS

915Mhz sensor

  • No labels