Skip to content

Commit

Permalink
Merge branch 'main' into essential
Browse files Browse the repository at this point in the history
  • Loading branch information
Amerlander committed Aug 18, 2021
2 parents e9f5835 + 55e6b8c commit 19cf027
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 30 deletions.
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
**CalliopEO**
# Readme

## Description
CalliopEO is a Python script to facilitate interaction between a Raspberry Pi microcomputer and a [Calliope Mini microcontroller board](https://calliope.cc/). If executed, the script detects, if a Calliope Mini is attached to a USB board of the Raspbery Pi and determins the serial port to communicate with the Calliope Mini.

### Essential Branch

This is the essential branch. It only contains essential files for running the program.

For a full documentation, please refer to the [main branch](https://github.com/calliope-edu/CalliopEO_AstroPi/tree/main).

#### Included files:
- `CalliopeEO.py`
- `setup.sh`
- all files in `modules/`
- `Testing.sh` and `testing.conf`
- all files in `testcases/shfuncs/`
- `30sec-iss-sensors.zip` in `/testcases/testfiles`
- `README.md` and `.gitignore`

#### Removed files:
- `assets/` folder
- all testcases in `testcases/`
- all testfiles except `30sec-iss-sensors.zip` in `testcases/testfiles/`
- `testresults/` folder
- `CHANGELOG.md`, `LICENSE`, `ProgramDescription.md` and `requirements.md`

**CalliopEO**
# Readme

## Description
CalliopEO is a Python script to facilitate interaction between the [Astro Pi microcomputer](https://astro-pi.org/) and the [CalliopEO Mini microcontroller board](https://calliope.cc/en/calliopeo). If executed, the script detects, if a CalliopEO Mini is attached to a USB board of the Astro Pi and determins the serial port to communicate with the CalliopEO.

### Essential Branch

This is the essential branch. It only contains essential files for running the program.

For a full documentation, please refer to the [main branch](https://github.com/calliope-edu/CalliopEO_AstroPi/tree/main).

#### Included files:
- `CalliopeEO.py`
- `setup.sh`
- all files in `modules/`
- `Testing.sh` and `testing.conf`
- all files in `testcases/shfuncs/`
- `30sec-iss-sensors.zip` in `/testcases/testfiles`
- `README.md` and `.gitignore`

#### Removed files:
- `assets/` folder
- all testcases in `testcases/`
- all testfiles except `30sec-iss-sensors.zip` in `testcases/testfiles/`
- `testresults/` folder
- `CHANGELOG.md`, `LICENSE`, `ProgramDescription.md` and `requirements.md`

Binary file removed modules/argparse-1.4.0-py2.py3-none-any.whl
Binary file not shown.
27 changes: 25 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ echo
# Define variables
username="calliope" # name for user
groups="dialout" # group(s) the user has to be added
needed_progs="lsblk md5sum cmp pip3"

if [ "${EUID}" -ne 0 ]; then
echo "Please run as root. Exiting."
Expand All @@ -17,12 +18,34 @@ if [[ "${1}" != "" ]]; then
username=${1}
fi

# If calliope user doesn't exist, create it
# CalliopEO.py will not work, if the a login shell is provided on the serial
# port. In case, login shell is configured over the serial port, exit
# setup.sh with a message.
if grep -E 'console=serial[[:digit:]]{1},[[:digit:]]+ ' /boot/cmdline.txt > /dev/null 2>&1; then
echo "Error: Login shell provided on serial port."
echo "Disable login shell over serial port, reboot and re-run setup.sh."
echo "Exiting."
exit 1
fi

# The CalliopEO software relies on some programs that have to be available on
# the system. Check and exit if one of the programs does not exist
# (see Github issue #91)
for prog in ${needed_progs}; do
command -v ${prog} >/dev/null 2>&1 || {
echo >&2 "Error: ${prog} required but it's not installed. Exiting."
exit 1
}
done

# If calliope user doesn't exist, create it. If the user already exists,
# exit setup.sh (see Github issue #88)
if ! id -u ${username} > /dev/null 2>&1; then
echo "Creating user ${username}."
useradd -m ${username}
else
echo "User ${username} already exists."
echo "Error: User ${username} already exists. Exiting."
exit 1
fi

# Add user to groups in ${groups}. If user is already in the groups the
Expand Down

0 comments on commit 19cf027

Please sign in to comment.