Skip to content

Instantly share code, notes, and snippets.

@mliberty1
Last active October 20, 2020 20:49
Show Gist options
  • Save mliberty1/4bc1ed6ec23904e5be66fda54f9ad75d to your computer and use it in GitHub Desktop.
Save mliberty1/4bc1ed6ec23904e5be66fda54f9ad75d to your computer and use it in GitHub Desktop.
Raspberry PI Installation Instructions

Raspberry Pi Installation Instructions

https://github.com/wimpysworld/desktopify https://www.youtube.com/watch?v=umtZuUJOU38 @13:33

These instructions describe how to use a Joulescope with a Raspberry Pi 4 B with 8GB RAM.

Install Ubuntu with desktop and dependencies:

USe Raspberry Pi imager to install Ubuntu Server 20.04 LTS x64 on SD card.  
Insert SD card into Raspberry Pi 4 and power on.
Login with username 'ubuntu' and password 'ubuntu'.  Set new password.
sudo apt update
sudo apt upgrade
free -m
git clone https://github.com/wimpysworld/desktopify.git
cd desktopify
sudo ./desktopify -de ubuntu
sudo apt install python3-pip python3-venv
sudo reboot

Configure Joulescope permissions

Open terminal (CTRL-SHIFT-T) or ssh ubuntu@{ip_addr} and type:

wget https://raw.githubusercontent.com/jetperch/pyjoulescope/master/99-joulescope.rules
sudo cp 99-joulescope.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules

Connect your Joulescope

Configure Joulescope software in python virtual environment

python3 -m venv ~/venv/joulescope
. ~/venv/joulescope/bin/activate
pip3 install -U joulescope
joulescope info

Build Qt

https://wiki.qt.io/Building_Qt_5_from_Git#Getting_the_source_code https://doc.qt.io/qt-5/configure-options.html https://wiki.qt.io/Native_Build_of_Qt5_on_a_Raspberry_Pi https://github.com/UvinduW/Cross-Compiling-Qt-for-Raspberry-Pi-4 Then you will need to enable the "Source code" option in Software and Updates > Ubuntu Software under the "Downloadable from the Internet" section. This setting can also be found by running software-properties-gtk.

sudo apt update && sudo apt upgrade
sudo apt build-dep qt5-default
sudo apt install libxcb-xinerama0-dev build-essential cmake llvm-dev llvm-runtime

I also did this before I learned about "sudo apt build-dep qt5-default":

sudo apt-get install libpng-dev libfontconfig1-dev libdbus-1-dev libfreetype6-dev libudev-dev libicu-dev libsqlite3-dev \
libxslt1-dev libssl-dev libasound2-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
libpulse-dev libx11-dev libglib2.0-dev libcups2-dev freetds-dev libsqlite0-dev libpq-dev \
libiodbc2-dev libmysqlclient-dev firebird-dev libjpeg-dev libgst-dev libxext-dev libxcb1 libxcb1-dev \
libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 \
libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync1 libxcb-sync-dev libxcb-render-util0 \
libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev \
libxi-dev libdrm-dev libssl-dev libxcb-xinerama0 libxcb-xinerama0-dev \
llvm-dev llvm-runtime

Now configure & build

mkdir ~/build && cd $_
wget https://download.qt.io/official_releases/qt/5.15/5.15.1/single/qt-everywhere-src-5.15.1.tar.xz
tar xfv qt-everywhere-src-5.15.1.tar.xz
cd qt-everywhere-src-5.15.1
export LD_LIBRARY_PATH=/usr/local/lib
export LLVM_INSTALL_DIR=/usr/lib/llvm-10
./configure -release -opengl es2 -eglfs -device linux-rasp-pi4-v3d-g++ -sysroot ~/rpi/sysroot -prefix /usr/local/qt5.15.1 -extprefix ~/rpi/qt5.15.1 -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -make libs -pkg-config -no-use-gold-linker -v -recheck

FAILS:

Project ERROR: Cannot run target compiler 'g++'. Output:
==================
sing built-in specs.
OLLECT_GCC=g++
++: error: unrecognized command line option '-mfpu=crypto-neon-fp-armv8'
++: error: unrecognized command line option '-mfloat-abi=hard'
arget: aarch64-linux-gnu
onfigured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
hread model: posix
cc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
==================
aybe you forgot to setup the environment?

Once this succeeds:

make -j8
checkinstall

Build PySide2

wget https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.1-src/pyside-setup-opensource-src-5.15.1.tar.xz
tar xfv pyside-setup-opensource-src-5.15.1.tar.xz

Remainder from first attempt

sudo apt remove python3-pyside2.qt3dcore python3-pyside2.qt3dinput python3-pyside2.qt3dlogic python3-pyside2.qt3drender python3-pyside2.qtcharts python3-pyside2.qtconcurrent python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qthelp python3-pyside2.qtlocation python3-pyside2.qtmultimedia python3-pyside2.qtmultimediawidgets python3-pyside2.qtnetwork python3-pyside2.qtopengl python3-pyside2.qtpositioning python3-pyside2.qtprintsupport python3-pyside2.qtqml python3-pyside2.qtquick python3-pyside2.qtquickwidgets python3-pyside2.qtscript python3-pyside2.qtscripttools python3-pyside2.qtsensors python3-pyside2.qtsql python3-pyside2.qtsvg python3-pyside2.qttest python3-pyside2.qttexttospeech python3-pyside2.qtuitools python3-pyside2.qtwebchannel python3-pyside2.qtwebsockets python3-pyside2.qtwidgets python3-pyside2.qtx11extras python3-pyside2.qtxml python3-pyside2.qtxmlpatterns

https://wiki.qt.io/Building_Qt_5_from_Git#Getting_the_source_code

git clone git://code.qt.io/qt/qt5.git
cd qt5
git checkout 5.15.1
perl init-repository

Go do something else. This takes a while.

sudo apt install llvm-dev llvm-runtime
export LLVM_INSTALL_DIR=/usr/lib/llvm-10
mkdir ~/repos/qt5-build && cd $_
~/repos/qt5/configure -developer-build -opensource -nomake examples -nomake tests
make -j8

https://doc.qt.io/qtforpython/gettingstarted-linux.html sudo apt install build-essential clang cmake mkdir repos && cd $_ git clone https://code.qt.io/pyside/pyside-setup cd pyside-setup git checkout 5.15.1

git clone https://github.com/jetperch/pyjoulescope_ui.git cd pyjoulescope_ui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment