Skip to content

Sirius Hydra - Raspberry Pi IOT | Internet Radio [rust]

License

Notifications You must be signed in to change notification settings

ganeshrvel/sirius-hydra

Repository files navigation

Sirius Hydra - Raspberry Pi IOT | Internet Radio [rust]

Prerequisites

SSH Config

  • Rename env.sample.config to env.config
  • Edit values inside env.config
  • Rename config.sample.yaml to config.yaml
  • Edit values inside config.yaml

Setup

macOS setup

Ref: https://pixelspark.nl/2020/cross-compiling-rust-programs-for-a-raspberry-pi-from-macos

brew install arm-linux-gnueabihf-binutils

# install rust if not installed:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# open the project directory:
cd /path/to/project
rustup target add arm-unknown-linux-musleabi

Installation

ssh pi@host
# Run
sudo raspi-config
  • Choose System Options > Boot / Auto Login > Console Autologin
  • Choose Interface Options > Serial Port > Login shell access over serial -> Yes
# Run
sudo reboot

Fix source

# Run
sudo nano /etc/apt/sources.list
  • Add this line to the file:
deb https://raspbian.mirror.uk.sargasso.net/raspbian/ buster main contrib non-free rpi
deb-src https://raspbian.mirror.uk.sargasso.net/raspbian/ bullseye  main contrib non-free rpi
  • Comment out the existing line
  • Save and exit
# Run
sudo apt update
sudo apt upgrade

Set up audio driver

  • Plug in the USB sound card to the usb 2.0 port
# Run
sudo raspi-config
  • Choose System Options > Audio > USB 0

  • Increase the volume

# Run
alsamixer

# select the output driver first (F6)
# keep pressing the Navigation Up arrow on the keyboard to increase the volume
# Run
sudo apt-get install -y alsa-base pulseaudio pslist ffmpeg
sudo reboot
  • Install the latest version of rust compiler

Setting up SSH Agent

eval $(ssh-agent -s)
ssh-add ~/.ssh/<private_key_id_rsa>

# enter password when prompted

Build

  • Run ./scripts/build-run-dev.sh to build the code on the local machine and execute the binary on the remote RPi
  • Run ./scripts/deploy-build-release.sh to build release the binary on the local machine and to deploy it on the remote RPi

Other scripts To enable remote development on your Raspberry Pi, you can utilize remote debugging tools like IntelliJ IDEA. Follow the steps below to sync the files to your Raspberry Pi and code remotely.

  1. Use the following files to connect to your Raspberry Pi and sync the local files to it:
  • Set up a deployment configuration in IntelliJ IDEA by going to Tools -> Deployment -> Configuration.
  • Configure the deployment settings to connect to the Raspberry Pi remote machine.
  • Sync the files from your local machine to the Raspberry Pi using the deployment configuration.
  1. Run the appropriate scripts for remote development on the Raspberry Pi:
  • For debugging with a debug build, run ./scripts/remote-build-run-dev.sh.
  • For remote development with a release build, run ./scripts/remote-build-run-release.sh.
  • To deploy the build for remote development, run ./scripts/remote-deploy-release.sh.

Paths

  • Deployment path: /home/pi/sirius-hydra-release
  • Release binary execution path: ./sirius-hydra-release/run-sirius-hydra.sh

Auto start program

# Run
nano ~/.bashrc
  • Add this line to the end of the ~/.bashrc file
./sirius-hydra-release/run-sirius-hydra.sh

# save it using ctrl+x -> y
(cd ~/ && source ~/.bashrc)

Warranty

Read the license carefully. The license makes it clear that the project is offered "as-is", without warranty, and disclaiming liability for damages resulting from using this project.

Contacts

Please feel free to contact me at ganeshrvel@outlook.com or LinkedIn

Support

Help me keep my works FREE and open for all.

License

sirius Hydra - Raspberry Pi IOT | Internet Radio [rust] is released under MIT License.

Copyright © 2018-Present Ganesh Rathinavel

About

Sirius Hydra - Raspberry Pi IOT | Internet Radio [rust]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published