numat / numat/midas

TimeoutError: Not connected to Midas-M

Open
#38 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Hello - thank you for this resource.

I am working with Midas-M sensor (link to manual), which is a newer version by the looks, but very much the same skeleton.

I was able to get the sensor hooked up to my PC with the PoE.

I can hit the sensor's default IP (169.254.60.47) from my PC's browser, as shown below.
image

Since I want to receive data using your drive, I set up a virtual environment with python 3.10 and successfully pip installed the midas package within.

However, when I run midas 169.254.60.47, I get a response below:

(midas) dlee@laptop-dlee01:~/myprojects/midas$ midas 169.254.60.47
Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/BOSDYN/dlee/venv/midas/lib/python3.10/site-packages/midas/util.py", line 134, in _request
    return await future(*args, **kwargs)
  File "/home/BOSDYN/dlee/venv/midas/lib/python3.10/site-packages/pymodbus/client/base.py", line 198, in async_execute
    resp = await asyncio.wait_for(req, timeout=self.params.timeout)
  File "/usr/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/BOSDYN/dlee/venv/midas/bin/midas", line 8, in <module>
    sys.exit(command_line())
  File "/home/BOSDYN/dlee/venv/midas/lib/python3.10/site-packages/midas/__init__.py", line 29, in command_line
    loop.run_until_complete(get())
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/BOSDYN/dlee/venv/midas/lib/python3.10/site-packages/midas/__init__.py", line 26, in get
    print(json.dumps(await detector.get(), indent=4, sort_keys=True))
  File "/home/BOSDYN/dlee/venv/midas/lib/python3.10/site-packages/midas/driver.py", line 67, in get
    return self._parse(await self.read_registers(0, 16))
  File "/home/BOSDYN/dlee/venv/midas/lib/python3.10/site-packages/midas/util.py", line 75, in read_registers
    r = await self._request('read_holding_registers', address, count)
  File "/home/BOSDYN/dlee/venv/midas/lib/python3.10/site-packages/midas/util.py", line 136, in _request
    raise TimeoutError("Not connected to Midas.") from e
TimeoutError: Not connected to Midas.

I can ping the address, as well as hit the sensor's website on my browser, so it doesn't look like a connectivity issue. Can you provide insight?

Much thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing command path in midas/init.py and inspect midas/driver.py and midas/util.py, especially read_registers and _request. Reproduce the timeout against the reported sensor address and trace the read_holding_registers request. Done means identifying whether the newer Midas-M is supported and documenting or correcting the connection behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.