Skip to content

Try install on bookworm #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,19 @@ jobs:
# - name: Test with pytest
# run: |
# pytest

test_pi_installer_script:
runs-on: ubuntu-latest
# specify an debian bookworm container
container:
image: debian:bookworm
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: Run installer
run: |
# Don't expect this to be root
whoami
source ./install.sh
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ If you already have this kit, then I hope you find this library and it's informa

On a terminal at the Raspberry Pi enter these commands:

curl https://raw.githubusercontent.com/orionrobots/python_usb_robot_arm/main/setup_arm.sh | sudo bash
curl https://raw.githubusercontent.com/orionrobots/python_usb_robot_arm/main/install.sh | sudo bash

I suggest review the setup_arm.sh script above to see what it does.
I suggest review the install.sh script above to see what it does.

## Requirements for Other OS

Expand Down
42 changes: 42 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/env bash
# Raspbian/Debian setup
# Usage
# source ./install.sh [-v <venv folder>]
# Will activate/create a venv for the installation
#
# -v <venv folder> : Optional, specify a virtual environment folder to install into
# If not specified, uses .venv in the current folder
set -e

# Doesn't run with sudo, uses sudo for specific commands
sudo apt-get update -y
sudo apt-get install -y python3-libusb1 python3-pip git

venv_folder=".venv"
# check for the -v flag
while getopts "v:" opt; do
case ${opt} in
v )
venv_folder=$OPTARG
;;
\? )
echo "Usage: source ./install.sh [-v <venv folder>]"
return 1
;;
esac
done

if [ ! -d "$venv_folder" ]; then
python3 -m venv "$venv_folder"
fi
source "$venv_folder/bin/activate"

pip3 install git+https://github.com/orionrobots/python_usb_robot_arm

# cat <<END >/etc/udev/rules.d/42-usb-arm-permissions.rules
# SUBSYSTEM=="usb", ATTR{idVendor}=="1267", ATTR{idProduct}=="0000", MODE:="0666"
# END
Comment on lines +36 to +38
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Account here for #23 - we probably will need this back on depending on OS.


# echo "Please reboot for the udev rules to take effect"
echo "To use the library, source the virtual environment with:"
echo " source $venv_folder/bin/activate"
8 changes: 0 additions & 8 deletions setup_arm.sh

This file was deleted.

Loading