Giter VIP home page Giter VIP logo

cbpi4-lcdisplay's Introduction

LCD add-on for CraftBeerPi 4

With this add-on you can display your Brewing steps temperatures on a 20x4 i2c LCD Display. In the future: In addition you can display the target-temperature and current-temperature of each fermenter.

This addon only works with I2C connected LCD Displays.

Installation

Wiring:

Display PI
SDA Pin 3 GPIO02(SDA1)
SCL Pin 5 GPIO03(SDL1)
VCC Pin 2 Power 5V
GND Pin 6 GND

I2C Configuration:

Ensure to activate the I2C connection in Raspi configuration.

Software installation:

Look at https://openbrewing.gitbook.io/craftbeerpi4_support/readme/plugin-installation. I can't explain that any better. The following description may still work for Raspi OS before Bookwom. For Bookworm goto Configuration after installing

Software installation via pypi (recommended)

This is the official installation via PyPI like Manuel83 (the developer) intended.
Navigate in the Linux console to the folder from which you start cbpi4.
Usually like: cd /home/pi/cbpi4........
Do not generate a folder for the plugin as it is generated by the code.

Type in

sudo pip3 install cbpi4-LCDisplay
sudo cbpi add cbpi4-LCDisplay

The plugin will be installed in:

/usr/local/lib/python3.7/dist-packages/cbpi4-LCDisplay/*

Software installation version1 (for developers)

Navigate in the Linux console to the folder from which you start cbpi4. Usually like: cd /home/pi/cbpi4........ Do not generate a folder for the plugin as it is generated by the code.
Then execute the commands in the raspi command box:

cd /home/pi/cbpi4   		# subtitude /cbpi4 with your folder where you start cbpi. In this folder run the following commands
sudo cbpi create cbpi4-LCDisplay
sudo chown -R pi cbpi4-LCDisplay
sudo pip3 install -e ./cbpi4-LCDisplay
cbpi add cbpi4-LCDisplay
sudo rm -r cbpi4-LCDisplay/
sudo git clone https://github.com/JamFfm/cbpi4-LCDisplay

What does the Code? It installs a default plugin named cbpi4-LCDisplay. During installation several registrations are made. The folder cbpi4-LCDisplay is deleated and the new folder is generated by the clone process.

In the log when starting cbpi4 you hopefully will notice that LCDisplay started without errors. Your user has to have permissions to write in the filesystem. This is usually the case when you use user pi.


Software installation version2 (for developers)

There is another way to install like:

sudo pip3 install https://github.com/JamFfm/cbpi4-LCDisplay/archive/main.zip

but this one installs in /usr/local/lib/python3.7/dist-packages/cbpi4-LCDisplay/* This is not handy if you need to assess the code. I do not recommend now. But this seems to be the desired folder to install via pip package. Please do not mix the possibilities to install.


Delete plugin

Navigate in the Linux console to the folder from which you start cbpi4. Usually like: cd /home/pi/cbpi4........ Then execute the commands in the raspi command box:

sudo pip3 uninstall cbpi4-LCDisplay
sudo cbpi remove cbpi4-LCDisplay

Configuration

At least configure your i2c address in the settings menu. Have a look at this documentation.

There are different modes:

Default display

If no brewing process is running the LCD will show

  • CraftBeerPi-Version
  • Brewery-name
  • Current IP address
  • Current date/time

Multidisplay mode

  • The script will loop through your kettles and display the target and current temperature.
  • If heater is on, a beer-glass symbol will appear in the first row on the right side (not flashing).
  • Use refresh parameter in settings to slow down or speed up the kettle changes.
  • When target-temperature is reached it displays the remaining time of the step (rest) too.
  • If the step name got the string "boil" in its name the remaining time to the next hop addition will be displayed.
    Otherwise the display of a boil type step looks the same as all the other steps.

Single mode

  • Only displays one kettle but reacts a little faster on temperature changes.
  • It displays the remaining time of the step (rest) when target temperature is reached.
  • A small beer-glass is flashing on/off in the first row on the right side to indicate that the heater is on.
  • If the step name got the string "boil" in its name the remaining time to the next hop addition will be displayed. Otherwise the display of a boil type step looks the same as all the other steps.

Sensor mode

  • Only displays the values and names of the sensortype.

  • E.g. a iSpindel sensor can display temperature, gravity, battery etc. These values with corresponding sensor name is shown.

  • The sensortype to be displayed is changed in settings section.

  • Only use this configuration when using avollkopfs fork of cbpi4: https://github.com/avollkopf/craftbeerpi4.

  • If you use original cbpi4 from Manuel you can have a look at the commands in the beginning of__init__ file.

  • If there is a missing sensor like from a future addon it can be added by typing in the code of function "set_sensortype_for_sensor_mode1" in the init.py file. there is only OneWire and CustomSensor functional (even some more are selectable).

Fermenter mode: not implemented

  • Pretty much the same as multidisplay for all fermenter.
  • Starts automatically if there is no brewstep running and an active fermenterstep
  • Displays the brew-name, fermenter-name, target-temperature, current-temperature of each fermenter.
  • If the heater or cooler of the fermenter is on it will show a symbol. A beer-glass detects heater is on, * means cooler in on.
  • The remaining time for each fermenter is shown like in weeks, days, hours.
  • Fermenter mode starts when a fermenter-step of the fermenter is starting and no brewing step is running(most likely)
  • if there is a iSpindel sensor the Gravity is displayed at the corresponding fermenter.

Parameter

There are several parameter to change in the settings menu:

LCD_Address:
This is the address of the LCD module. You can detect it by using the following command in the command box of the Raspi:

  • sudo i2cdetect -y 1 or
  • sudo i2cdetect -y 0.

Default is 0x27.

LCD_Charactermap:
Changes value between A00 and A02. This is a character map build in by factory into the LCD. Most likely you get an LCD with A00 when you by it in China. A00 has got most of the European letters, and a lot of Asia letters. For germans the ÄÖÜß is missing in A00. In A02 there are more European letters incl. ÄÖÜß. Therefore, the addon distinguish between the charmaps. In case A00 it substitutes ÄÜÖß with custom-made symbols which represent these letters. In case A02 the addon skips substitution. If you notice strange letters try to change this parameter. Default is "A00".

LCD_Display_Mode:
Changes between the 3 modes. Default is Multidisplay:

  • Multidisplay
  • Singledisplay
  • Sensordisplay

LCD_Display_Sensortype:
Changes between sensortype (is like family of same sensors) which will be displayed in the sensormode (sensordisplay). Default is OneWire sensors. If there is more than one sensor of same sensor type the display toggles between the sensors

LCD_Refresh:
In Multidisplay and Sensor mode this is the time to wait until switching to next displayed kettle. Default is 3 sec.

LCD_Singledisplay:
Here you can change the kettle to be displayed in single mode.

Hints

  • This is running in python3

  • Changing an LCD_xxxx parameter in the parameters menu or any file in LCDisplay folder usually requires a reboot.

  • Whenever you need a reboot, have a look in the comments of the parameters.

  • Future: A new fermenter should have a target temperature and at least one step defined.

  • Future: Maybe it is necessary to restart craftbeerpi after adding a new fermenter.

  • If the LCD address (e.g. 0x27) is right, but you still can not see letters displayed:

    • try to adjust contrast by the screw on the back of the LCD Hardware (I2C Module)
    • be sure to provide the LCD hardware with the right amount of voltage (mostly 5V or 3.3V)
    • use a strong power-supply. If you notice LCD fading, there is a lack of current.
    • the LCD needs same ground like Raspi. Otherwise i2c does not detect the i2c device (took me a day to find out).
    • use proper connections. Soldering the wires is best for connection. Bad connection can also result in fading the LCD.

Known Problems

The LCD hardware does not like temperature below 0°C (32°F). It becomes slow and can be damaged like brightness is no more homogenous throughout the hole LCD area. Fermenters are not implemented as they are not implemented in CBPI4 until now (10-2021). If you need Fermenter in combination with fermenter have a look at https://github.com/PiBrewing/cbpi4-LCDisplay.

Questions

Questions can be posed in the Craftbeerpi user group in Facebook or in the repository.

Fixed Issues

  • has to be done

cbpi4-lcdisplay's People

Contributors

jamffm avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cbpi4-lcdisplay's Issues

Problem with get_ip if wlan is not connected

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

Kettle Heater Status

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

Plugin loads but doesn't display anything

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

smbus2 required -> could be added to setup.py

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',
],
..................

cbpi version for Stanby screen

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
        ............

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.