Skip to content
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

Port LCD to python3 #120

Merged
merged 28 commits into from Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a79a393
Fix whitespace, spelling.
bwduncan Oct 14, 2019
15ee20b
Fix dodgy merge commit 53a34285.
bwduncan Oct 14, 2019
f00bd63
Remove lcd padding.
bwduncan Oct 14, 2019
99661c8
Tidy up other scripts
bwduncan Oct 15, 2019
7ca0f58
Make lcd detect script more robust.
bwduncan Oct 17, 2019
1852b40
Python2/3 compatibility.
bwduncan Oct 17, 2019
4962ebb
Remove unnecessary logging.shutdown call.
bwduncan Jan 2, 2020
bafc492
Migrate to Python 3.
bwduncan Jan 3, 2020
e127839
Fix whitespace, spelling.
bwduncan Feb 6, 2020
d336adb
Python3
bwduncan Feb 6, 2020
9db9309
Merge branch 'master' of https://github.com/openenergymonitor/emonpi
bwduncan Feb 6, 2020
f36bbcd
python3 fixes next
alexandrecuer Mar 20, 2020
612a7d3
More Python3 fixes.
bwduncan Mar 30, 2020
0dbb480
Update emonPiLCD.py
alexandrecuer Jun 14, 2020
665145f
Update emonPiLCD.py
alexandrecuer Jun 14, 2020
240886b
Update emonPiLCD.py
alexandrecuer Jun 14, 2020
99b3464
Add missing encoding
bwduncan Jun 14, 2020
ef55f6f
Merge branch 'dromotherm-master'
bwduncan Jun 14, 2020
380e588
check_output is already returning string.
bwduncan Jun 14, 2020
764694c
LCD refactor.
bwduncan Jun 14, 2020
b7c856e
sd_image_version is already a string
bwduncan Jun 14, 2020
0786eb7
Simplify lcd driver.
bwduncan Jun 14, 2020
a096c6f
Refactor lcddriver. Probe directly.
bwduncan Jun 14, 2020
4d01abc
Avoid subprocess to detect SD image version.
bwduncan Jun 14, 2020
8ca3eac
Generalise MQTT->redis->display logic.
bwduncan Jun 14, 2020
e5d25db
Add a degree sign for the temperature pages.
bwduncan Jun 14, 2020
ca521fe
Remove unnecessary global.
bwduncan Jun 14, 2020
47b5c92
Bump version number.
bwduncan Jun 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 12 additions & 13 deletions lcd/README.md
@@ -1,4 +1,4 @@
# HD44780 LCD with PCF8574 I2c
# HD44780 LCD with PCF8574 I2c

I2C Address: 0x27

Expand All @@ -15,20 +15,19 @@ Un-comment / add the line

dtparam=i2c_arm=on

Edit kernal modules file:

$ sudo nano /etc/modules
Edit kernel modules file:

Add these line:
$ sudo nano /etc/modules

Add this line:

i2c-dev

Exit and save the file.

## Install the I2C utilities:

Usally pre-installed
Usually pre-installed

$ sudo apt-get install python-smbus i2c-tools

Expand All @@ -37,9 +36,9 @@ Enter "sudo reboot" to restart the pi and now the I2C pins will be available to

## Detect LCD on I2C bus and find out address

$ sudo i2cdetect -y 1
$ sudo i2cdetect -y 1

Expected output LCD is detect is `0x27` or `0x3F` e.g
Expected output is `0x27` or `0x3F` e.g.

```
pi@emonpi:~ $ sudo i2cdetect -y 1
Expand All @@ -54,17 +53,17 @@ pi@emonpi:~ $ sudo i2cdetect -y 1
70: -- -- -- -- -- -- -- --
```

Use port 0 for very olde 256Mb RAM pi (rev1) - not recomended to use this pi vesion
Use port 0 for very old 256Mb RAM pi (rev1) - not recommended to use this pi version

# Install emonPiLCD python script

```
sudo apt-get update
sudo apt-get install python-smbus i2c-tools python-rpi.gpio python-pip redis-server python-gpiozero -y
sudo pip install redis paho-mqtt xmltodict requests
sudo apt-get install python3-smbus i2c-tools python3-rpi.gpio python3-pip redis-server python3-gpiozero -y
sudo pip3 install redis paho-mqtt xmltodict requests
```

## Run as service
## Run as service

sudo ln -s /home/pi/emonpi/lcd/ /usr/share/emonPiLCD
sudo ln -s /home/pi/emonpi/lcd/emonPiLCD /etc/init.d/emonPiLCD
Expand Down
2 changes: 0 additions & 2 deletions lcd/disablessh.sh
Expand Up @@ -3,5 +3,3 @@
# Disable SSH
sudo update-rc.d ssh disable
sudo invoke-rc.d ssh stop

exit
4 changes: 4 additions & 0 deletions lcd/emonPiLCD.cfg
Expand Up @@ -23,6 +23,10 @@ mqtt_passwd = emonpimqtt2016
mqtt_host = 127.0.0.1
mqtt_port = 1883
mqtt_emonpi_topic = emonhub/rx/5/values
mqtt_temp1_topic = emon/emonpi/t1
mqtt_temp2_topic = emon/emonpi/t2
mqtt_vrms_topic = emon/emonpi/vrms
mqtt_pulse_topic = emon/emonpi/pulsecount
mqtt_feed1_topic = emon/emonpi/power1
mqtt_feed2_topic = emon/emonpi/power2

Expand Down