This project provides diagnostics for various sensors on Raspberry Pi and Ubuntu systems.
❗️FOR RASPBERRY PI USING DAQ HAT HARDWARE❗️
You'll need to set up the hardware before installing anything from this library.
Copied from daqhats:
Power off the Raspberry Pi and attach one or more DAQ HAT boards, using unique address settings for each. Refer to Installing the HAT board for detailed information. When using a single board, leave it at address 0 (all address jumpers removed.) One board must always be at address 0 to ensure that the OS reads a HAT EEPROM and initializes the hardware correctly.
-
Clone the repository
git clone https://github.com/project-ida/ida-devices.git
in the home directory (usually the directory that the terminal starts in - to get there type
cd ~). -
For Raspberry Pi with daqhat hardware, install data acquisition drivers from digilent (uldaq, daqhats) by running
bash scripts/install-digilent-software.sh
inside the
ida-devicesdirectory. -
Install python software libraries by running
bash scripts/install-python-libraries.sh
inside the
ida-devicesdirectory. -
Allow all USB ports to be accessed by the current user by running
bash scripts/allow-usb.sh
inside the
ida-devicesdirectory. -
Set the computer name by running
bash scripts/set-computer-name.sh
inside the
ida-devicesdirectory. -
Copy
psql_credentialsinto theida-devicesdirectory. -
Copy
telegram_credentialsinto theida-devicesdirectory.
If you don't want to have scripts automatically re-start if a crash happens, then you are free to simply open a terminal and run
python whatever.pyIf, however, you want something a bit more resilient, then you'll need to read onto the "Installing Devices" section.
"Installing" a device means:
- Allowing it to run at startup and re-run if it crashes (via cron)
- Making it easier to start/top/view a device when running
manage-devices.sh
We use the install-devices.sh script for this.
bash scripts/install-devices.sh- Select "Add devices to startup" from the menu.
- Choose the devices from the numbered list.
bash scripts/install-devices.sh- Select "Remove devices from startup" from the menu.
- Choose the devices you wish to remove from the numbered list.
Once device installation is complete, you can use the manage-devices.sh script to start/stop/view devices.
To view the real-time output of a running device, run:
bash scripts/manage-devices.sh- Select "View a device's output" from the menu.
- Choose the device from the numbered list.
- The terminal will attach to the device’s
tmuxsession, showing live output. - To detach (without stopping the device), press
Ctrl+B, thenD(or typetmux detachand enter).
To start a device:
bash scripts/manage-devices.sh- Select "Start a device" from the menu.
- Choose the devices from the numbered list.
- The device will be started as a background process using the command installed in
scripts/start-devices.sh
To stop a device that is currently running:
bash scripts/manage-devices.sh- Select "Stop a running device" from the menu.
- Choose the device from the numbered list.
- The selected device will be stopped immediately.
To check which devices are currently running, use:
tmux lsThis will list all active tmux sessions, which correspond to running devices.
If you want to manually start a device without adding it to startup:
tmux new-session -d -s <device-name> "python /path/to/device-script.py; echo Press Enter to exit...; read"This will run the selected device in the background using tmux.