Skip to content

Commit

Permalink
Switched to SQL configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
gerth2 committed Dec 27, 2023
1 parent 468057c commit 095c824
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
Binary file added PhotonVision/photon.sqlite
Binary file not shown.
22 changes: 16 additions & 6 deletions PhotonVision/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,31 @@

# Getting Started

Download the latest [preconfigured SnakeEyes Image](https://github.com/PlayingWithFusion/SnakeEyesDocs/releases).

Flash it onto an SD card [using the same process as recommended by PhotonVision](https://docs.photonvision.org/en/latest/docs/getting-started/installation/sw_install/raspberry-pi.html)

The reset of the [PhotonVision docs](https://docs.photonvision.org/en/latest/index.html) should apply as normal.

# Technical Details

The only modification to PhotonVision required to use SnakeEyes is to ensure the [`hardwareConfig.json`](hardwareConfig.json) file is updated to enable dimmable LED support on pin 13.

In 2024, PhotonVision migrated to using an SQLite database to store settings. Its contents is functionally the same as the `hardwareConfig.json` file. The SnakeEyes preconfigured image includes a small database with the LED's configured, but no cameras or pipelines configured. On PhotonVision's first launch, it will fill out the rest of the details for your model of Pi and camera config.

# Legacy Update Process

While still functional for the 2024 season, this method may be removed in the future.

First, download the hardware config file, `hardwareConfig.json`. [Click this link](https://raw.githubusercontent.com/PlayingWithFusion/SnakeEyesDocs/master/PhotonVision/hardwareConfig.json), then save the file.

[Follow the instructions for installing PhotonVision.](https://docs.photonvision.org/en/latest/docs/getting-started/installation/coprocessor-image.html#raspberry-pi-installation)

Go to `http://photonvision.local:5800/settings.html`, select Import Settings, and upload `hardwareConfig.json`.

All the reset of the [PhotonVision docs](https://docs.photonvision.org/en/latest/index.html) should apply as normal.

Successful configuration should allow you to see and control the LED brightness from the PhotonVision Settings page:

![hardware config](/img/pv_hwcfg.png)

![LED slider](/img/pv_leds.png)

# Technical Details

The only modification to PhotonVision required to use SnakeEyes is to ensure the [`hardwareConfig.json`](hardwareConfig.json) file is updated to enable dimmable LED support on pin 13.

7 changes: 4 additions & 3 deletions generatePiImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ curl -v -sk https://api.github.com/repos/photonvision/photon-pi-gen/releases/tag
IMG_FILE_NAME=$(realpath $(ls | grep image_*.xz))

# Config files should be in this repo
HW_CFG_FILE_NAME=$(realpath $(find PhotonVision -name hardwareConfig.json))
HW_CFG_FILE_NAME=$(realpath $(find PhotonVision -name photon.sqlite))

# Unzip and mount the image to be updated
echo "Unzipping and mounting pi image..."
Expand Down Expand Up @@ -59,10 +59,11 @@ popd
# Copy in custom hardware configuration
sudo mkdir photonvision_config
cd photonvision_config
sudo cp ${HW_CFG_FILE_NAME} hardwareConfig.json
sudo cp ${HW_CFG_FILE_NAME} photon.sqlite

# Update hardware configuration in place to indicate what release this was
sudo sed -i 's/VENDOR_RELEASE/'"${VENDOR_RELEASE}"'/g' hardwareConfig.json
# TODO - I can't sql yet
# sudo sed -i 's/VENDOR_RELEASE/'"${VENDOR_RELEASE}"'/g' hardwareConfig.json

# Cleanup
echo "Re-zipping updated image..."
Expand Down

0 comments on commit 095c824

Please sign in to comment.