It’s sometimes useful to have IQ data available for debugging, or decoding frames that are off frequency. I’ve made a simple script to automatically upload the IQ data to S3.
Notes:
Saving IQ will cost about 100-500MB of storage space for each pass depending on length and sample rate - This may cause SD cards to fail sooner due to the extra write IOPS.
You can end up with lots of space used in S3 which will cost you each month. You can setup a life cycle policy to manage how long observations are kept for.
Satnogs client stores IQ files as short type, and for most programs will need to be converted to complex. You can do this in GNU Radio by having File Source -> IShort To Complex -> File Sink
Once converted you can use them in GQRX with file=file-path-complex.raw,rate=48000,repeat=false,throttle=false as the device
This script will delete the file regardless of if it is successful or not - this is on purpose for my use case as I don’t want the SD card filling up
In AWS:
Create an S3 bucket
Create an IAM User with programatic access. Note down the access key and secret key.
Create an IAM policy on the user that provides access to the bucket - change YOURBUCKETNAMEHERE to your bucket name
sudo apt-get install python-pip
sudo pip install awscli
sudo pip install requests==2.2.1 # revert the requests library install that awscli does
Setup a directory for storing IQ data. This could be tmpfs, a folder or an external disk.
sudo mkdir /iq
sudo chown satnogs:satnogs /iq
Configure AWS CLI - set your access key and region
su satnogs -s /bin/bash
aws configure
Install the script - Change YOURBUCKETNAMEHERE to your bucket name- If you have another script your running just incorporate it into that
cat << EOF >> /tmp/iq-upload
#!/bin/bash
# Copies IQ files to S3. Deletes the file reagrdless if it succeeded or not to upload it
# Create a folder /iq - you can make this a seperate mount to a tmpfs or external hdd
# Make sure `satnogs` user has access to it
# Install aws-cli - https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
# configure the aws-cli creds from the satnogs user `su satnogs -s /bin/sh`
# Run satnogs-setup and set post observation script to be this file with {{ID}} as the first qrgument
# eg - /usr/local/bin/iq-upload {{ID}}
BUCKET="YOURBUCKETNAMEHERE"
mv /iq/iq.raw /iq/$1.raw
nohup sh -c "/usr/local/bin/aws s3 cp /iq/$1.raw s3://$BUCKET/$1.raw; rm /iq/$1.raw" >/dev/null 2>&1 &
EOF
sudo mv /tmp/iq-upload /usr/local/bin/iq-upload
sudo chmod a+x /usr/local/bin/iq-upload
Might be good place to ask, why are my file names from post observation script ending up like:
64 -rw-r–r-- 1 satnogs satnogs 38M Jul 15 07:38 IQlinux; GNU C++ version 6.2.0 20161010; Boost_106100; UHD_003.009.005-0-unknown??20190715073855.raw
the /var/lib/satnogs/pos.sh is:
#!/bin/sh
# try date without quotes: DATE=date "+%Y%m%d%H%M%S"
DATE=date +%Y%m%d%H%M%S <-- there are backticks in the script
/bin/mv /mnt/usb/iq.raw “/mnt/usb/IQ${DATE}.raw”
Not an answer to your question but I can give some hints on code quotes in here:
Use three backticks followed by the syntax highlighting tag of your choice (you can omit this if you only want to paste text!), like ‘’'bash (replace the ticks with backtics) to start a highlighted code-block. At the end add another three back tics to end that code-block.
Like:
#!/bin/sh
# try date without quotes: DATE=date "+%Y%m%d%H%M%S"
DATE=`date +%Y%m%d%H%M%S`
/bin/mv /mnt/usb/iq.raw “/mnt/usb/IQ${DATE}.raw”
You can also use single backtics to mark a single line or a few words as code like: char array[15]
Hi, I am still a beginner at this satnogs … I would like to ask how to upload IQ Files for certain satellites automatically to Google Drive … please help and make the steps.
Thank you,