junzis / pyModeS

Python decoder for Mode S and ADS-B signals
GNU General Public License v3.0
549 stars 152 forks source link

Modeslive throws ValueError: ctypes objects containing pointers cannot be pickled #127

Open devleaks opened 2 years ago

devleaks commented 2 years ago

Mac OS 12.4 Python 3.10.5 In a conda environment:

pip list   
Package    Version
---------- -------
numpy      1.23.0
pip        22.1.2
pyModeS    2.11
pyrtlsdr   0.2.92
pyzmq      23.2.0
setuptools 63.1.0
wheel      0.37.1

Hello, When trying to get modeslive running, I get this error:

Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniforge/base/envs/adsb/bin/modeslive", line 138, in <module>
recv_process.start()
File "/opt/homebrew/Caskroom/miniforge/base/envs/adsb/lib/python3.10/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/opt/homebrew/Caskroom/miniforge/base/envs/adsb/lib/python3.10/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/opt/homebrew/Caskroom/miniforge/base/envs/adsb/lib/python3.10/multiprocessing/context.py", line 284, in _Popen
return Popen(process_obj)
File "/opt/homebrew/Caskroom/miniforge/base/envs/adsb/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/opt/homebrew/Caskroom/miniforge/base/envs/adsb/lib/python3.10/multiprocessing/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/opt/homebrew/Caskroom/miniforge/base/envs/adsb/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/opt/homebrew/Caskroom/miniforge/base/envs/adsb/lib/python3.10/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
ValueError: ctypes objects containing pointers cannot be pickled

How can I further track the issue? Thank you.

devleaks commented 1 year ago

I cannot get pymodes to work. Why do I get this error? I create a new conda environment, I tried with python 3.8 to 3.11, only install pymodes and librtlsrd and constantly get this error. What am I doing wrong? (On the side, I have dump1090 with my rtlsrd working perfectly. So that's not that part of the set up.) The error seems so pythonic that I cannot conceive that someone else does not bump into this.

appaie commented 10 months ago

hey @devleaks im encountering the same issue OS Windows 10 though. Im in the process of finding a solution, u got any idea.

Other question, installed dump1090 on my cygwin terminal but i cant connect my rtlsdr the options of dump1090 source are net or none, how have u got it to work or what have u done so ur rtl out could be importet into dump1090?

thank u in advance

devleaks commented 10 months ago

Hello. Regarding pyModeS: No, given time constraints I headed for other solutions. However, soft is still installed and I could do some more testing if it now working. For dump1090, I tried numerous version over time. The one I now use is flightaware's. I just checked and my last compilation dates back in 2022! I never had any issue regarding rtlsdr. I'm on Mac I use brew to install librtlsdr. Pierre

appaie commented 10 months ago

aight trying my best to find a solution, just in case i wouldnt get it, whats the alternate ur using?

in case of dump1090 i installed it correctly on my terminal but only device i can connect is net or "none" u got an idea on what uve changed on the code? image

appaie commented 10 months ago

many thanks for ur response

cheers Tim

devleaks commented 10 months ago

in a Fraidy late afternoon quick run, I recompiled dump1090 and it works. pyModeS still exhibit the same problem. I have to confess I used pip to install packages. Tried python 3.10 and 3.11. same thing. When I'll have a minute I'll try to install poetry, etc. to get the exact same install. As now it does not work. I'm on MacOS 17.1, Apple Silicon chips. I'll try newt week. P.

appaie commented 10 months ago

no worries^^ try my best to get a solution throughout the weekend but ill keep u updated

appaie commented 10 months ago

hey @devleaks hope u had a great christmas, im still trying to get the rtl nooelec readable by the two programs dump1090 and pymodes on my pycharm unfortunally without sucsess ive got another program running rtl1090 which works just fine with the dongle but i cant seem to figure out how i can connect my dongle with dump1090 and pymodes the --help isnt getting me any further

$ ./dump1090 --help

| dump1090 ModeS Receiver dump1090-fa unknown | | build options: |

--device-type Select SDR type (default: none)

does anyone know how i can select my rtl? if ive got this working that would be the best christmas gift i couldve ever ask for

Thank u in advance screenshot from the working rtl1090: image

a possibility could also be to find the raw bin file and then select this one inside the dump1090 but i really dont knwo where the raw file is supposed to be located

Cheers

devleaks commented 9 months ago

@appaie Please start another thread. Your issue is not related to mine. Mine is a pure python issue in pyModeS. Yours involve other software and complication. Please leave this thread focus on my original python issue. Thanks.

appaie commented 8 months ago

hey sorry u r right, im still searching for the answer, anyone figured it out?

devleaks commented 8 months ago

No, and I have more problem to connect it to dump1090. In my case, it simply does not work, neither direct RtlSdr, nor through --net with proper parameters. The root reason is the same, pickle cannot serialize some variables (_curses.window??) and the streaming process does not start.

devleaks commented 8 months ago

Something very annoying too is that curses takes control on the screen, and in case of error does not clean/release it in a clean state; you have to issue CTRL-JresetCTRL-J to get your screen back... Fortunately, dump1090 works like a charm and can dump in files.

appaie commented 8 months ago

what do u mean by dump in files? from where to where dump files from dump1090 directly into PMS? my tutor tried it with linux, he told me it worked fine on his machine, so maybe a MOS WIN is not directly compatible with PMS. I think we need to figure out which pointer is causing the problem, and then find a workaround for inserting the pointer into the requesting file without pickling it.

devleaks commented 8 months ago

I dump output from dump1090 into files and then process them by another path. I'm on Appel Mac (silicon), fairly up-to-date OS, python, and libraries.