matiasandina / FEDWatcher

Software and Hardware to connect FED3 devices over serial on Raspberry Pi 4
MIT License
4 stars 1 forks source link

Data retrieval #9

Open matiasandina opened 3 years ago

matiasandina commented 3 years ago
matiasandina commented 3 years ago

We are using the Shiny App for retrieval of data. Here are a few issues with it.

  1. We can't read data that was saved in the Pi if the app is not running on that same Pi (or if the folder structure changed since the config file was created).
  2. If we pool data from many Pis, we will have more than one config_00.ini within the same folder structure (not possible...)
matiasandina commented 5 months ago

We also experimented with sync_fedwatcher.sh. As of now, this has some hardcoded stuff and is dependent on user input. It might not be the best idea, but keeping it here for future improvement plan

#!/bin/bash

IP=# enter IP here
user=# enter user here
read -p "Enter animal_id: " animal_id
read -p "Enter folder under /Experiments/pilots: " folder

dest_folder="/home/$user/Experiments/pilots/$folder/$animal_id/FED_data/fedwatcher"

echo "Trying to make destination directories at $dest_folder"
echo "Password will be required"
# Create directory on the target machine using -p for recursive directory creation
ssh matias@$IP "mkdir -p $dest_folder"
echo "Directories created. Trying to sync the data"
# Execute rsync
rsync -av -e ssh $animal_id/ $user@$IP:$dest_folder