gmnvh / pycarmaker

Class to control and read information from CarMaker (https://ipg-automotive.com/)
42 stars 13 forks source link

Reading_camera.py #11

Open aithlab opened 3 years ago

aithlab commented 3 years ago

Hi, thanks for the great work!

I tried to run Ex03_Reading_camera.py, and I followed the process of creating the VDS.cfg file in your README. However, an error occurred as follows:

ConnectionRefusedError: [Errno 111] Connection refused

How could I solve this error?

gmnvh commented 3 years ago

@HemaZ Did you ever see this error before when developing the example?

aithlab commented 3 years ago

No, when I run the other example codes, I did not see the error. Other codes work well.

HemaZ commented 3 years ago

VDS by default uses ip="localhost", port=2210", make sure that your pycarmaker instance is using the same ip/ports https://github.com/gmnvh/pycarmaker/blob/b9afb6cf1ea3ff482bbb6f3bfd832a704c886d17/pycarmaker/CarMaker.py#L134

aithlab commented 3 years ago

When I run the example code, Ex01_ReadVehicleSpeed.py, I used IP and port number as 'localhost' and 16660, respectively. Followed your comment, I used this IP address and port, 'localhost' and 16660, in the Reading_camera.py code. The error I reported has not occurred anymore, but it seems to look like that the remaining codes are not working.

I checked that "vds.connect()" is not working. In detail, the part of "data = self.socket.recv(64)" in the connect method of VDS class is not working.

def connect(self): self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.connect((self.ip, self.port)) data = self.socket.recv(64) if(data.decode().find("*IPGMovie") != -1): self.logger.info("IPG Movie is Connected...") self.connected = True

I am not familiar with using the socket, and this may be a basic question. Is it not necessary to send a message through the "socket.send" method to receive image data?