OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Does anyone have a working I2C LCD working?

Tagged: , ,

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #75524

    Vernon Graner
    Participant

    Hey Folks!

    I am new to Open Sprinkler Pi. I have the pi installed and working and I can get the OpenSprinkler web site. So far, so good 👍🙂 Next, I am trying to get the 2×16 LCD I2C display to work. I started by following the steps listed on this web site:

    https://github.com/stanoba/ospiLCD

    And it was a bumpy ride ಠ_ಠ – Specifically, the commands as listed don’t work anymore due to changes in the raspberry PI OS. Then, when I finally got the install to work, when I run the script, I get this error:

    pi@ospi:~ $ ./ospiLCD.py
    Traceback (most recent call last):
    File “/home/pi/./ospiLCD.py”, line 50, in <module>
    ja = get_data(api_url)
    File “/home/pi/./ospiLCD.py”, line 46, in get_data
    variables = json.loads(data, object_hook=lambda d: namedtuple(‘X’, d.keys())(*d.values()))
    File “/usr/lib/python3.9/json/__init__.py”, line 359, in loads
    return cls(**kw).decode(s)
    File “/usr/lib/python3.9/json/decoder.py”, line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File “/usr/lib/python3.9/json/decoder.py”, line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
    File “/home/pi/./ospiLCD.py”, line 46, in <lambda>
    variables = json.loads(data, object_hook=lambda d: namedtuple(‘X’, d.keys())(*d.values()))
    File “/usr/lib/python3.9/collections/__init__.py”, line 393, in namedtuple
    raise ValueError(‘Type names and field names cannot be a ‘
    ValueError: Type names and field names cannot be a keyword: ‘pass’
    pi@ospi:~ $

    So, I then followed the steps shown on the mqtt version of the script with is located here:

    https://github.com/sirkus7/ospiLCD-mqtt

    This was also quite a bumpy ride. When, again, I *finally* got the script to run, it did actually update the LCD display to say:

    Connecting to
    MQTT broker…

    But then it displays the following error:

    pi@ospi:~ $ ./ospiLCD-mqtt.py
    Traceback (most recent call last):
    File “/home/pi/./ospiLCD-mqtt.py”, line 257, in <module>
    client.connect(mqttAddress, mqttPort, 60)
    File “/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py”, line 912, in connect
    self.connect_async(host, port, keepalive,
    File “/usr/local/lib/python3.9/dist-packages/paho/mqtt/client.py”, line 979, in connect_async
    if port <= 0:
    TypeError: ‘<=’ not supported between instances of ‘str’ and ‘int’
    pi@ospi:~ $

    So, it seems that changes in the versions of Python have made it so neither of these scripts work anymore. Unfortunately, I’m not a python programmer so I don’t have the debugging skills necessary to diagnose these errors, but I sure would like to have a working LCD. Does anyone have any pointers they can share on how I might be able to make this work..?

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Does anyone have a working I2C LCD working?