The KiwiSDR 2 online store is open for orders! Please visit kiwisdr.nz

installing Kiwirecorder on Ubuntu 16.04?

2»

Comments

  • you said.....

    "Here's what I want: Whenever I start up the job, I would like Kiwirecorder (which is located in cd kiwiclient/kiwirecorder if that's relevant) to record an IQ file for one minute starting at 15 minutes past every hour and recording for only one minute.... at 5 Mhz and I'll keep the station private for now. Then, 30 minutes past, same thing, another minute recorded from 30-31 minutes, 45-46 minutes, and then at the top of the hour also for one minute. When I go offline or want to stop, I just shut it down. Nothing automatic. However, there should be four one minute files in the kiwiclient directory for every hour that I had the job active."

    I'll look at that later today and reply with something
  • edited May 2019
    Happy to help
  • There is a discussion on running python scripts concurrently here:
    https://stackoverflow.com/questions/28549641/run-multiple-python-scripts-concurrently

    Ron
    KA7U
  • edited May 2019
    Hey, guys, thanks for your responses. I will email @WA2ZKD tomorrow and thanks for the offer. @KA7U, I think I'm just probably going to keep the cron job as is for now. I looked into scripts earlier today and it seems pretty tough to change the cron from anything other than what it's designed to do, even with external scripting. One issue I had with the cron today was that I wanted to record the same frequency and the same time, one minute each, but with different passband or mode. No matter how I tried to input the two cron lines, either separated by ; or &&, or even just listing one below the other, only one job would start and then a minute later the other. I finally got around this by creating a minute offset. Both jobs now start, but one a minute earlier than the other. It means an extra min of unnecessary capture, but I still get the full minute desired for both. Since cron doesn't get as specific as seconds, that is the best I could do. I'm a fast learner once I catch on to something, but Linux often stumps me for days or even weeks when trying to do what seems as even simple things. I had to remove "python" from in front of kiwirecorder to get cron to work, otherwise it was just ignoring my lines. Of course, this isn't the same way when I use terminal and in that case, I need "python" so that was what all the trouble was. Little things like that can really throw me off!
  • Just a big thanks to @WA2ZKD as he really shined with a working script. Thanks again!
    WA2ZKD
  • @Jon5
    I've been out fishing for the last couple of weeks. Camping and fishing, good thing to do. Back home now.

    So you have the cron job working! Wonderful. A Bash script looks a little different. So open a file in your editor, and type the following:

    #! /bin/bash
    #

    Then add in your script stuff, such as:
    python ~/kiwiclient/kiwirecorder.py -s ka7u.no-ip.org -p 8073 -f 7490.00 -m iq -L -5000 -H 5000 &

    Save the file with whatever commands your editor saves a file. Then use chmod -x 'filename' to make the file executable, where 'filename' is then name you saved your file as. If you have trouble with paths and stuff, go to the folder where the file resides and type ./'filename' and it should run for you. Or just paste the commands like this:

    ron@linux-4cdz:~> python ~/kiwiclient/kiwirecorder.py -s ka7u.no-ip.org -p 8073 -f 7490.00 -m iq -L -5000 -H 5000 &
    [1] 15335
    ron@linux-4cdz:~> client_public_ip: 67.215.36.150
    rx_chans: 4
    chan_no_pwd: 0
    badp: 0
    version_maj: 1
    version_min: 289
    load_cfg: (cfg info not printed)
    center_freq: 15000000
    bandwidth: 30000000
    adc_clk_nom: 66666600
    audio_init: 1
    audio_rate: 12000
    sample_rate: 12001.034

    Started a new file: 20190519T232704Z_7490000_iq.wav
    ^C
    ron@linux-4cdz:~>

    Notice I used ^C key combination to t kill the program in the terminal window it was running in. Now I find a new WAV file in my user root directory ~

    ron@linux-4cdz:~> ls -lt
    total 74860
    -rw-r--r-- 1 ron users 11288620 May 19 17:30 20190519T232704Z_7490000_iq.wav

    OK, so this a small tutorial on how to do stuff. It should get you going well enough to use the recorder in ways that you desire.
    Ron
    KA7U
  • It's ok, Ron. @WA2ZKD was actually a tremendous help with the scripting, and starting off by sending me some templates to modify as needed. After working pretty thoroughly with scripts over the last couple of days, there's a couple of things I have to watch out for: syntax and commands! If one/ either are not quite right, I'm finding that the script either not functions, or starts looping to the point where I have to reboot my system (I haven't had any luck tracking down PID's and shutting them from terminal).

    I find scripts can have odd "behaviors" too. I have one set up to simultaneously record brief samples of stations for a minute each. If I try setting up five stations within the script, I only get three recorded each time with something about missing a password for the others, yet if I place the other two in separate scripts, all five will be recorded. It's almost like I run into a limitation somewhere even if I space recording times a minute or more apart in the same script. Anyway, not a problem really, just something I've had to work around.

    For now, I'm sticking to scripts, although I may return to cron at some point. I do like the convenience of cron, just not too happy that it's so automated.

    There's something I wanted to mention with Kiwirecorder parameters, specifically file renaming. I thought it would be more convenient to rename downloaded mode files (IQ, USB, etc) in a format easier for me to work with (never have cared for UT). Using a combination of scripting and the recorder parameters, I got my wish except the resulting IQ files would not be recognized in much of the play back software! So, I went back to the default and won't manipulate further.

    Yes, I see you mention ^C for exiting terminal while running a script. I found that I had to reinforce this even further with commands placed at the top and bottom of the script. Definitely have to keep the c ommands in place so the scripts don't "runaway".

    Anyway, thanks for your initial help with the cron job set up... that got the ball rolling.

    Jon
  • @Jon5
    If you find you are really getting into Bash scripts, and they are quite useful, I'd suggest you add training on the terminal "Screen". It has multiple instance features, allows you to exit and return to the running screen, and so forth. ^C works if you are in the terminal or screen that the script is running in, but not if it isn't. https://www.gnu.org/software/screen/

    Screen is particularly useful if you are using SSH to connect to a computer and wish to leave the scripts and programs running when you exit SSH, then be able to log back in with SSH and reattach the running screen terminals. It is worth the effort to figure this stuff out so you can do most of the things you want to do.

    Now if you would teach me how to program with Python...
    Ron
    KA7U
Sign In or Register to comment.