jamffm / cbpi4-lcdisplay Goto Github PK
View Code? Open in Web Editor NEWThis is the LCDisplay for CraftBeerPi4
License: GNU General Public License v3.0
This is the LCDisplay for CraftBeerPi4
License: GNU General Public License v3.0
Hi, I was browsing your code and found you want to get the status of the kettle heater element.
Assuming you do have a kettle_ID:
kettle = self.cbpi.kettle.find_by_id(kettle_ID)
heater = self.cbpi.actor.find_by_id(kettle.heater)
kettle_heater_state = heater.instance.state
Regards,
Alex
CBPi Version can be retrieved via this object which is independent of any path.
async def show_standby(self):
ip = await self.set_ip()
cbpi_version = self.cbpi.version
............
I experienced this already with the cbpi3 version when I connected the pi to ethernet and disabled the wlan connection.
Although the get_ip function has a try, the issue appears because there is no except.
By adding the except, the issue is solved. WLAN returns with 'Not connected' and the scrit moves on the eth0
async def get_ip(self, interface):
ip_addr = 'Not connected'
so = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
ip_addr = socket.inet_ntoa(
fcntl.ioctl(so.fileno(), 0x8915, struct.pack('256s', bytes(interface.encode())[:15]))[20:24])
except:
return ip_addr
finally:
return ip_addr
Hi Followed the installation instructions on - https://craftbeerpi.gitbook.io/craftbeerpi4/development#4-install-your-plugin-locally
I cant seem to get it to load, see below!
2021-07-20:08:57:45,986 ERROR [plugin_controller.py:58] FAILED to load plugin LCDisplay
2021-07-20:08:57:45,986 ERROR [plugin_controller.py:59] No module named 'LCDisplay.RPLCD'
Thanks for your help.
smbus2 is required for the plugin which is not installed per default. This could be added to the setup.py and would be installed automatically with installation of the plugin.
...............
packages=['LCDisplay'],
install_requires=[
'cbpi>=4.0.0.33',
'smbus2',
],
..................
I've recently installed CBPI4 after using CBPI3 for about a year without any problems. The LCD worked fine with CBPI3.
The plugin loads fine, no errors and the i2c address is recognised but nothing appears on the display. When the CBPI server is stopped I get the following error:
2022-06-14:13:22:00,928 ERROR [base_events.py:1738] Task exception was never retrieved
future: <Task finished name='Task-5' coro=<LCDisplay.run() done, defined at /usr/local/lib/python3.9/dist-packages/cbpi4-LCDisplay/init.py:127> exception=TypeError("'NoneType' object is not subscriptable")>
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/cbpi4-LCDisplay/init.py", line 167, in run
sensor_for_sensor_mode = await self.set_lcd_sensortype_for_sensor_mode()
File "/usr/local/lib/python3.9/dist-packages/cbpi4-LCDisplay/init.py", line 588, in set_lcd_sensortype_for_sensor_mode
sensor_type = (sensor_values["sensor_type"])
TypeError: 'NoneType' object is not subscriptable
I've done a number of clean installs of CBPI4 and re-installs of the plugin but the error persists. Any ideas?
Many thanks in advance.
Nick
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.