-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fixes to work with current API (2.1.9) and OS #8
base: master
Are you sure you want to change the base?
Conversation
Open Sprinkler API has changed, causing errors in opsiLCD.py. Updated to work with v.2.1.9. Also, fixed the network IP detection. Previous method of "hostname -I" returned all addresses, including IPv6, with no guaranteed order. Now uses the netifaces library and a defined variable for specifying which interface will be used (wlan, eth0, etc.) The downside is that it requires installation of netifaces. The upside is that it should be a bit more future-proof. Here's hoping.
Sorry @sirkus7 tell me how to update the Ospilcd.py file? |
@wifi75, for now it may be easiest for you to just clone my patched branch referenced above. Or you can visit my repo branch and just grab that file. |
Hi @sirkus7. Thanks for fixing ospiLCD script. 👍 |
Hello how i can update? |
@wifi75 Go to @sirkus7 fork https://github.com/sirkus7/ospiLCD/tree/api-update-2.1.9 and follow his updated instructions. |
@stanoba @sirkus7 hello
|
Python pip is not included in all Raspian images and must first be installed. Added pip to the existing apt isntall command, and moved it to the beginning to make it work smoothly.
The new OpenSprinkler API responds with a parameter called "pass" which is a keyword and therefore cannot be used to create an object. Fixed by replacing "pass" term with "password" prior to deserializing the JSON response.
@wifi75 I tested on a new install and hit the same issue you did, so clearly I had some other differences on my system that allowed things to work. So thanks for pointing out that problem. |
@sirkus7 after that operation same problem:
|
@wifi75 That's the old version. You can get the one I updated here: |
@sirkus7 ok yes now the script work but display it is black, where is on opensprinkler setting the light level? |
@wifi75 Haha, I honestly don't know where that setting can be found. I've only recently installed opensprinkler, and I haven't found the light level setting in the UI. It's possible it has been removed for the RPi version. For my purposes, I turned the backlight on permanently because I couldn't find that feature. If that would be okay for you as well, you can add the following line of code at line 164 (in my version of the script) to turn the backlight on: [Update: I corrected the line above] |
that |
Yes. Though, let me correct something. The line should be backlight = True So, If you've used my updated version of the ospiLCD.py file, and if you'd like the LCD backlight to be on all the time, then you can simply insert that one line of code at line into the ospiLCD.py file at line 164. Just to show that line in context, the new line of code is placed right before the lcd device is created to display the information, so it would look like this in the script. backlight = True
lcd = i2c.CharLCD(i2c_expander=LCD_i2c_expander, address=LCD_i2c_address, port=1, cols=LCD_cols, rows=LCD_rows,
dotsize=8, charmap='A02', auto_linebreaks=True, backlight_enabled=backlight) The result will be that the backlight is always enabled. Hope that helps. |
nice now work! |
Open Sprinkler API has changed, causing errors in opsiLCD.py. Updated
to work with v.2.1.9.
Also, fixed the network IP detection. Previous method of "hostname -I"
returned all addresses, including IPv6, with no guaranteed order. Now
uses the netifaces library and a defined variable for specifying which
interface will be used (wlan, eth0, etc.) The downside is that it
requires installation of netifaces. The upside is that this approach
should be relatively stable and future proofed from OS changes.
README updated to reflect library install requirement.