espros / epc-tofcam-toolkit

This package provides a python interface to the espros TOFcam's. It also provides a simple GUI to visualize the data from the camera.
MIT License
3 stars 2 forks source link

Unable to connect to TOFcam-660 #4

Open blaine-m19 opened 3 days ago

blaine-m19 commented 3 days ago

Hello,

I am trying to run the example python code for the TOFcam-660 from the ReadTheDocs site here on a DME 660 camera. I am on Windows, and am using Python 3.11.10 in a Conda environment in VS Code. The toolkit was installed using pip. When I run the code using the factory default IP address for the camera, I get the following error:

Traceback (most recent call last): File "D:\Blaine\ESPROS_TOF660_API\.conda\Lib\site-packages\epc\tofCam660\interface.py", line 29, in __init__ self.socket.connect((ipAddress, port)) TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "d:\Blaine\ESPROS_TOF660_API\TOF660_test.py", line 8, in <module> cam = TOFcam660() ^^^^^^^^^^^ File "D:\Blaine\ESPROS_TOF660_API\.conda\Lib\site-packages\epc\tofCam660\tofCam660.py", line 308, in __init__ self.tcpInterface = Interface(ip_address, tcp_port) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Blaine\ESPROS_TOF660_API\.conda\Lib\site-packages\epc\tofCam660\interface.py", line 31, in __init__ raise ConnectionError(f'No camera found at address {ipAddress}:{port}\n{e}') ConnectionError: No camera found at address 10.10.31.180:50660 [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond Exception ignored in: <function TOFcam660.__del__ at 0x00000251F9DE3380> Traceback (most recent call last): File "D:\Blaine\ESPROS_TOF660_API\.conda\Lib\site-packages\epc\tofCam660\tofCam660.py", line 316, in __del__ self.tcpInterface.close() ^^^^^^^^^^^^^^^^^ AttributeError: 'TOFcam660' object has no attribute 'tcpInterface'

When I run the code with the default IP address for the Beaglebone Black (192.168.7.2) I receive the following error:

PS D:\Blaine\ESPROS_TOF660_API> & d:/Blaine/ESPROS_TOF660_API/.conda/python.exe d:/Blaine/ESPROS_TOF660_API/TOF660_test.py 2024-10-21 15:01:15,949: INFO [TOFcam660] - Setting modulation frequency: 12 MHz, channel: 0 Traceback (most recent call last): File "d:\Blaine\ESPROS_TOF660_API\TOF660_test.py", line 10, in <module> cam.initialize() File "D:\Blaine\ESPROS_TOF660_API\.conda\Lib\site-packages\epc\tofCam660\tofCam660.py", line 330, in initialize self.settings.set_modulation(12) File "D:\Blaine\ESPROS_TOF660_API\.conda\Lib\site-packages\epc\tofCam660\tofCam660.py", line 206, in set_modulation self.interface.transceive(set_mod_cmd) File "D:\Blaine\ESPROS_TOF660_API\.conda\Lib\site-packages\epc\tofCam660\interface.py", line 39, in transceive response = self.receive() ^^^^^^^^^^^^^^ File "D:\Blaine\ESPROS_TOF660_API\.conda\Lib\site-packages\epc\tofCam660\interface.py", line 55, in receive size = self._receiveHeader() ^^^^^^^^^^^^^^^^^^^^^ File "D:\Blaine\ESPROS_TOF660_API\.conda\Lib\site-packages\epc\tofCam660\interface.py", line 61, in _receiveHeader response = self.receiveBytes(struct.calcsize('!II')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Blaine\ESPROS_TOF660_API\.conda\Lib\site-packages\epc\tofCam660\interface.py", line 81, in receiveBytes raise EOFError('Could not receive all expected data') EOFError: Could not receive all expected data

It seems that my computer only recognizes the camera when I connect via the Beaglebone IP address, but the device is not sending out data. Which connection settings are correct? If I am meant to use the factory default IP address, how should I fix the connection issue?

EDIT: I am able to connect and interface with the camera using the GUI via the Beaglebone IP address. The issue seems to only be with the Python toolkit.

epc-ake commented 3 days ago

Are you using the DMA660/635? This python package is only compatible with the standard TOFcams.