Open smaderak opened 5 years ago
Starting with a new raspbian buster lite image, and using the mkimg.sh script as a guide, I followed these approximate steps and seem to have a working image (not properly tested, but boots, web interface comes up, and gets a GPS fix). The notes below are pretty raw but they might help someone, and if I've made any glaring mistakes (which seems likely since this is my first attempt at this) please let me know.
• copy the buster lite image to your SD card • enable ssh with file in boot • boot up • change pi user's password • disable vnc, enable i2c and other settings in raspi-config
# update the base image sudo apt-get install rpi-update sudo apt-get update sudo apt-get dist-upgrade sudo apt-get upgrade
# install dependencies sudo apt-get install -y vim sudo apt-get install -y iw sudo apt-get install -y lshw sudo apt-get install -y wget sudo apt-get install -y gpsd sudo apt-get install -y hostapd sudo apt-get install -y isc-dhcp-server sudo apt-get install -y tcpdump sudo apt-get install -y libusb-1.0-0-dev sudo apt-get install -y build-essential sudo apt-get install -y cmake sudo apt-get install -y golang sudo apt-get install -y mercurial sudo apt-get install -y autoconf sudo apt-get install -y fftw3 sudo apt-get install -y fftw3-dev sudo apt-get install -y libtool sudo apt-get install -y automake sudo apt-get install -y pkg-config sudo apt-get install -y libjpeg-dev i2c-tools python-smbus python-pip python-dev python-pil python-daemon screen sudo apt-get install -y libsdl-dev sudo apt-get install -y git git config --global http.sslVerify false
# download and compile github packages sudo mkdir /opt/stratux sudo chown pi.pi /opt/stratux cd /opt/stratux git clone --recursive https://github.com/cyoung/stratux.git mv stratux stratux_src
cd /opt/stratux git clone git clone https://github.com/jpoirier/librtlsdr mv librtlsdr librtlsdr_src cd librtlsdr_src mkdir build cd build cmake ../ make sudo make install sudo ldconfig
cd /opt/stratux git clone https://github.com/steve-m/kalibrate-rtl mv kalibrate-rtl kalibrate-rtl_src cd kalibrate-rtl_src ./bootstrap ./configure make sudo make install
sudo apt-get purge wiringpi cd /opt/stratux git clone https://github.com/WiringPi/WiringPi.git mv WiringPi wiringPi_src cd wiringPi_src # move back to a commit prior to the elimination of static linking # it would likely be better to use the dynamically linked version git checkout 0f7d03d9f04c226192c299dafe03e1d56ec219c9 sudo ./build cd wiringPi make static sudo make install-static
• update .bashrc with GOROOT, GOPATH, PATH, CGO_FLAGS_ALLOW as follows: export GOPATH=/home/pi/go export GOROOT=/usr/lib/go-1.11 (use whatever comes back from go env | grep GOROOT) export CGO_CFLAGS_ALLOW=-L/opt/stratux/stratux_src export PATH=$GOPATH/bin:$PATH • log out and back in or source the .bashrc file • edit the dump1090 make file and remove flag Werror as there is a warning for data truncation that prevents compiling... "interactive.c:140:44: error: '%03d' directive output may be truncated writing between 3 and 9 bytes into a region of size 5 [-Werror=format-truncation=]"
cd /opt/stratux/stratux_src make • remove check from Makefile for GOROOT as it isn't detecting a set env var during make install sudo make install
# copy various configs to their proper locations sudo cp -f /opt/stratux/stratux_src/image/motd /etc/motd sudo cp -f /opt/stratux/stratux_src/image/dhcpd.conf /etc/dhcp/dhcpd.conf sudo cp -f /opt/stratux/stratux_src/image/hostapd.conf /etc/hostapd/hostapd.conf sudo cp -f /opt/stratux/stratux_src/image/hostapd-edimax.conf /etc/hostapd/hostapd-edimax.conf sudo cp -f /opt/stratux/stratux_src/image/hostapd_manager.sh /usr/sbin/hostapd_manager.sh sudo chmod 755 /usr/sbin/hostapd_manager.sh sudo cp -f /opt/stratux/stratux_src/image/hostapd-edimax /usr/sbin/hostapd-edimax sudo rm -f mnt/etc/rc.d/hostapd mnt/etc/network/if-pre-up.d/hostapd mnt/etc/network/if-post-down.d/hostapd mnt/etc/init.d/hostapd mnt/etc/default/hostapd sudo cp -f /opt/stratux/stratux_src/image/stratux-wifi.sh /usr/sbin/stratux-wifi.sh sudo chmod 755 /usr/sbin/stratux-wifi.sh sudo cp -f /opt/stratux/stratux_src/image/sdr-tool.sh /usr/sbin/sdr-tool.sh sudo chmod 755 /usr/sbin/sdr-tool.sh sudo cp -f /opt/stratux/stratux_src/image/*.rules /etc/udev/rules.d/ sudo rm -rf /usr/bin/fancontrol.py sudo cp -f /opt/stratux/stratux_src/image/stxAliases.txt /root/.stxAliases sudo cp -f /opt/stratux/stratux_src/image/stxAliases.txt /home/pi/.stxAliases sudo cp -f /opt/stratux/stratux_src/image/rtl-sdr-blacklist.conf /etc/modprobe.d sudo cp -f /opt/stratux/stratux_src/test/screen/screen.py /usr/bin/stratux-screen.py sudo mkdir -p /etc/stratux-screen/ sudo cp -f /opt/stratux/stratux_src/test/screen/stratux-logo-64x64.bmp /etc/stratux-screen/stratux-logo-64x64.bmp sudo cp -f /opt/stratux/stratux_src/test/screen/CnC_Red_Alert.ttf /etc/stratux-screen/CnC_Red_Alert.ttf sudo cp -f /opt/stratux/stratux_src/libsystemdsystemstratux.service /lib/systemd/system/stratux.service sudo cp -f /opt/stratux/stratux_src/rootstratux-pre-start.sh /home/pi/stratux-pre-start.sh sudo ln -s /home/pi/stratux-pre-start.sh /root/stratux-pre-start.sh sudo cp -f /opt/stratux/stratux_src/image/rc.local /etc/rc.local
# do a few manual steps • update the dhcpcd.conf file instead of using interfaces file to set static ip for wlan0 • edit the /home/pi/stratux-pre-start.sh script to call stratus-wifi.sh since the post-up isn't available... there's probably a better way to do this... • update /etc/default/isc-dhcp-server (bundled one is for older version so don't copy it) • update /boot/config.txt with parameters from /opt/stratux/stratux_src/image/config.txt
sudo sed -i /boot/cmdline.txt -e "s/console=ttyAMA0,[0-9]+ //" sudo sed -i /etc/default/keyboard -e "/^XKBLAYOUT/s/\".*\"/\"us\"/"
# update services sudo systemctl disable hciuart sudo systemctl disable isc-dhcp-server sudo systemctl enable stratux
sudo reboot
Stratux version: latest (build from source)
Stratux config:
SDR
GPS
AHRS
power source: AC powered USB charger.
usb cable: Random, but known good cable
EFB app and version: ForeFlight
Description of your issue: I'm attempting to do a full build from source on a 3B+ starting from a base Raspbian image. I have found several packages that seem to be necessary for full functionality, but, if missing, do not prevent the Stratux build from finishing (i.e. gpsd, hostapd, etc.). Would it be possible to get a list of the required packages. It would be somewhat amazing if you had a build script sitting around that you could share.