Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash on recieve with FLEX #3

Open
madmax-X opened this issue Dec 8, 2024 · 2 comments
Open

crash on recieve with FLEX #3

madmax-X opened this issue Dec 8, 2024 · 2 comments

Comments

@madmax-X
Copy link

madmax-X commented Dec 8, 2024

connect sdrpp to a local rtl_tcp server
network sink set to 127.0.0.1:8888

recieve pocsag/next transmisstion in sdrpp

crash mmng-ui

crash dump to follow:


$ mmng-ui 
╭───────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────╮
│ /home/[USERNAME]/.local/share/pipx/venvs/mmng-ui/lib/python3.12/site-packages/mmng_ui/pocsag.py:258 in on_output_message                                                                 │
│                                                                                                                                                                                      │
│   255 │   │   # Process the output as it becomes available                                     ╭────────────── locals ───────────────╮                                               │
│   256 │   │   log.write(f'[bold magenta]multimon-ng: {message.output}')                        │     log = RichLog(id='log')         │                                               │
│   257 │   │                                                                                    │ message = OutputMessage()           │                                               │
│ ❱ 258 │   │   result, json_detected = self.parse_line.parse(message.output)                    │    self = MainScreen()              │                                               │
│   259 │   │   self.log(f'result: {result}')                                                    │  status = StatusWidget(id='status') │                                               │
│   260 │   │                                                                                    │   table = DataTable(id='messages')  │                                               │
│   261 │   │   status.json_mode = json_detected                                                 ╰─────────────────────────────────────╯                                               │
│                                                                                                                                                                                      │
│ /home/[USERNAME]/.local/share/pipx/venvs/mmng-ui/lib/python3.12/site-packages/mmng_ui/reader.py:125 in parse                                                                             │
│                                                                                                                                                                                      │
│   122 │   │   │   elif re.search(r'FLEX[:|]', line):                                                                                                                                 │
│   123 │   │   │   │   address_match = re.search(r'FLEX[:|] ?.*?[\[|](\d*?)[\]| ]', line)                                                                                             │
│   124 │   │   │   │   if address_match:                                                                                                                                              │
│ ❱ 125 │   │   │   │   │   address = address_match.group(1).trim()                                                                                                                    │
│   126 │   │   │   │                                                                                                                                                                  │
│   127 │   │   │   │   # Handle timestamps within FLEX                                                                                                                                │
│   128 │   │   │   │   if self.use_timestamp:                                                                                                                                         │
│                                                                                                                                                                                      │
│ ╭────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────╮                                                       │
│ │ address_match = <re.Match object; span=(21, 75), match='FLEX|2024-12-08 15:11:24|3200/4/F/A|02.086|429496>                 │                                                       │
│ │     json_line = None                                                                                                       │                                                       │
│ │          line = '2024-12-08 10:11:24: FLEX|2024-12-08 15:11:24|3200/4/F/A|02.086|4294965699|ALN|*'+43                      │                                                       │
│ │       message = None                                                                                                       │                                                       │
│ │        result = PocsagMessage(current_time=<Moment(2024-12-08T10:11:24)>, timestamp=None, address=None, trim_message=None) │                                                       │
│ │          self = ParseLine(send_function_code=True, use_timestamp=True, json_detected=False)                                │                                                       │
│ │   time_string = None                                                                                                       │                                                       │
│ │     timestamp = None                                                                                                       │                                                       │
│ │  trim_message = None                                                                                                       │                                                       │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'str' object has no attribute 'trim'
Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x7fefc1152700>
Traceback (most recent call last):
  File "/usr/lib/python3.12/asyncio/base_subprocess.py", line 126, in __del__
    self.close()
  File "/usr/lib/python3.12/asyncio/base_subprocess.py", line 104, in close
    proto.pipe.close()
  File "/usr/lib/python3.12/asyncio/unix_events.py", line 767, in close
    self.write_eof()
  File "/usr/lib/python3.12/asyncio/unix_events.py", line 753, in write_eof
    self._loop.call_soon(self._call_connection_lost, None)
  File "/usr/lib/python3.12/asyncio/base_events.py", line 795, in call_soon
    self._check_closed()
  File "/usr/lib/python3.12/asyncio/base_events.py", line 541, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

@lingfish
Copy link
Owner

lingfish commented Dec 9, 2024

Thanks for this, looking into it now; the fix is obvious, but because I have no access to FLEX decode output from multimon-ng, I've had to do some guessing.

Could you run something similar (without mmng-ui in the middle), and paste here a few lines of the multimon-ng output for FLEX? It is truncated in my exception.

lingfish added a commit that referenced this issue Dec 9, 2024
This should partially fix crashes around FLEX; it needs improvement to better handle FLEX fragments, and will just currently output everything that it sees from multimon-ng.

Some detail at #3

Changelog: fixed
@lingfish
Copy link
Owner

lingfish commented Dec 9, 2024

This should be partially fixed by 77242a8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants