julianbruegger / corona-display

Keep Track of the Corona-Numbers
GNU General Public License v3.0
46 stars 9 forks source link

Bug #11

Open wawawa15 opened 4 years ago

wawawa15 commented 4 years ago

Rpi zero with 16x2 display i2c. After sudo./install.sh I run python3 display_16x2.py :

Traceback (most recent call last): File "display_16x2.py", line 4, in from module.i2c import * File "/home/pi/corona-display/module/i2c.py", line 30, in bus = smbus.SMBus(1) # Rev 2 Pi uses 1 FileNotFoundError: [Errno 2] No such file or directory

julianbruegger commented 4 years ago

Im going to check for that

julianbruegger commented 4 years ago

Looks like you're missing the smbus package. Just run: sudo apt-get install python3-smbus Im going to include that in the install.sh

Im going to include that in the install.sh

wawawa15 commented 4 years ago

Still: https://imgur.com/a/RnTQ4jv Ignore second display :)))

julianbruegger commented 4 years ago

Ohh...

  1. Did you activated i2c in raspi-config?
  2. What result do you get running: sudo i2cdetect -y 0
  3. What result do you get running: sudo i2cdetect -y 1
wawawa15 commented 4 years ago

https://imgur.com/a/K7VKkyF Yes, I activated i2c in raspi config but still not working. I don't have a 16x2 display without i2c.

julianbruegger commented 4 years ago

Can you give me he output of 2. / 3.?

wawawa15 commented 4 years ago

Can you be more specific? I'm begginer with Rpi. Now I try with rpi 3 but same problem.

julianbruegger commented 4 years ago

Run those two Comands and send me the outputs.

  1. What result do you get running: sudo i2cdetect -y 0
  2. What result do you get running: sudo i2cdetect -y 1
wawawa15 commented 4 years ago

Here's the output: https://imgur.com/a/jOdFSAO pi@raspberrypi:~ $ sudo i2cdetect -y 0 Error: Could not open file /dev/i2c-0' or/dev/i2c/0': No such file or directory pi@raspberrypi:~ $ sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3f 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
or pi@raspberrypi:~/corona-display $ sudo i2cdetect -y 0 Error: Could not open file /dev/i2c-0' or/dev/i2c/0': No such file or directory pi@raspberrypi:~/corona-display $ sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3f 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --

julianbruegger commented 4 years ago

Okey, looks alright.. Try changing sudo nano modules/i2c.py

Line 9: I2C_ADDR = 0x27 # I2C device address to I2C_ADDR = 0x3f # I2C device address

Also try this Guide

wawawa15 commented 4 years ago

Now i have this problem: pi@raspberrypi:~/corona-display $ python3 display_16x2.py

Traceback (most recent call last): File "display_16x2.py", line 28, in lcd_string((cc), (deaths_c)+(" Deaths"),LCD_LINE_1) TypeError: lcd_string() takes 2 positional arguments but 3 were given

julianbruegger commented 4 years ago

Looking better!

Try: sudo nano display_16x2.py

on line 16 lcd_string((cc), (deaths_c)+(" Deaths"),LCD_LINE_1) to lcd_string((cc)+(" ")+(deaths_c)+(" Deaths"),LCD_LINE_1)

wawawa15 commented 4 years ago

I make what you said but this error appeared: pi@raspberrypi:~/corona-display $ sudo nano display_16x2.py pi@raspberrypi:~/corona-display $ python display_16x2.py File "display_16x2.py", line 28 lcd_string((cc)+ (" ") + (deaths_c)+(" Deaths"),LCD_LINE_1) ^ IndentationError: unindent does not match any outer indentation level

julianbruegger commented 4 years ago

Try again: sudo nano display_16x2.py

on line 16 lcd_string((cc), (deaths_c)+(" Deaths"),LCD_LINE_1) to lcd_string((cc)+(" ")+(deaths_c)+(" Deaths"),LCD_LINE_1)

And you ned to run with python3

wawawa15 commented 4 years ago

Still problem: pi@raspberrypi:~/corona-display $ sudo nano display_16x2.py pi@raspberrypi:~/corona-display $ python3 display_16x2.py File "display_16x2.py", line 28 lcd_string((cc)+(" ")+(deaths_c)+(" Deaths"),LCD_LINE_1) ^ IndentationError: unindent does not match any outer indentation level

julianbruegger commented 4 years ago

Thats wired, mabey try updating the files with sudo git pull in the /corona-display folder.