Skip to content

Instantly share code, notes, and snippets.

@dglaude
Created July 23, 2016 20:59
Show Gist options
  • Save dglaude/af0397d1dbde2c59f33f987ab73dfb89 to your computer and use it in GitHub Desktop.
Save dglaude/af0397d1dbde2c59f33f987ab73dfb89 to your computer and use it in GitHub Desktop.
LCD20 with lcdproc
### Setup of the i2c bus and tools ###
# Enable i2c bus with the menu of raspi-config
sudo raspi-config
# Reboot (this might not be necessary)
sudo shutdown -r now
# make sure Raspbian is up to date
sudo apt-get update
sudo apt-get upgrade
# Install i2c tools to verify the LCD connection:
sudo apt-get install i2c-tools
i2cdetect -l
##i2c-1 i2c 3f804000.i2c I2C adapter
i2cdetect -y 1
## 0 1 2 3 4 5 6 7 8 9 a b c d e f
## 00: -- -- -- -- -- -- -- -- -- -- -- -- --
## 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
## 20: -- -- -- -- -- -- -- 27 -- -- -- -- -- -- -- --
## 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
## 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
## 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
## 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
## 70: -- -- -- -- -- -- -- --
### Now start the download and instalation ###
cd
# Create a folder for all the git download
mkdir git
cd git
# Get the tree from the pull request from wilberforce
git clone -b i2c-config https://github.com/wilberforce/lcdproc-1.git
# Initially I did not notice the code was in a branch and did this:
# git clone https://github.com/wilberforce/lcdproc-1.git
# Make a local copy to avoid poluting:
cp -r lcdproc-1 lcdproc-i2c-config
# Get in our local copy
cd lcdproc-i2c-config/
# Get autoconf and configure
sudo apt-get -y install autoconf
sh autogen.sh
./configure --enable-drivers=hd44780
# Compile and install
sudo make install
### Verification of the installation detail ###
whereis LCDd
## LCDd: /usr/local/sbin/LCDd /usr/local/etc/LCDd.conf
ls -lsa /usr/local/sbin/LCDd
ls -lsa /usr/local/etc/
ls -lsa /usr/local/lib/lcdproc/
### Download my LCDd.conf for lcd20 with i2c remapping
# https://gist.github.com/dglaude/a14e19763a0bb43fa2bc7ca3bd0e029a
# curl -o LCDd.conf https://gist.githubusercontent.com/dglaude/a14e19763a0bb43fa2bc7ca3bd0e029a/raw/d5abb4031d2ac5fda3872e8cd64af247b3a83d60/LCDd.conf%2520for%2520lcd20%2520from%2520Rasp.iO
cd ..
curl https://gist.github.com/dglaude/a14e19763a0bb43fa2bc7ca3bd0e029a -o LCDd.conf
# Overwrite default LCDd.conf
sudo cp LCDd.conf /usr/local/etc/LCDd.conf
# Start LCDd in forground and maximum verbose
sudo LCDd -r 4 -f
## Server running in foreground
## Listening for queries on 127.0.0.1:13666
## HD44780: using ConnectionType: i2c
## hd44780: Using hd44780_default charmap
## HD44780: I2C: Init using D4 and D5, and or'd lines, invert
## HD44780: I2C: Pin RS mapped to 0x01
## HD44780: I2C: Pin RW mapped to 0x02
## HD44780: I2C: Pin EN mapped to 0x04
## HD44780: I2C: Pin BL mapped to 0x08
## HD44780: I2C: Pin D4 mapped to 0x10
## HD44780: I2C: Pin D5 mapped to 0x20
## HD44780: I2C: Pin D6 mapped to 0x40
## HD44780: I2C: Pin D7 mapped to 0x80
## HD44780: I2C: Invert Backlight 1
## HD44780: I2C: Using device '/dev/i2c-1' and address 0x27 for a PCF8574(A)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment