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

Socket Att. Error #6

Open
Rumors01 opened this issue Jan 19, 2021 · 5 comments
Open

Socket Att. Error #6

Rumors01 opened this issue Jan 19, 2021 · 5 comments

Comments

@Rumors01
Copy link

Hi,

While I try to work with sample code to test the algorithm that you have wrotten, I got this below error;

Traceback (most recent call last):
  File "gas.py", line 16, in <module>
    client.read_parameters([IFlagParameter(id=0x5e, data_class=CorusString)])
  File "/usr/local/lib/python3.6/dist-packages/iflag/client.py", line 70, in read_parameters
    in_data = self._read_parameters_by_id(parameter_ids)
  File "/usr/local/lib/python3.6/dist-packages/iflag/client.py", line 252, in _read_parameters_by_id
    self.transport.send(msg.to_bytes())
  File "/usr/local/lib/python3.6/dist-packages/iflag/transport.py", line 67, in send
    self._send(data)
  File "/usr/local/lib/python3.6/dist-packages/iflag/transport.py", line 132, in _send
    self.socket.sendall(data)
AttributeError: 'TcpTransport' object has no attribute 'socket'

Please give some tips :)

@Krolken
Copy link
Contributor

Krolken commented Jan 19, 2021

Good catch!

The examples are missing a call to client.startup()

Also I see an error in the TCP transport class. It should initialize with an optional attribute for socket but seems like I have missed that and it is instead added to the class when you call connect. But if you call .startup() on the client before read or write it should work.

@Rumors01
Copy link
Author

@Krolken Thank you so much for the feedback ! :)

As you mentioned above, when I tried to connect with the device now I got the below error. But the ip adress is working and I getting response from it.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/iflag/transport.py", line 114, in connect
    self.socket.connect(self.address)
socket.timeout: timed out

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

Traceback (most recent call last):
  File "gas.py", line 16, in <module>
    client.startup()
  File "/usr/local/lib/python3.6/dist-packages/iflag/client.py", line 216, in startup
    self.transport.connect()
  File "/usr/local/lib/python3.6/dist-packages/iflag/transport.py", line 116, in connect
    raise exceptions.CommunicationError from e
iflag.exceptions.CommunicationError

@Krolken
Copy link
Contributor

Krolken commented Jan 19, 2021

How do you know that the IP address is working? You get a connection timeout so there should be some problem access it.
What gas meter and modem are you using?

@Rumors01
Copy link
Author

If you could send me the your e-mail, I will create a test environment and give you the IP and port. I tried last night with other tools also but no luck. I am using Itron Corus PTZ with RS232 serial to IP converter.

@Krolken
Copy link
Contributor

Krolken commented Jan 20, 2021

Hi. To do the troubleshooting would be part of our paid services. If that is interesting you can contact me at [email protected].

But I still think your IP-to-serial converter is the problem. You are not able to connect to the socket from you computer/server.

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