gut-space / svarog

📡 A ground stations network for receiving satellite transmissions, using VHF, UHF, and more.
MIT License
9 stars 0 forks source link

NOAA recipe is broken #45

Closed tomaszmrugalski closed 3 years ago

tomaszmrugalski commented 3 years ago

NOAA recipes fail with the following error:


2021-05-09 19:44:02,909 ERROR receiver.py:95: Failed receiver NOAA 19 (LOS: 2021-05-09T17:54:39.938706)
Traceback (most recent call last):
  File "/home/pi/devel/svarog/station/receiver.py", line 92, in <module>
    cmd()
  File "/home/pi/devel/svarog/station/receiver.py", line 55, in cmd
    results, tmp_directory = factory.execute_recipe(satellite, los_datetime)
  File "/home/pi/devel/svarog/station/recipes/factory.py", line 107, in execute_recipe
    output = recipe_function(reception_directory, sat["freq"], record_interval)
  File "/home/pi/devel/svarog/station/recipes/helpers.py", line 33, in inner
    return f(working_dir, *args, **kwargs)
  File "/home/pi/devel/svarog/station/recipes/noaa_apt.py", line 18, in execute
    fm_proc = sh.rx_fm(
  File "/home/pi/.local/lib/python3.7/site-packages/sh.py", line 3518, in __getattr__
    return self.__env[name]
  File "/home/pi/.local/lib/python3.7/site-packages/sh.py", line 3316, in __getitem__
    raise CommandNotFound(k)
sh.CommandNotFound: rx_fm

That is weird, however, because:

$ which rx_fm
/usr/local/bin/rx_fm
$ rx_fm
Please specify a frequency.
rx_fm (based on rtl_fm), a simple narrow band FM demodulator for RTL2832 based DVB-T receivers

Use:    rx_fm -f freq [-options] [filename]
    -f frequency_to_tune_to [Hz]
...

Need to investigate this further.

tomaszmrugalski commented 3 years ago

Found what the problem was. When starting command from crontab, the PATH is set to PATH=/usr/bin:/bin.

One manual way of fixing the problem is to set up PATH in the crontab, see this question on stackoverflow. I'll create a branch and add more informative error handling here.

tomaszmrugalski commented 3 years ago

It's fixed in #47!