Giter Club home page Giter Club logo

jlr2mqtt's People

Contributors

smar000 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

jlr2mqtt's Issues

ssl.SSLWantReadError: The operation did not complete (read). When "keep alive is set to 0" in paho-mqtt version 1.4 MQTTs has SSL issues.

Previously i was using paho-mqtt version 1.5.0. In which i faced a problem if the keep-alive is set to 0. Then I referred to this link (I also had the same problem) [https://github.com//issues/2] #2. Then i tried with paho mqtt version 1.4. In which, It worked fine for non secure MQTT. Where as for secure MQTT, I got the following error

mqttc.connect(broker,` port=port, keepalive =0) #returns on_connect()
File "/usr/local/lib/python3.6/dist-packages/paho/mqtt/client.py", line 839, in connect
return self.reconnect()
File "/usr/local/lib/python3.6/dist-packages/paho/mqtt/client.py", line 994, in reconnect
sock.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLWantReadError: The operation did not complete (read) (_ssl.c:852)

If i set the keepalive > 0 it is working fine for MQTTs.
Could you please explain me what could be the cause of this following error?

Multiple Vehicle Support

The script only appears to check for the first vehicle status:

jlr_connection.vehicles[0]

This is called only a handful of times in the code. I have two vehicles on the same account, so to access my second vehicle I believe I must call:

jlr_connection.vehicles[1]

Could the script and configuration file be enhanced to allow me to pass this array index through via a config file setting?

Wont Run

Hello, Managed to install this but when i run it i get the error below. any ideas?

import jlr2mqtt.py
2020-03-22 17:46:55,276 - INFO - Connecting to mqtt server 192.168.1.5
Traceback (most recent call last):
File "", line 1, in
File "/home/pi/Desktop/jlr/jlr2mqtt.py", line 516, in
mqtt_client = initialise_mqtt_client(mqtt.Client(client_id=MQTT_CLIENTID))
File "/home/pi/Desktop/jlr/jlr2mqtt.py", line 102, in initialise_mqtt_client
mqtt_client.connect(MQTT_SERVER, port=1883, keepalive=0, bind_address="")
File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 937, in connect
return self.reconnect()
File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 1071, in reconnect
sock = self._create_socket_connection()
File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 3522, in _create_socket_connection
return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
File "/usr/lib/python3.7/socket.py", line 727, in create_connection
raise err
File "/usr/lib/python3.7/socket.py", line 716, in create_connection
sock.connect(sa)
BlockingIOError: [Errno 115] Operation now in progress

Connection Fails with BlockingIOError: [Errno 115] Operation now in progress

This issue was originally discussed on the OH2 forum.

2020-04-30 11:06:18,650 - INFO - Connecting to mqtt server 127.0.0.1
Traceback (most recent call last):
  File "jlr2mqtt.py", line 579, in <module>
    mqtt_client = initialise_mqtt_client(mqtt.Client(client_id=MQTT_CLIENTID))
  File "jlr2mqtt.py", line 108, in initialise_mqtt_client
    mqtt_client.connect(MQTT_SERVER, port=1883, keepalive=0, bind_address="")
  File "/usr/local/lib/python3.6/dist-packages/paho/mqtt/client.py", line 937, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.6/dist-packages/paho/mqtt/client.py", line 1071, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.6/dist-packages/paho/mqtt/client.py", line 3522, in _create_socket_connection
    return socket.create_connection(addr, source_address=source, timeout=self._keepalive)
  File "/usr/lib/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
BlockingIOError: [Errno 115] Operation now in progress

The above error occurs when using the local LAN IP and the localhost IP. Testing using the guide here confirms the mosquitto server is working properly and subscribe/publish works.

Python version: 3.6.9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.