- Author: Ganesh Rathinavel
- License: MIT
- Repo URL: https://github.com/ganeshrvel/sirius-hydra
- Contacts: ganeshrvel@outlook.com
SSH Config
- Rename
env.sample.config
toenv.config
- Edit values inside
env.config
- Rename
config.sample.yaml
toconfig.yaml
- Edit values inside
config.yaml
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
- Download the OS image burner: https://downloads.raspberrypi.org/imager/imager_latest.dmg
- Download the latest "Raspberry Pi OS with desktop" distro via torrents:
- Choose 32 bits or 64 bits as required https://www.raspberrypi.com/software/operating-systems/
- In the Rpi Imager app choose settings gear icon and set the ssh keys and wifi password
- After burning the OS using the imager app, plug in the sdcard into the rpi
- Wait for the Rasbian OS bootup
- ssh into Raspberry pi
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.
- 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.
- 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)
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.
Please feel free to contact me at ganeshrvel@outlook.com or LinkedIn
Help me keep my works FREE and open for all.
- Donate Via PayPal: paypal.me/ganeshrvel
- Buy Me A Coffee (UPI, PayPal, Credit/Debit Cards, Internet Banking): buymeacoffee.com/ganeshrvel
sirius Hydra - Raspberry Pi IOT | Internet Radio [rust] is released under MIT License.
Copyright © 2018-Present Ganesh Rathinavel