open3e / open3e

connects E3 (vcal, vdens, vx3...) controller through can uds or doip
Apache License 2.0
96 stars 22 forks source link

open3e --scanall fails with NegativeResponseException #154

Open bomilkar opened 4 hours ago

bomilkar commented 4 hours ago

After a firmware update on my Vitocal 250A it fails to generate a list of all DIDs:

$ open3e -c can0 -dev vcal --scanall
reading 0x680, 539 datapoints, please be patient...
Traceback (most recent call last):
  File "/home/pi/.local/bin/open3e", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/open3e/Open3Eclient.py", line 406, in main
    lst = ecu.readAll(args.raw)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/open3e/Open3Eclass.py", line 170, in readAll
    value,idstr = self.readByDid(int(did), raw=raw)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/open3e/Open3Eclass.py", line 154, in readByDid
    response = self.uds_client.read_data_by_identifier([did])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/udsoncan/client.py", line 167, in decorated
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/udsoncan/client.py", line 466, in read_data_by_identifier
    response = self.send_request(req)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/udsoncan/client.py", line 2258, in send_request
    raise NegativeResponseException(response)
udsoncan.exceptions.NegativeResponseException: ReadDataByIdentifier service execution returned a negative response ConditionsNotCorrect (0x22)

I ran open3e_depictSystem and all "normal" reads work like they did before. For instance:

$ open3e -c can0 -dev vcal -r 424,426 -v
vcal 424 MixerOneCircuitRoomTemperatureSetpoint {"Comfort": 23.0, "Standard": 21.0, "Reduced": 3.0, "Unknown2": "0000", "Unknown1": 0}
vcal 426 MixerTwoCircuitRoomTemperatureSetpoint {"Comfort": 23.0, "Standard": 21.0, "Reduced": 14.0, "Unknown2": "0000", "Unknown1": 0}
closing 0x680 - bye!
philippoo66 commented 3 hours ago

hi Roland @bomilkar !

the depict_system does not change anything in the outdated dev files (datapoints_vcal, datapoints_vdens, ...). use -cnfg devices.json instead of -dev ...

the -dev mechanism is an anachronism left from the beginings of open3e.

philippoo66 commented 3 hours ago

If you interested in the main ecu only, you might use -dev 680. the datapoints_680 gets updated by depict_system.

bomilkar commented 3 hours ago

Thanks! open3e -c can0 -cnfg devices.json --scanall Does the job. But both

open3e -c can0 -dev 680 --scanall
open3e -c can0 -dev 0x680 --scanall

crash with

ModuleNotFoundError: No module named 'open3e.Open3Edatapoints680'
ModuleNotFoundError: No module named 'open3e.Open3Edatapoints0x680'

respectively.

philippoo66 commented 2 hours ago

oh, sorry. so you need to do open3e -c can0 -dev _680 --scanall (including the underscore)

pls give me a short note if it works that way

philippoo66 commented 2 hours ago

ps. more details regarding the -dev issue see here: https://github.com/open3e/open3e/issues/153

bomilkar commented 2 hours ago

No, not yet:

 $ open3e -c can0 -dev _680 --scanall
Traceback (most recent call last):
  File "/home/pi/.local/bin/open3e", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/open3e/Open3Eclient.py", line 324, in main
    ecu = open3e.Open3Eclass.O3Eclass(ecutx=deftx, doip=args.doip, can=args.can, dev=args.dev)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/.local/lib/python3.11/site-packages/open3e/Open3Eclass.py", line 64, in __init__
    didmoduledev = importlib.import_module(module_name)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'open3e.Open3Edatapoints_680'

Open3Edatapoints_680.py exists in the current directory. Is the current directory not on the search path??

philippoo66 commented 2 hours ago

fu.. . I'm in a hurry right now, I will come back later.

It is a problem related to the pip installation. in earlier times it worked..