Ver Fonte

organise scripts

Pierre Bourdin há 1 ano atrás
pai
commit
be6a27c084
5 ficheiros alterados com 73 adições e 0 exclusões
  1. 7 0
      process/0_start
  2. 7 0
      process/1_capture
  3. 7 0
      process/2_convert
  4. 45 0
      process/3_transmit
  5. 7 0
      process/9_end

+ 7 - 0
process/0_start

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+echo "=================================="
+echo "  Start Process - Ballon Sonde !"
+echo "=================================="
+
+

+ 7 - 0
process/1_capture

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+DATE=$(date +%y%m%d_%H%M%S)
+raspistill -o /ramfs/$DATE.jpg
+echo "Picz $DATE.jpg saved in RAM"
+cp /ramfs/$DATE.jpg ~/_Pictures
+echo "Picz $DATE.jpg saved to SDCARD"

+ 7 - 0
process/2_convert

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+echo " => Converting file in little format for Tx"
+cd /ramfs
+FILE=$(find ./ -type f -name *.jpg)
+convert $FILE -resize 640x496^ lit-$(echo $FILE | cut -d"/" -f2)
+rm -rf $FILE

+ 45 - 0
process/3_transmit

@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# Utile pour couper le TX quand on ctrl+c et que le script n'abouti pas
+trap ctrl_c INT
+function ctrl_c() {
+    echo "Ctrl + C happened"
+    raspi-gpio set 4 dh
+    rm -rf /ramfs/*
+}
+
+# Setup the GPIO4 as output for Tx
+raspi-gpio set 4 op && raspi-gpio set 4 dh
+
+IMG=$(cd /ramfs; find ./ -type f -name *.jpg -exec readlink -f {} \;)
+
+#############
+# Mode SSTV
+echo " => Converting image to WAV..."
+cd ~/PySSTV/
+source bin/activate
+python -m pysstv --mode PD120 $IMG /ramfs/out.wav
+deactivate
+
+raspi-gpio set 4 dl
+sleep 1
+
+echo " => Playing WAV file"
+# TXT_TO_WFALL
+cd ~/trxamadrmv3_7/linux
+./txwfal 0
+sleep 1
+espeak "Radio station S S T V"
+sleep 1
+aplay /ramfs/out.wav
+raspi-gpio set 4 dh
+espeak "End of transmission"
+
+#############
+# Mode DRM
+#cd ~/trxamadrmv3_7/linux/
+#(./drm $IMG; raspi-gpio set 4 dh)
+
+
+echo " => All done, cleaning ramfs"
+rm -rf /ramfs/*

+ 7 - 0
process/9_end

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+echo "=================================="
+echo "See ya !" 
+echo "=================================="
+
+