Algafix / OSNMA

A python implementation of the Galileo OSNMA protocol.
European Union Public License 1.2
40 stars 12 forks source link

Not working on Windows #24

Closed albsantosandres closed 9 months ago

albsantosandres commented 9 months ago

Dear colleague, I am trying to run your OSNMA code using the following SW:

_``` _H:\osnma\OSNMA-master\live_galmon_run>python run.py Running using GALMON live data. INFO - Start status COLD_START

WARNING - Cannot compute Padding length: Missing attribute NB_DP INFO - Public Key 2 read. Start status WARMSTART

Algafix commented 9 months ago

Hello!

Thank you for your interest on the software!

Have you tried running the custom_run folder? It comes already configured with an SBF file. If that runs, then the problem is probably related only with the galmon input.

If that's the case, can you try running this command in the command line?

nc 86.82.68.237 10000

I don't know the equivalent tool for windows (it is called netcat on linux). It basically opens a TCP connection with the host serving the galmon data.

If you don't see a bunch of characters printed on the console, that means your network is not able to access galmon.

If you see characters printed on the console, then I would ask you to uncomment these two lines in the galmon input file and show me what you get :) (you can also do that right away if you are not comfortable with running the previous netcat commad)

https://github.com/Algafix/OSNMA/blob/f747320f97afb294df7c32e150acd701d03f7bd0/osnma/input_formats/input_galmon.py#L107-L108

Happy new year!

Algafix commented 9 months ago

Just another question: are you running from the last release or have you clonned the repo?

I did some changes to improve the galmon input that I haven't added to any release, so I would recommend you to test it with the cloned repository

albsantosandres commented 9 months ago

Hi again, Thanks a lot for your prompt reply. Find below my answers: 1) The custom_run works properly and I can see the authentication outputs. 2) I have tried a telnet command (equivalent to nc) to the indicated IP and port and it works properly as I can see binary data output. 3) In the previous try, I download the zip. Now I cloned the repo but it still fails. 4) Requested output after uncommented lines:

Alberto@DESKTOP-M58RF78 MINGW64 ~/osnma/OSNMA/live_galmon_run (master) $ python run.py Running using GALMON live data. INFO - Start status COLD_START

WARNING - Cannot compute Padding length: Missing attribute NB_DP INFO - Public Key 2 read. Start status WARM_START

Traceback (most recent call last): File "C:\Users\Alberto\osnma\OSNMA\live_galmon_run..\osnma\input_formats\input_galmon.py", line 56, in next sync = self.s.recv(4, socket.MSG_WAITALL) OSError: [WinError 10045] Se intentó una operación que no es compatible con el tipo de objeto requerido

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Alberto\osnma\OSNMA\live_galmon_run\run.py", line 30, in live_galmon_config() File "C:\Users\Alberto\osnma\OSNMA\live_galmon_run\run.py", line 24, in live_galmon_config osnma_r.start() File "C:\Users\Alberto\osnma\OSNMA\live_galmon_run..\osnma\receiver\receiver.py", line 160, in start for page in self.nav_data_input: File "C:\Users\Alberto\osnma\OSNMA\live_galmon_run..\osnma\input_formats\input_galmon.py", line 107, in next print(f"Failed:\n{nmm}") UnboundLocalError: local variable 'nmm' referenced before assignment

albsantosandres commented 9 months ago

For the provided error, It sounds to be a Windows issue when managing the socket. Maybe I will try using Linux.....

Algafix commented 9 months ago

Thank you for checking it!

It seems an easy-to-reproduce error, maybe windows doesn't like the socket.MSG_WAITALL . I'll configure the windows VM and work on a fix this weekend :)

Algafix commented 9 months ago

Hello! I just pushed a fix for the galmon input.

Let me know if it works for you :)