From 8c90b0e340c669d3001377d498ed557bf59a14e8 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 19 Dec 2023 08:29:20 -0500 Subject: [PATCH 01/30] Create main.yml --- .github/workflows/main.yml | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..b4068dd --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,68 @@ +name: Build driver +on: + push: + branches: + - 'master' + - 'releases/**' + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Fetch tags + run: git fetch --tags --force + + # From https://github.com/pguyot/arm-runner-action/blob/main/.github/workflows/test-cache.yml + - uses: actions/cache@v3 + id: cache + with: + path: $RUNNER_TEMP/photon_libcam_builder.img + key: ${{ hashFiles('**/*.yml') }} + - uses: pguyot/arm-runner-action@HEAD + id: install_deps + if: steps.cache.outputs.cache-hit != 'true' + with: + # we don't want to optimize as it's two-stage + optimize_image: no + image_additional_mb: 1500 + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz + commands: | + apt-get update + apt-get install -y libopencv-dev libegl1-mesa-dev libcamera-dev cmake build-essential libdrm-dev libgbm-dev default-jdk openjdk-17-jdk + + - name: Move and rename image with dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: | + export IMAGE=photonvision_$(git describe --tags --match=v*).img + mv ${{ steps.install_deps.outputs.image }} $RUNNER_TEMP/$IMAGE + tar -cJf $IMAGE.tar.xz $RUNNER_TEMP/$IMAGE + + - uses: actions/upload-artifact@master + with: + name: photon-image + path: "*.tar.xz" + + # Push to dev release on pushes to master + - uses: pyTooling/Actions/releaser@r0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag: 'Dev' + rm: true + files: | + *.tar.xz + if: github.event_name == 'push' + + # Push to actual release, if tagged + - uses: softprops/action-gh-release@v1 + with: + files: | + *.tar.xz + if: startsWith(github.ref, 'refs/tags/v') + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 26a92b073ca1be9ff41dd8959aed137f6d2fc4bb Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 19 Dec 2023 08:31:13 -0500 Subject: [PATCH 02/30] Update main.yml --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4068dd..43708e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,8 +33,7 @@ jobs: image_additional_mb: 1500 base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz commands: | - apt-get update - apt-get install -y libopencv-dev libegl1-mesa-dev libcamera-dev cmake build-essential libdrm-dev libgbm-dev default-jdk openjdk-17-jdk + apt-get update # TODO - name: Move and rename image with dependencies if: steps.cache.outputs.cache-hit != 'true' From e7182befcebecda92b127ef7b12e59d3069a750d Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 19 Dec 2023 19:40:27 -0500 Subject: [PATCH 03/30] Update install script --- .github/workflows/main.yml | 2 +- install_pi.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 install_pi.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 43708e5..4f31aaf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: image_additional_mb: 1500 base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz commands: | - apt-get update # TODO + ./install_pi.sh - name: Move and rename image with dependencies if: steps.cache.outputs.cache-hit != 'true' diff --git a/install_pi.sh b/install_pi.sh new file mode 100755 index 0000000..9e83c8e --- /dev/null +++ b/install_pi.sh @@ -0,0 +1,11 @@ +# Run normal photon instarller + +cd /tmp +wget https://git.io/JJrEP -O install.sh +chmod +x install.sh +sudo ./install.sh + +# and edit boot partition + +find /boot/ +cat /boot/config.txt From d1f734e1f69c785fd7e11925c16bcbc1940d377e Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 19 Dec 2023 19:43:04 -0500 Subject: [PATCH 04/30] Build for LL too --- .github/workflows/main.yml | 39 +++++++++++++++----------------------- install_limelight.sh | 11 +++++++++++ 2 files changed, 26 insertions(+), 24 deletions(-) create mode 100755 install_limelight.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f31aaf..6aff1d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,8 +10,19 @@ on: jobs: build: runs-on: ubuntu-latest - steps: + strategy: + fail-fast: false + matrix: + include: + - name: limelight + script: ./install_limelight.sh + - name: raspi + script: ./install_pi.sh + + name: "Build for ${{ matrix.name }}" + + steps: - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -32,36 +43,16 @@ jobs: optimize_image: no image_additional_mb: 1500 base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz - commands: | - ./install_pi.sh + commands: ${{ matrix.script }} - name: Move and rename image with dependencies if: steps.cache.outputs.cache-hit != 'true' run: | - export IMAGE=photonvision_$(git describe --tags --match=v*).img + export IMAGE=photonvision_$(git describe --tags --match=v*)_${{ matrix.name }}.img mv ${{ steps.install_deps.outputs.image }} $RUNNER_TEMP/$IMAGE tar -cJf $IMAGE.tar.xz $RUNNER_TEMP/$IMAGE - uses: actions/upload-artifact@master with: - name: photon-image + name: photon-image-${{ matrix.name }} path: "*.tar.xz" - - # Push to dev release on pushes to master - - uses: pyTooling/Actions/releaser@r0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag: 'Dev' - rm: true - files: | - *.tar.xz - if: github.event_name == 'push' - - # Push to actual release, if tagged - - uses: softprops/action-gh-release@v1 - with: - files: | - *.tar.xz - if: startsWith(github.ref, 'refs/tags/v') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/install_limelight.sh b/install_limelight.sh new file mode 100755 index 0000000..9e83c8e --- /dev/null +++ b/install_limelight.sh @@ -0,0 +1,11 @@ +# Run normal photon instarller + +cd /tmp +wget https://git.io/JJrEP -O install.sh +chmod +x install.sh +sudo ./install.sh + +# and edit boot partition + +find /boot/ +cat /boot/config.txt From 418f9792680f65d571740649e736ad962054dd4f Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 19 Dec 2023 19:49:12 -0500 Subject: [PATCH 05/30] Update main.yml --- .github/workflows/main.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6aff1d9..bccd299 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,8 +17,10 @@ jobs: include: - name: limelight script: ./install_limelight.sh + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz - name: raspi script: ./install_pi.sh + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz name: "Build for ${{ matrix.name }}" @@ -33,19 +35,21 @@ jobs: - uses: actions/cache@v3 id: cache with: - path: $RUNNER_TEMP/photon_libcam_builder.img - key: ${{ hashFiles('**/*.yml') }} + path: $RUNNER_TEMP/base_system.img + key: ${{ matrix.base_image }} + + # Grab if we couldn't find it in the cache + - run: wget -O $RUNNER_TEMP/base_system.img ${{ matrix.base_image }} + if: steps.cache.outputs.cache-hit != 'true' + - uses: pguyot/arm-runner-action@HEAD id: install_deps - if: steps.cache.outputs.cache-hit != 'true' with: - # we don't want to optimize as it's two-stage - optimize_image: no image_additional_mb: 1500 - base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz + base_image: ${{ matrix.base_image }} commands: ${{ matrix.script }} - - name: Move and rename image with dependencies + - name: Compress built image if: steps.cache.outputs.cache-hit != 'true' run: | export IMAGE=photonvision_$(git describe --tags --match=v*)_${{ matrix.name }}.img From f6d758a8bf64a538ba129c9d9fc9a2cba4998373 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 21 Dec 2023 10:20:37 -0800 Subject: [PATCH 06/30] Fix cache path --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bccd299..79a1ad6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,7 +50,6 @@ jobs: commands: ${{ matrix.script }} - name: Compress built image - if: steps.cache.outputs.cache-hit != 'true' run: | export IMAGE=photonvision_$(git describe --tags --match=v*)_${{ matrix.name }}.img mv ${{ steps.install_deps.outputs.image }} $RUNNER_TEMP/$IMAGE @@ -59,4 +58,4 @@ jobs: - uses: actions/upload-artifact@master with: name: photon-image-${{ matrix.name }} - path: "*.tar.xz" + path: "$RUNNER_TEMP/base_system.img" From 3e913f9669d9d1b2b1ec06c39637bd5e5a3f7027 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 21 Dec 2023 10:34:14 -0800 Subject: [PATCH 07/30] Actually use the right image and stuff --- .github/workflows/main.yml | 6 +++--- config.txt | 42 ++++++++++++++++++++++++++++++++++++++ install_pi.sh | 3 +++ userconf.txt | 1 + 4 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 config.txt create mode 100644 userconf.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79a1ad6..dd37a86 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,16 +46,16 @@ jobs: id: install_deps with: image_additional_mb: 1500 - base_image: ${{ matrix.base_image }} + base_image: file://$RUNNER_TEMP/base_system.img commands: ${{ matrix.script }} - name: Compress built image run: | export IMAGE=photonvision_$(git describe --tags --match=v*)_${{ matrix.name }}.img mv ${{ steps.install_deps.outputs.image }} $RUNNER_TEMP/$IMAGE - tar -cJf $IMAGE.tar.xz $RUNNER_TEMP/$IMAGE + tar -cJf $RUNNER_TEMP/$IMAGE.tar.xz $RUNNER_TEMP/$IMAGE - uses: actions/upload-artifact@master with: name: photon-image-${{ matrix.name }} - path: "$RUNNER_TEMP/base_system.img" + path: $RUNNER_TEMP/$IMAGE.tar.xz diff --git a/config.txt b/config.txt new file mode 100644 index 0000000..bf51113 --- /dev/null +++ b/config.txt @@ -0,0 +1,42 @@ +# Automatically load overlays for detected DSI displays/cameras +display_auto_detect=1 +camera_auto_detect=1 + +# Enable DRM VC4 V3D driver +dtoverlay=vc4-kms-v3d +max_framebuffers=2 + +# Run in 64-bit mode +arm_64bit=1 + +# Disable compensation for displays with overscan +disable_overscan=1 + +[cm4] +# Enable host mode on the 2711 built-in XHCI USB controller. +# This line should be removed if the legacy DWC2 controller is required +# (e.g. for USB device mode) or if USB support is not required. +otg_mode=1 + +[pi4] +# Run as fast as firmware / board allows +arm_boost=1 + +[all] +############################################################## +### PHOTONVISION CAM CONFIG +### Comment/Uncomment to change which camera is supported +### Picam V1, V2 or HQ: uncomment (remove leading # ) from camera_auto_detect=1, +### and comment out all following lines +### IMX290/327/OV9281/Any other cameras that require additional overlays: +### Comment out (add a # ) to camera_auto_detect=1, and uncomment the line for +### the sensor you're trying to user + +camera_auto_detect=1 + +# dtoverlay=imx290,clock-frequency=74250000 +# dtoverlay=imx290,clock-frequency=37125000 +# dtoverlay=imx378 +# dtoverlay=ov9281 + +############################################################## \ No newline at end of file diff --git a/install_pi.sh b/install_pi.sh index 9e83c8e..21b1175 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -9,3 +9,6 @@ sudo ./install.sh find /boot/ cat /boot/config.txt + +install -m 644 config.txt /boot/ +install -m 644 userconf.txt /boot/ diff --git a/userconf.txt b/userconf.txt new file mode 100644 index 0000000..d1b029e --- /dev/null +++ b/userconf.txt @@ -0,0 +1 @@ +pi:$6$FynrpHenSGZpjaO9$FUmJ07FFhXkRfO3I3JadUX3oZ6sE4GTTVUTG93c2ocddxCI0TA.kmpIQfu/1A4wt5ixe7IBbncNaraje.NYpM/ \ No newline at end of file From 83594509cbf76f132ebc8869b8b44b6d531d4ee1 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 21 Dec 2023 11:11:49 -0800 Subject: [PATCH 08/30] Install all the things --- files/rpi-blacklist.conf | 6 + files/wait.conf | 3 + install_limelight.sh | 23 +- install_pi.sh | 20 +- limelight/config.txt | 57 ++++ limelight/gloworm-dt.dts | 607 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 711 insertions(+), 5 deletions(-) create mode 100644 files/rpi-blacklist.conf create mode 100644 files/wait.conf create mode 100644 limelight/config.txt create mode 100644 limelight/gloworm-dt.dts diff --git a/files/rpi-blacklist.conf b/files/rpi-blacklist.conf new file mode 100644 index 0000000..19083c7 --- /dev/null +++ b/files/rpi-blacklist.conf @@ -0,0 +1,6 @@ +#wifi +blacklist brcmfmac +blacklist brcmutil +#bt +blacklist btbcm +blacklist hci_uart \ No newline at end of file diff --git a/files/wait.conf b/files/wait.conf new file mode 100644 index 0000000..d52ad0c --- /dev/null +++ b/files/wait.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=/usr/lib/dhcpcd5/dhcpcd -q -w \ No newline at end of file diff --git a/install_limelight.sh b/install_limelight.sh index 9e83c8e..25a9362 100755 --- a/install_limelight.sh +++ b/install_limelight.sh @@ -5,7 +5,26 @@ wget https://git.io/JJrEP -O install.sh chmod +x install.sh sudo ./install.sh +sudo apt-get install -y pigpiod pigpio device-tree-compiler dhcpcd5 network-manager net-tools + # and edit boot partition -find /boot/ -cat /boot/config.txt +install -m 644 limelight/config.txt /boot/ +install -m 644 userconf.txt /boot/ + +dtc -O dtb limelight/gloworm-dt.dts -o /boot/dt-blob.bin + +# Kill wifi and other networking things +install -v -m 644 files/wait.conf /etc/systemd/system/dhcpcd.service.d/ +install -v files/rpi-blacklist.conf /etc/modprobe.d/blacklist.conf + +# Remove extra packages too + +apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek raspberrypi-net-mods device-tree-compiler +apt-get autoremove -y + +rm -rf /var/lib/apt/lists/* +apt-get clean + +rm -rf /usr/share/doc +rm -rf /usr/share/locale/ diff --git a/install_pi.sh b/install_pi.sh index 21b1175..ce77702 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -5,10 +5,24 @@ wget https://git.io/JJrEP -O install.sh chmod +x install.sh sudo ./install.sh -# and edit boot partition +sudo apt-get install -y pigpiod pigpio device-tree-compiler dhcpcd5 network-manager net-tools -find /boot/ -cat /boot/config.txt +# and edit boot partition install -m 644 config.txt /boot/ install -m 644 userconf.txt /boot/ + +# Kill wifi and other networking things +install -v -m 644 files/wait.conf /etc/systemd/system/dhcpcd.service.d/ +install -v files/rpi-blacklist.conf /etc/modprobe.d/blacklist.conf + +# Remove extra packages too + +apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* +apt-get autoremove -y + +rm -rf /var/lib/apt/lists/* +apt-get clean + +rm -rf /usr/share/doc +rm -rf /usr/share/locale/ diff --git a/limelight/config.txt b/limelight/config.txt new file mode 100644 index 0000000..d8f2103 --- /dev/null +++ b/limelight/config.txt @@ -0,0 +1,57 @@ +#uncomment to overclock the arm. 700 MHz is the default. +#arm_freq=800 + +# Enable audio (loads snd_bcm2835) +dtparam=audio=on + +[cm3] +dtparam=cam0_reg +dtparam=cam0_reg_gpio=3 +dtoverlay=cm-swap-i2c0 +dtoverlay=ov5647,cam0 + +# Automatically load overlays for detected cameras +camera_auto_detect=1 + +[cm4] +dtoverlay=ov5647 + +[all] + +# Automatically load overlays for detected DSI displays +display_auto_detect=1 + +# Enable DRM VC4 V3D driver +dtoverlay=vc4-kms-v3d +dtparam=spi=on +dtparam=audio=off + +max_framebuffers=2 + +# Run in 64-bit mode +arm_64bit=1 + +# Disable compensation for displays with overscan +disable_overscan=1 + +[cm4] +# Enable host mode on the 2711 built-in XHCI USB controller. +# This line should be removed if the legacy DWC2 controller is required +# (e.g. for USB device mode) or if USB support is not required. +otg_mode=1 + +[pi4] +# Run as fast as firmware / board allows +arm_boost=1 + +[all] +#camera_auto_detect=1 +gpu_mem=256 + +[cm3] +dtoverlay=enc28j60 +dtoverlay=pi3-disable-bt +gpio=45=op,dh +disable_camera_led=1 +disable_splash=1 +force_eeprom_read=0 diff --git a/limelight/gloworm-dt.dts b/limelight/gloworm-dt.dts new file mode 100644 index 0000000..6defd4a --- /dev/null +++ b/limelight/gloworm-dt.dts @@ -0,0 +1,607 @@ +/dts-v1/; +/ { + videocore { + pins_cm3 { + pin_config { + pin@default { + polarity = "active_high"; + termination = "pull_down"; + startup_state = "inactive"; + function = "input"; + }; + + pin@p0 { + function = "input"; + termination = "pull_up"; + }; + + pin@p1 { + function = "input"; + termination = "pull_up"; + }; + + pin@p2 { + function = "input"; + termination = "pull_up"; + }; + + pin@p3 { + function = "output"; + termination = "no_pulling"; + }; + + pin@p4 { + function = "input"; + termination = "pull_up"; + }; + + pin@p5 { + function = "input"; + termination = "pull_up"; + }; + + pin@p6 { + function = "input"; + termination = "pull_up"; + }; + + pin@p7 { + function = "input"; + termination = "pull_up"; + }; + + pin@p8 { + function = "input"; + termination = "pull_up"; + }; + + pin@p9 { + function = "input"; + termination = "pull_down"; + }; + + pin@p10 { + function = "input"; + termination = "pull_down"; + }; + + pin@p11 { + function = "input"; + termination = "pull_down"; + }; + + pin@p12 { + function = "input"; + termination = "pull_down"; + }; + + pin@p13 { + function = "input"; + termination = "pull_down"; + }; + + pin@p14 { + function = "input"; + termination = "pull_down"; + }; + + pin@p15 { + function = "input"; + termination = "pull_down"; + }; + + pin@p16 { + function = "input"; + termination = "pull_down"; + }; + + pin@p17 { + function = "input"; + termination = "pull_down"; + }; + + pin@p18 { + function = "input"; + termination = "pull_down"; + }; + + pin@p19 { + function = "input"; + termination = "pull_down"; + }; + + pin@p20 { + function = "input"; + termination = "pull_down"; + }; + + pin@p21 { + function = "input"; + termination = "pull_down"; + }; + + pin@p22 { + function = "input"; + termination = "pull_down"; + }; + + pin@p23 { + function = "input"; + termination = "pull_down"; + }; + + pin@p24 { + function = "input"; + termination = "pull_down"; + }; + + pin@p25 { + function = "input"; + termination = "pull_down"; + }; + + pin@p26 { + function = "input"; + termination = "pull_down"; + }; + + pin@p27 { + function = "input"; + termination = "pull_down"; + }; + + pin@p28 { + function = "input"; + termination = "pull_up"; + }; + + pin@p29 { + function = "input"; + termination = "pull_up"; + }; + + pin@p30 { + function = "output"; + termination = "no_pulling"; + }; + + pin@p31 { + function = "output"; + termination = "no_pulling"; + startup_state = "active"; + }; + + pin@p32 { + function = "output"; + termination = "no_pulling"; + }; + + pin@p33 { + function = "output"; + termination = "no_pulling"; + }; + + pin@p34 { + function = "input"; + termination = "pull_up"; + }; + + pin@p35 { + function = "input"; + termination = "pull_up"; + }; + + pin@p36 { + function = "input"; + termination = "pull_up"; + }; + + pin@p37 { + function = "input"; + termination = "pull_down"; + }; + + pin@p38 { + function = "input"; + termination = "pull_down"; + }; + + pin@p39 { + function = "input"; + termination = "pull_down"; + }; + + pin@p40 { + function = "input"; + termination = "pull_down"; + }; + + pin@p41 { + function = "input"; + termination = "pull_down"; + }; + + pin@p42 { + function = "input"; + termination = "pull_down"; + }; + + pin@p43 { + function = "input"; + termination = "pull_down"; + }; + + pin@p44 { + function = "gp_clk"; + termination = "pull_down"; + }; + + pin@p45 { + function = "output"; + termination = "pull_down"; + }; + + pin@p46 { + function = "input"; + termination = "pull_up"; + }; + + pin@p47 { + function = "input"; + termination = "pull_up"; + }; + + pin@p48 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x08>; + }; + + pin@p49 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x08>; + }; + + pin@p50 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x08>; + }; + + pin@p51 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x08>; + }; + + pin@p52 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x08>; + }; + + pin@p53 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x08>; + }; + + pin@p128 { + function = "input"; + termination = "no_pulling"; + polarity = "active_low"; + }; + + pin@p129 { + function = "output"; + termination = "no_pulling"; + polarity = "active_low"; + }; + }; + + pin_defines { + pin_define@HDMI_CONTROL_ATTACHED { + type = "external"; + number = <0x00>; + }; + + pin_define@EMMC_ENABLE { + type = "external"; + number = <0x01>; + }; + + pin_define@SMPS_SDA { + type = "internal"; + number = <0x2e>; + }; + + pin_define@SMPS_SCL { + type = "internal"; + number = <0x2f>; + }; + + pin_define@ETH_CLK { + type = "internal"; + number = <0x2c>; + }; + + pin_define@LAN_RUN { + type = "internal"; + number = <0x1f>; + }; + + pin_define@NUM_CAMERAS { + type = "internal"; + number = <0x01>; + }; + + pin_define@CAMERA_0_LED { + type = "internal"; + number = <0x1e>; + }; + + pin_define@CAMERA_0_SHUTDOWN { + type = "internal"; + number = <0x03>; + }; + + pin_define@CAMERA_0_UNICAM_PORT { + type = "internal"; + number = <0x00>; + }; + + pin_define@CAMERA_0_I2C_PORT { + type = "internal"; + number = <0x00>; + }; + + pin_define@CAMERA_0_SDA_PIN { + type = "internal"; + number = <0x1c>; + }; + + pin_define@CAMERA_0_SCL_PIN { + type = "internal"; + number = <0x1d>; + }; + }; + }; + + pins_cm4 { + + pin_config { + + pin@default { + polarity = "active_high"; + termination = "pull_down"; + startup_state = "inactive"; + function = "input"; + }; + + pin@p14 { + function = "uart0"; + termination = "no_pulling"; + drive_strength_mA = <0x8>; + }; + + pin@p15 { + function = "uart0"; + termination = "pull_up"; + drive_strength_mA = <0x8>; + }; + + pin@p46 { + function = "input"; + termination = "pull_up"; + }; + + pin@p47 { + function = "input"; + termination = "pull_up"; + }; + + pin@p48 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x8>; + }; + + pin@p49 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x8>; + }; + + pin@p50 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x8>; + }; + + pin@p51 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x8>; + }; + + pin@p52 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x8>; + }; + + pin@p53 { + function = "sdcard"; + termination = "pull_up"; + drive_strength_mA = <0x8>; + }; + + pin@p128 { + function = "output"; + termination = "no_pulling"; + }; + + pin@p129 { + function = "output"; + termination = "no_pulling"; + }; + + pin@p130 { + function = "output"; + termination = "no_pulling"; + polarity = "active_low"; + startup_state = "active"; + }; + + pin@p131 { + function = "output"; + termination = "no_pulling"; + }; + + pin@p132 { + function = "output"; + termination = "no_pulling"; + }; + + pin@p133 { + function = "output"; + termination = "no_pulling"; + }; + + pin@p134 { + function = "output"; + termination = "no_pulling"; + startup_state = "active"; + }; + + pin@p135 { + function = "output"; + termination = "no_pulling"; + }; + }; + + pin_defines { + + pin_define@HDMI_CONTROL_ATTACHED { + type = "external"; + number = <0x0>; + }; + + pin_define@EMMC_ENABLE { + type = "external"; + number = <0x1>; + }; + + pin_define@NUM_CAMERAS { + type = "internal"; + number = <0x1>; + }; + + pin_define@POWER_LOW { + type = "absent"; + }; + + pin_define@LEDS_DISK_ACTIVITY { + type = "absent"; + }; + + pin_define@LAN_RUN { + type = "absent"; + }; + + pin_define@BT_ON { + type = "external"; + number = <0x0>; + }; + + pin_define@WL_ON { + type = "external"; + number = <0x1>; + }; + + pin_define@SMPS_SDA { + type = "internal"; + number = <0x2e>; + }; + + pin_define@SMPS_SCL { + type = "internal"; + number = <0x2f>; + }; + + pin_define@ETH_CLK { + type = "absent"; + }; + + pin_define@WL_LPO_CLK { + type = "absent"; + }; + + pin_define@USB_LIMIT_1A2 { + type = "absent"; + }; + + pin_define@SIO_1V8_SEL { + type = "absent"; + }; + + pin_define@PWML { + type = "absent"; + }; + + pin_define@PWMR { + type = "absent"; + }; + + pin_define@SAFE_MODE { + type = "absent"; + }; + + pin_define@SD_CARD_DETECT { + type = "absent"; + }; + + pin_define@ID_SDA { + type = "internal"; + number = <0x0>; + }; + + pin_define@ID_SCL { + type = "internal"; + number = <0x1>; + }; + + pin_define@CAMERA_0_I2C_PORT { + type = "internal"; + number = <0x0>; + }; + + pin_define@CAMERA_0_SDA_PIN { + type = "internal"; + number = <0x2c>; + }; + + pin_define@CAMERA_0_SCL_PIN { + type = "internal"; + number = <0x2d>; + }; + + pin_define@CAMERA_0_SHUTDOWN { + type = "external"; + number = <0x5>; + }; + + pin_define@CAMERA_0_UNICAM_PORT { + type = "internal"; + number = <0x1>; + }; + + pin_define@CAMERA_0_LED { + type = "absent"; + }; + }; + }; + + }; +}; From f4d5209fc03e9d877a8854a09154f04d627be62e Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 21 Dec 2023 11:12:17 -0800 Subject: [PATCH 09/30] Remove sudo --- install_limelight.sh | 4 ++-- install_pi.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install_limelight.sh b/install_limelight.sh index 25a9362..0fe8391 100755 --- a/install_limelight.sh +++ b/install_limelight.sh @@ -3,9 +3,9 @@ cd /tmp wget https://git.io/JJrEP -O install.sh chmod +x install.sh -sudo ./install.sh +./install.sh -sudo apt-get install -y pigpiod pigpio device-tree-compiler dhcpcd5 network-manager net-tools +apt-get install -y pigpiod pigpio device-tree-compiler dhcpcd5 network-manager net-tools # and edit boot partition diff --git a/install_pi.sh b/install_pi.sh index ce77702..6ba4820 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -3,9 +3,9 @@ cd /tmp wget https://git.io/JJrEP -O install.sh chmod +x install.sh -sudo ./install.sh +./install.sh -sudo apt-get install -y pigpiod pigpio device-tree-compiler dhcpcd5 network-manager net-tools +apt-get install -y pigpiod pigpio device-tree-compiler dhcpcd5 network-manager net-tools # and edit boot partition From 6b27403fa33cef84359b688f06ce1002d64a5d13 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 21 Dec 2023 11:18:16 -0800 Subject: [PATCH 10/30] Update main.yml --- .github/workflows/main.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd37a86..8a468ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,22 +31,11 @@ jobs: - name: Fetch tags run: git fetch --tags --force - # From https://github.com/pguyot/arm-runner-action/blob/main/.github/workflows/test-cache.yml - - uses: actions/cache@v3 - id: cache - with: - path: $RUNNER_TEMP/base_system.img - key: ${{ matrix.base_image }} - - # Grab if we couldn't find it in the cache - - run: wget -O $RUNNER_TEMP/base_system.img ${{ matrix.base_image }} - if: steps.cache.outputs.cache-hit != 'true' - - uses: pguyot/arm-runner-action@HEAD id: install_deps with: image_additional_mb: 1500 - base_image: file://$RUNNER_TEMP/base_system.img + base_image: ${{ matrix.base_image }} commands: ${{ matrix.script }} - name: Compress built image From a8f8c8b7dd7a77f3dc0ff8c64edf14c119446aff Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 21 Dec 2023 11:31:34 -0800 Subject: [PATCH 11/30] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a468ca..9d73eca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,4 +47,4 @@ jobs: - uses: actions/upload-artifact@master with: name: photon-image-${{ matrix.name }} - path: $RUNNER_TEMP/$IMAGE.tar.xz + path: $RUNNER_TEMP/*.tar.xz From b704d42bfdbf6379344282675853cd823093dbf5 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 21 Dec 2023 12:11:06 -0800 Subject: [PATCH 12/30] Maybe fix image upload path --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9d73eca..54bb26c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,9 +42,9 @@ jobs: run: | export IMAGE=photonvision_$(git describe --tags --match=v*)_${{ matrix.name }}.img mv ${{ steps.install_deps.outputs.image }} $RUNNER_TEMP/$IMAGE - tar -cJf $RUNNER_TEMP/$IMAGE.tar.xz $RUNNER_TEMP/$IMAGE + tar -cJf $IMAGE.tar.xz $RUNNER_TEMP/$IMAGE - uses: actions/upload-artifact@master with: name: photon-image-${{ matrix.name }} - path: $RUNNER_TEMP/*.tar.xz + path: *.tar.xz From 3e779cc598f738b045a88ff2b848d77c745e5b45 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 21 Dec 2023 12:25:32 -0800 Subject: [PATCH 13/30] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54bb26c..454f9cf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,4 +47,4 @@ jobs: - uses: actions/upload-artifact@master with: name: photon-image-${{ matrix.name }} - path: *.tar.xz + path: "*.tar.xz" From e88ff4b1ca50467e7982a1454df0cdc791f04826 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 23 Dec 2023 07:46:01 -0800 Subject: [PATCH 14/30] Create orange pi script --- .github/workflows/main.yml | 3 +++ install_opi5.sh | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 install_opi5.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 454f9cf..ee3223b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,6 +21,9 @@ jobs: - name: raspi script: ./install_pi.sh base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz + - name: opi5 + script: ./install_opi5 + base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v1.30/ubuntu-22.04.3-preinstalled-server-arm64-orangepi-5.img.xz name: "Build for ${{ matrix.name }}" diff --git a/install_opi5.sh b/install_opi5.sh new file mode 100644 index 0000000..fe952f9 --- /dev/null +++ b/install_opi5.sh @@ -0,0 +1,18 @@ +cd /tmp +wget https://git.io/JJrEP -O install.sh +chmod +x install.sh + +sed -i 's/# AllowCPUs=4-7/AllowCPUs=4-7/g' install.sh + +./install.sh + +# Remove extra packages too + +apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* +apt-get autoremove -y + +rm -rf /var/lib/apt/lists/* +apt-get clean + +rm -rf /usr/share/doc +rm -rf /usr/share/locale/ From 3ff1556f6ce5653b4131d79e6c8edb0bcdef7978 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 23 Dec 2023 07:49:30 -0800 Subject: [PATCH 15/30] Fix script name --- .github/workflows/main.yml | 2 +- install_opi5.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 install_opi5.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee3223b..b7e8eca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: script: ./install_pi.sh base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz - name: opi5 - script: ./install_opi5 + script: ./install_opi5.sh base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v1.30/ubuntu-22.04.3-preinstalled-server-arm64-orangepi-5.img.xz name: "Build for ${{ matrix.name }}" diff --git a/install_opi5.sh b/install_opi5.sh old mode 100644 new mode 100755 From fadc0d65bbd538117eede4aa659618f84fd04df5 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 23 Dec 2023 07:54:01 -0800 Subject: [PATCH 16/30] Maybe update/upgrade first --- install_opi5.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_opi5.sh b/install_opi5.sh index fe952f9..84958c7 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -1,3 +1,6 @@ +apt-get update +apt-get upgrade -y + cd /tmp wget https://git.io/JJrEP -O install.sh chmod +x install.sh From 4096515ab92bafdbee1477a8cfa40e6390e18fb0 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 14:03:43 -0800 Subject: [PATCH 17/30] test things --- install_pi.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install_pi.sh b/install_pi.sh index 6ba4820..ee655d7 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -1,14 +1,16 @@ # Run normal photon instarller +pushd . cd /tmp wget https://git.io/JJrEP -O install.sh chmod +x install.sh ./install.sh +sudo apt-get update apt-get install -y pigpiod pigpio device-tree-compiler dhcpcd5 network-manager net-tools # and edit boot partition - +popd install -m 644 config.txt /boot/ install -m 644 userconf.txt /boot/ @@ -16,9 +18,12 @@ install -m 644 userconf.txt /boot/ install -v -m 644 files/wait.conf /etc/systemd/system/dhcpcd.service.d/ install -v files/rpi-blacklist.conf /etc/modprobe.d/blacklist.conf +# Enable ssh +systemctl enable ssh + # Remove extra packages too -apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* +# apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* apt-get autoremove -y rm -rf /var/lib/apt/lists/* From 1f2e7aa96fd4bbf76dc465baf6102c712e5c761f Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 14:24:17 -0800 Subject: [PATCH 18/30] Update install_opi5.sh --- install_opi5.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install_opi5.sh b/install_opi5.sh index 84958c7..9e4a897 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -1,3 +1,7 @@ +find / + +find / -name user-data + apt-get update apt-get upgrade -y From 84541da4b891cfc107b5a5374df220bd36c881f9 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 14:30:09 -0800 Subject: [PATCH 19/30] Remove cleanup --- install_pi.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install_pi.sh b/install_pi.sh index ee655d7..5e93508 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -24,10 +24,10 @@ systemctl enable ssh # Remove extra packages too # apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* -apt-get autoremove -y +# apt-get autoremove -y -rm -rf /var/lib/apt/lists/* -apt-get clean +# rm -rf /var/lib/apt/lists/* +# apt-get clean -rm -rf /usr/share/doc -rm -rf /usr/share/locale/ +# rm -rf /usr/share/doc +# rm -rf /usr/share/locale/ From 68680c44d9ea0e24586445c401779d8b38141467 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 14:30:20 -0800 Subject: [PATCH 20/30] Also remove install script --- install_pi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_pi.sh b/install_pi.sh index 5e93508..fc99134 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -4,7 +4,7 @@ pushd . cd /tmp wget https://git.io/JJrEP -O install.sh chmod +x install.sh -./install.sh +# ./install.sh sudo apt-get update apt-get install -y pigpiod pigpio device-tree-compiler dhcpcd5 network-manager net-tools From 31236221b32cfff1ebb75954411b12fd6f9ea11e Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 14:47:00 -0800 Subject: [PATCH 21/30] Don't install dhcpcd --- install_pi.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/install_pi.sh b/install_pi.sh index fc99134..ecf976e 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -1,16 +1,17 @@ # Run normal photon instarller -pushd . -cd /tmp wget https://git.io/JJrEP -O install.sh chmod +x install.sh # ./install.sh +# rm install.sh +echo "Installing additional things" sudo apt-get update -apt-get install -y pigpiod pigpio device-tree-compiler dhcpcd5 network-manager net-tools +apt-get install -y pigpiod pigpio device-tree-compiler +apt-get install -y network-manager +apt-get install -y net-tools # and edit boot partition -popd install -m 644 config.txt /boot/ install -m 644 userconf.txt /boot/ @@ -23,7 +24,7 @@ systemctl enable ssh # Remove extra packages too -# apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* +# apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev device-tree-compiler # apt-get autoremove -y # rm -rf /var/lib/apt/lists/* From ea0e7fc02442cf346783314e5e439ef46d829db3 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 14:47:10 -0800 Subject: [PATCH 22/30] Delete extra packages again --- install_pi.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install_pi.sh b/install_pi.sh index ecf976e..856e37e 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -24,11 +24,11 @@ systemctl enable ssh # Remove extra packages too -# apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev device-tree-compiler -# apt-get autoremove -y +apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev device-tree-compiler +apt-get autoremove -y -# rm -rf /var/lib/apt/lists/* -# apt-get clean +rm -rf /var/lib/apt/lists/* +apt-get clean -# rm -rf /usr/share/doc -# rm -rf /usr/share/locale/ +rm -rf /usr/share/doc +rm -rf /usr/share/locale/ From 97defaadcd3acd4d2b310a7a5450bb7485a5ba1e Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 14:47:17 -0800 Subject: [PATCH 23/30] Run install again --- install_pi.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_pi.sh b/install_pi.sh index 856e37e..bd94a06 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -2,8 +2,8 @@ wget https://git.io/JJrEP -O install.sh chmod +x install.sh -# ./install.sh -# rm install.sh +./install.sh +rm install.sh echo "Installing additional things" sudo apt-get update From d032ca6f3f0ce762b058eb3e6bd7822941554cfe Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 14:49:09 -0800 Subject: [PATCH 24/30] Update mainyml --- .github/workflows/main.yml | 11 ++++++----- install_pi.sh | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7e8eca..cfbcd96 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,11 +43,12 @@ jobs: - name: Compress built image run: | - export IMAGE=photonvision_$(git describe --tags --match=v*)_${{ matrix.name }}.img - mv ${{ steps.install_deps.outputs.image }} $RUNNER_TEMP/$IMAGE - tar -cJf $IMAGE.tar.xz $RUNNER_TEMP/$IMAGE + mv ${{ steps.install_deps.outputs.image }} photonvision_${{ matrix.name }}.img + sudo xz -T 0 -v photonvision_${{ matrix.name }}.img - uses: actions/upload-artifact@master with: - name: photon-image-${{ matrix.name }} - path: "*.tar.xz" + name: photonvision_${{ matrix.name }}.img.xz + path: photonvision_${{ matrix.name }}.img.xz + if-no-files-found: error + retention-days: 1 \ No newline at end of file diff --git a/install_pi.sh b/install_pi.sh index bd94a06..f759174 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -1,4 +1,4 @@ -# Run normal photon instarller +# Run normal photon installer wget https://git.io/JJrEP -O install.sh chmod +x install.sh From a365e1bc0fdb18cc92734f9ac0788bcacfbd62bb Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 14:57:26 -0800 Subject: [PATCH 25/30] Update install_limelight.sh --- install_limelight.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/install_limelight.sh b/install_limelight.sh index 0fe8391..5f08286 100755 --- a/install_limelight.sh +++ b/install_limelight.sh @@ -1,11 +1,15 @@ -# Run normal photon instarller +# Run normal photon installer -cd /tmp wget https://git.io/JJrEP -O install.sh chmod +x install.sh ./install.sh +rm install.sh -apt-get install -y pigpiod pigpio device-tree-compiler dhcpcd5 network-manager net-tools +echo "Installing additional things" +sudo apt-get update +apt-get install -y pigpiod pigpio device-tree-compiler +apt-get install -y network-manager +apt-get install -y net-tools # and edit boot partition @@ -18,9 +22,12 @@ dtc -O dtb limelight/gloworm-dt.dts -o /boot/dt-blob.bin install -v -m 644 files/wait.conf /etc/systemd/system/dhcpcd.service.d/ install -v files/rpi-blacklist.conf /etc/modprobe.d/blacklist.conf +# Enable ssh +systemctl enable ssh + # Remove extra packages too -apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek raspberrypi-net-mods device-tree-compiler +apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev libqt* wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek raspberrypi-net-mods device-tree-compiler apt-get autoremove -y rm -rf /var/lib/apt/lists/* From 947d9ea0287cec93f69bb70b284af5adbb0fafb0 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 14:57:59 -0800 Subject: [PATCH 26/30] disable orange pi --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cfbcd96..950a4e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,9 +21,10 @@ jobs: - name: raspi script: ./install_pi.sh base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz - - name: opi5 - script: ./install_opi5.sh - base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v1.30/ubuntu-22.04.3-preinstalled-server-arm64-orangepi-5.img.xz + # Orange pi default user seems bjork? also I can't find the where this file ends up in the image? https://github.com/Joshua-Riek/ubuntu-rockchip/blob/0710bd81f5619c25ccddb4e9d69ddbe73827f850/overlay/boot/firmware/user-data#L4 + # - name: opi5 + # script: ./install_opi5.sh + # base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v1.30/ubuntu-22.04.3-preinstalled-server-arm64-orangepi-5.img.xz name: "Build for ${{ matrix.name }}" From 32f8ec865edb04dafc57e35f5f8b288dff2b512f Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 15:00:37 -0800 Subject: [PATCH 27/30] Update main.yml --- .github/workflows/main.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 950a4e3..d871259 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,4 +52,29 @@ jobs: name: photonvision_${{ matrix.name }}.img.xz path: photonvision_${{ matrix.name }}.img.xz if-no-files-found: error - retention-days: 1 \ No newline at end of file + retention-days: 1 + + release: + needs: [build] + runs-on: ubuntu-22.04 + steps: + # Download literally every single artifact + - uses: actions/download-artifact@v4 + - run: find + # Push to dev release + - uses: pyTooling/Actions/releaser@r0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag: 'Dev' + rm: true + files: | + **/*.xz + if: github.event_name == 'push' + # Upload all xz archives to GH tag if tagged + - uses: softprops/action-gh-release@v1 + with: + files: | + **/*.xz + if: startsWith(github.ref, 'refs/tags/v') + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From cd3a7b55d2bc1fd4234f2e2cc4fb5b170dbc140b Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 15:11:25 -0800 Subject: [PATCH 28/30] Install libcamera-driver stuff --- install_limelight.sh | 2 ++ install_pi.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/install_limelight.sh b/install_limelight.sh index 5f08286..b4cb189 100755 --- a/install_limelight.sh +++ b/install_limelight.sh @@ -10,6 +10,8 @@ sudo apt-get update apt-get install -y pigpiod pigpio device-tree-compiler apt-get install -y network-manager apt-get install -y net-tools +# libcamera-driver stuff +apt-get install -y libegl1 libopengl0 libopencv-core406 libgl1-mesa-dri libcamera0 libgbm1 # and edit boot partition diff --git a/install_pi.sh b/install_pi.sh index f759174..dd83ebd 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -10,6 +10,8 @@ sudo apt-get update apt-get install -y pigpiod pigpio device-tree-compiler apt-get install -y network-manager apt-get install -y net-tools +# libcamera-driver stuff +apt-get install -y libegl1 libopengl0 libopencv-core406 libgl1-mesa-dri libcamera0 libgbm1 # and edit boot partition install -m 644 config.txt /boot/ From a40737f18d6b24f3a32fbe2c303b0ce732ff5682 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 15:34:25 -0800 Subject: [PATCH 29/30] pigpiod/libatomic --- files/pigpiod.service | 8 ++++++++ install_limelight.sh | 14 ++++++++++++-- install_pi.sh | 15 ++++++++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 files/pigpiod.service diff --git a/files/pigpiod.service b/files/pigpiod.service new file mode 100644 index 0000000..3c79472 --- /dev/null +++ b/files/pigpiod.service @@ -0,0 +1,8 @@ +[Unit] +Description=Daemon required to control GPIO pins via pigpio +[Service] +ExecStart=/usr/bin/pigpiod -l -n 127.0.0.1 -m +ExecStop=/bin/systemctl kill pigpiod +Type=forking +[Install] +WantedBy=multi-user.target diff --git a/install_limelight.sh b/install_limelight.sh index b4cb189..618c20b 100755 --- a/install_limelight.sh +++ b/install_limelight.sh @@ -11,21 +11,31 @@ apt-get install -y pigpiod pigpio device-tree-compiler apt-get install -y network-manager apt-get install -y net-tools # libcamera-driver stuff -apt-get install -y libegl1 libopengl0 libopencv-core406 libgl1-mesa-dri libcamera0 libgbm1 +apt-get install -y libegl1 libopengl0 libopencv-core406 libgl1-mesa-dri libcamera0.1 libgbm1 libatomic1 # and edit boot partition install -m 644 limelight/config.txt /boot/ install -m 644 userconf.txt /boot/ +# install LL DTS dtc -O dtb limelight/gloworm-dt.dts -o /boot/dt-blob.bin +# re-size FS, again, at next boot +wget https://raw.githubusercontent.com/PhotonVision/photon-pi-gen/arm64/stage2/01-sys-tweaks/files/resize2fs_once -O files/resize2fs_once +install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/" + # Kill wifi and other networking things install -v -m 644 files/wait.conf /etc/systemd/system/dhcpcd.service.d/ install -v files/rpi-blacklist.conf /etc/modprobe.d/blacklist.conf -# Enable ssh +# Update pigipio service file to listen locally +install -v -m 644 files/pigpiod.service /lib/systemd/system/pigpiod.service +systemctl daemon-reload + +# Enable ssh/pigpiod systemctl enable ssh +systemctl enable pigpiod # Remove extra packages too diff --git a/install_pi.sh b/install_pi.sh index dd83ebd..82418f2 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -10,8 +10,8 @@ sudo apt-get update apt-get install -y pigpiod pigpio device-tree-compiler apt-get install -y network-manager apt-get install -y net-tools -# libcamera-driver stuff -apt-get install -y libegl1 libopengl0 libopencv-core406 libgl1-mesa-dri libcamera0 libgbm1 +# libcamera-driver stuff + libatomic1 for wpilib +apt-get install -y libegl1 libopengl0 libopencv-core406 libgl1-mesa-dri libcamera0.1 libgbm1 libatomic1 # and edit boot partition install -m 644 config.txt /boot/ @@ -21,8 +21,17 @@ install -m 644 userconf.txt /boot/ install -v -m 644 files/wait.conf /etc/systemd/system/dhcpcd.service.d/ install -v files/rpi-blacklist.conf /etc/modprobe.d/blacklist.conf -# Enable ssh +# re-size FS, again, at next boot +wget https://raw.githubusercontent.com/PhotonVision/photon-pi-gen/arm64/stage2/01-sys-tweaks/files/resize2fs_once -O files/resize2fs_once +install -m 755 files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/" + +# Update pigipio service file to listen locally +install -v -m 644 files/pigpiod.service /lib/systemd/system/pigpiod.service +systemctl daemon-reload + +# Enable ssh/pigpiod systemctl enable ssh +systemctl enable pigpiod # Remove extra packages too From c236ce3f8950b59f67aec2b1bb3dd0fa32e6ca6a Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 24 Dec 2023 18:56:10 -0800 Subject: [PATCH 30/30] Update install_opi5.sh --- install_opi5.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_opi5.sh b/install_opi5.sh index 9e4a897..face130 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -9,7 +9,7 @@ cd /tmp wget https://git.io/JJrEP -O install.sh chmod +x install.sh -sed -i 's/# AllowCPUs=4-7/AllowCPUs=4-7/g' install.sh +sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' install.sh ./install.sh