sam210723 / himawari-rx

📡 Receive images from weather satellite Himawari-8 via HimawariCast.
https://vksdr.com/himawari-rx
MIT License
51 stars 15 forks source link

Configuration path is relative to current working directory #7

Closed hamishegg closed 3 years ago

hamishegg commented 3 years ago
Traceback (most recent call last):
  File "C:\Himawari\himawari-rx.py", line 276, in <module>
    HimawariRX()
  File "C:\Himawari\himawari-rx.py", line 39, in __init__
    self.config = self.parse_config()
  File "C:\Himawari\himawari-rx.py", line 201, in parse_config
    "path": Path(cfgp.get('rx', 'path')),
  File "C:\Python3\lib\configparser.py", line 781, in get
    d = self._unify_values(section, vars)
  File "C:\Python3\lib\configparser.py", line 1149, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'rx'
sam210723 commented 3 years ago

Hi, this is probably related to a known bug with the configuration file location (himawari-rx.ini) being relative to the current working directory. When a console application is run as Administrator in Windows the current directory defaults to C:WINDOWS\system32.

I have applied a fix for this in xrit-rx and will apply the same fix to himawari-rx soon. For the time being, you could modify himawari-rx.bat so it changes the current directory to the location of himawari-rx first, then runs the application.

@echo off
title himawari-rx

cd C:/path/to/himawari-rx
python himawari-rx.py --config himawari-rx.ini
pause

Out of interest, why does it need to be run as Administrator?

Sam.

hamishegg commented 3 years ago

I am having an Win 10 pc running tbs card broadcast ip and port Win 7 client can get data no issue, Local win 10 pc nothing just sits there.

Reverse scenario win 7 as the local with card both collect data ok, I tested and can see packets getting to python but nothing so just trying different scenarios

Thanks Matt

sam210723 commented 3 years ago

I have pushed himawari-rx v0.1.3 which fixes the relative path issue.

Local win 10 pc nothing just sits there.

This may be something to do with the network adaptor priority setting. https://www.windowscentral.com/how-change-priority-order-network-adapters-windows-10