-
Notifications
You must be signed in to change notification settings - Fork 12
Current hardware software solution
Optimization of real time streaming playback performance and cost of underwater and on-land infrastructure
State of the art (5/9/2023):
SV: Annotate image and get better lighting in green box!
From left to right:
- Black power cord: attach your Uninterruptible Power Source (UPS) into grounded AC power source.
- Gray ethernet cable: connect your router input jack to a DSL or fiber or other modem with Internet access (upload bandwidth at least 1 Mbps, ideally 10 Mbps).
- Thin black cords: plug your router and the Power-Over-Ethernet (POE) injector into the battery-back up side of the UPS. The hope is that the combined loads from your router and the POE injector will not exceed your UPS endurance before a local black-out has been resolved.
- White ethernet cable: connect your router (any free port, usually #1-5) to the POE data-only jack
- Blue ethernet cable: connect the POE data+power jack to the POE splitter that is powering your streaming computer.
- Connect your hydrophone(s) to the Analog-to-Digital-Converter (ADC) input jack(s).
Finally, power up the UPS (usually by pressing the power button briefly, or for some models a couple seconds).
April 2018 blog post about Orcasound hard/soft-ware solution
Last update: 5/30/2024
-
Detatch ethernet and turn off wireless for the Rpi you are using to clone. (If you don't you may disrupt the Dataplicity installation for the existing, working node...)
-
Boot up the Rpi with a working node SD card (with keyboard, mouse, and monitor attached)
-
Start the "SD Card Copier" application from the Raspberry menu's Accessories menu.
-
Check and note the device name of the current SD card (so you know what device should be the source for the cloning processes).
-
Insert a blank SD card (of the same capacity as the source card) using e.g. a USB card reader, and then start the copying process from the current SD as a source to the blank SD card as the target.
-
Wait. The copying will take 10-15 minutes.
-
Shutdown and reboot using the new card.
-
Edit the .env file in the subdirectory of ~/orcanode that contains the .yml for the Docker container. Change the node name to be unique, or to match the name of the node where the SD card will be deployed. Change BUCKET_TYPE to dev.
-
Remove Dataplicity. Uninstall Dataplicity in 3 steps:
sudo rm -rf /opt/dataplicity
sudo apt purge -y supervisor
sudo rm -rf /etc/supervisor
-
Shutdown, attach Rpi to ethernet or other Internet access, and reboot.
-
Browse to Dataplicity, login as an Orcasound admin, delete the old device (noting it's name and description), and install a new device node using the provided curl command to install Dataplicity client on the node SD card.
-
With a synthetic sound source like a radio attached to the Pisound input, test the end-to-end streaming using the dev.orcasound.net web app.
-
Check the cron jobs are what you want for the node. (As of 5/30/24: User pi crontab is commented out and
sudo crontab -eyields both a 24-hour restart of the container and a restart of the streaming container upon a reboot event.) -
Stop the streaming container.
-
Finally, edit .env file, setting BUCKET_TYPE to prod.
-
Shutdown and transport cloned SD card to the relevant network node for deployment.
Last update: 11/12/2023
-
Download the Raspberry Pi Imager software for your computer (with a card reader and an SD card inserted).
-
Use Imager to install the latest Raspberry Pi OS.
Note: if your SD card isn't new, we recommend you first use Imager to format it (FAT32). After choosing your Raspberry Pi version (e.g. 4), choose the 32 bit version of the OS (unless your Pi 4 or 5 has 8GB or more of RAM):
If successful, you should get a message like this:
This How-To assumes you install the desktop environment. Eject the SD card, insert it into your Raspberry Pi (with a monitor, mouse, keyboard, and ethernet cable attached), and turn the computer on.
-
In the
piuser's home directory, create anorcasounddirectory withmkdir orcasound -
Change into the new orcasound directory (with
cd orcasound) and clone the orcanode repository, e.g withgit clone https://github.com/orcasound/orcanode.git
- Pull down the pre-built orcanode image
Try first (to avoid early 2023 end of docker-compose
To pull down this ~2021 image -- https://hub.docker.com/r/orcasound/orcanode -- try docker pull orcasound/orcanode
Also look at Karan's ~2022 amd64 image?
Otherwise, do what Steve said (in email to Scott & David Bain Sep 24, 2022):
- Pull down the pre-built orcanode image
Since we have the image in docker hub you technically don't need the whole repo just to run. You just need the compose file. But it's moved to orcanode/node/docker-compose.rpi-pull.yml
Download this .yml file and rename it "docker-compose.yml" and then do docker compose build followed by docker compose up in the same directory as the file. It will pull the pre-built image down.
The other thing is that the unsupported logspout image is probably more trouble that it's worth. It's not necessary for streaming. You can safely delete these lines from your docker-compose.yml and it might make things simpler:
logspout:
# Use unofficial logspout that's been compiled for armhf
# TODO: Build an updated version of this image. Looks unmaintained.
image: emdem/raspi-logspout
command: ${SYSLOG_URL}
restart: always
hostname: ${NODE_NAME}
env_file: .env
environment:
- SYSLOG_HOSTNAME=${NODE_NAME}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "8000:8000"
If that fails, try this instead:
- Follow the orcanode README installation guidance:
./orcanode/base/rpi/buildrpibase.sh
docker compose ./orcanode/base/
- Edit your .env file
To set up a basic development node, try this .env file template:
AWSSECRETACCESSKEY=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_METADATA_SERVICE_TIMEOUT=5
AWS_METADATA_SERVICE_NUM_ATTEMPTS=0
REGION=us-west-2
BUCKET_TYPE=dev
#BUCKET_TYPE=prod
NODE_TYPE=hls-only
#NODE_TYPE=research
#NODE_TYPE=offline
NODE_NAME=rpi_test_dev
NODE_LOOPBACK=true
SAMPLE_RATE=48000
#SAMPLE_RATE=19200
AUDIO_HW_ID=pisound
CHANNELS=1
FLAC_DURATION=30
SEGMENT_DURATION=10
If you're trying to log, add these lines:
SYSLOG_URL=syslog+tls://syslog-a.logdna.com:6514
SYSLOG_STRUCTURED_DATA='logdna@48950 key="313dbd82f35ccbe462e6e3483984f464" tag="docker"
- Set up remote access
As of fall 2023, we use Dataplicity, but we are studying swarm management tools like (Val investigating with Andreas in :
Install via curl:
curl -s https://www.dataplicity.com/9lg2t5pk.py | sudo python
If you are using an SD card that previously utilized Dataplicity (e.g. you're upgrading Dataplicity), then you should uninstall before running the above curl command afresh. Uninstall Dataplicity in 3 steps:
sudo rm -rf /opt/dataplicity
sudo apt purge -y supervisor
sudo rm -rf /etc/supervisor
- Set up crontab
Do sudo crontab -e and add these lines:
0 0 * * * /usr/local/bin/docker-compose -f /home/pi/orcanode/node/docker-compose.yml down && /usr/local/bin/docker-compose -f /home/pi/orcanode/node/docker-compose.yml up -d
@reboot sleep 60 && /usr/local/bin/docker-compose -f /home/pi/orcanode/node/docker-compose.yml up -d
Building an OrcaNode on a Raspberry Pi
-
Install Rpi operating system and put a blank ssh file in boot sector
-
Connect to Rpi via command line or by dataplicity.
-
su pi followed by Rpi password
-
sudo apt update
-
sudo apt upgrade
-
sudo reboot
-
sudo curl -fsSL https://get.docker.com/ -o get-docker.sh
-
sudo bash get-docker.sh
-
sudo usermod -aG docker $(whoami)
-
sudo reboot
docker version
-
sudo apt install python3-pip -y
-
sudo pip3 install docker-compose
-
make a directory home/pi/hti and cd there
-
git init
-
clone orcanode branch: https://github.com/orcasound/orcanode.git
17: create .env file and save in this directory
Old but good ideas & lessons learned