n3bojs4 / octoprint-LCD1602

15 stars 12 forks source link

Cannot load plugin after install #7

Closed effernity closed 5 years ago

effernity commented 5 years ago

Hello. Installed plugin on my Orange Pi lite, connected lcd, enabled i2c, tested screen, it's working, address correct - 0x27

On Octoprint start in logs:

2019-03-07 01:25:18,724 - octoprint.plugin.core - ERROR - There was an error loading plugin LCD1602
Traceback (most recent call last):
  File "/home/nmtui/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 980, in load_plugin
    plugin.load()
  File "/home/nmtui/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_LCD1602/__init__.py", line 164, in __plugin_load__
    __plugin_implementation__ = LCD1602Plugin()
  File "/home/nmtui/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_LCD1602/__init__.py", line 34, in __init__
    self.mylcd = CharLCD(i2c_expander='PCF8574', address=0x27, cols=16, rows=2, backlight_enabled=True, charmap='A00')
  File "/home/nmtui/OctoPrint/venv/local/lib/python2.7/site-packages/RPLCD/i2c.py", line 168, in __init__
    auto_linebreaks=auto_linebreaks)
  File "/home/nmtui/OctoPrint/venv/local/lib/python2.7/site-packages/RPLCD/lcd.py", line 99, in __init__
    self.command(0x03)
  File "/home/nmtui/OctoPrint/venv/local/lib/python2.7/site-packages/RPLCD/lcd.py", line 377, in command
    self._send_instruction(value)
  File "/home/nmtui/OctoPrint/venv/local/lib/python2.7/site-packages/RPLCD/i2c.py", line 241, in _send_instruction
    (value & 0xF0)) | self._backlight)
  File "/home/nmtui/OctoPrint/venv/local/lib/python2.7/site-packages/smbus2/smbus2.py", line 350, in write_byte
    ioctl(self.fd, I2C_SMBUS, msg)
IOError: [Errno 6] No such device or address
n3bojs4 commented 5 years ago

Hello, Have you enabled I2C correctly ? Take a look at chris video, he makes a tutorial for this plugin :)

effernity commented 5 years ago

Yep, enabled correctly, when i use this script (with corrected address) I can see test info on my screen

n3bojs4 commented 5 years ago

0x27 sounds like a regular address for this type of lcd. it looks like you are not running an octoprint regular installation, /home/nmtui is not the default octoprint user. Please give more info about :

launch i2cdetect -y 1 to show the i2c address list

effernity commented 5 years ago

It is standard octoprint install, just other username. Interesting enough, after connecting the screen to i2c1 instead of i2c0 everything works as intended.