JeremyLaurenson / octoprint-emc2101

9 stars 2 forks source link

No Hardware I2C on (scl,sda)=(3, 2) #5

Closed lost-carrier closed 2 years ago

lost-carrier commented 2 years ago

I have...

2022-09-15 22:43:25,878 - octoprint.startup - INFO - Starting OctoPrint 1.8.2
[...]
2022-09-15 22:55:58,939 - octoprint.environment - INFO - Detected environment is Python 3.7.3 under Linux (linux). Details:
|  hardware:
|    cores: 4
|    freq: 1200.0
|    ram: 914006016
|  os:
|    bits: 32
|    id: linux
|    platform: linux
|  plugins:
|    pi_support:
|      model: Raspberry Pi 3 Model B Rev 1.2
|      octopi_version: 0.18.0
|      octopiuptodate_build: 0.18.0-1.8.2-20220816135025
|      throttle_check_enabled: true
|      throttle_check_functional: true
|      throttle_state: '0x0'
|  python:
|    pip: 20.3.3
|    version: 3.7.3
|    virtualenv: /home/pi/oprint

The EMC2101 is connected via a Qwiic cable from to pHAT. There is also a MCP9808 daisy-chained.

When I boot OctoPi, I get the following...

2022-09-15 22:55:58,613 - octoprint.plugins.softwareupdate - INFO - Loaded version cache from disk
2022-09-15 22:55:58,690 - octoprint.plugin.core - INFO - Initialized 19 plugin implementation(s)
2022-09-15 22:55:58,737 - octoprint.plugins.emc2101 - WARNING - ######### current settings version None target settings version 3 #########

Not sure if that's relevant. V 0.0.8 is installed. I'm more worried about this:

2022-09-15 22:56:05,325 - octoprint.plugins.emc2101 - INFO - EMC2101 plugin is alive!
2022-09-15 22:56:05,741 - octoprint.plugins.emc2101 - INFO - EMC2101 error: Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_emc2101/EMCSCAN.py", line 8, in <module>
    i2c = board.I2C()  # uses board.SCL and board.SDA
  File "/home/pi/oprint/lib/python3.7/site-packages/board.py", line 305, in I2C
    return busio.I2C(SCL, SDA)
  File "/home/pi/oprint/lib/python3.7/site-packages/busio.py", line 35, in __init__
    self.init(scl, sda, frequency)
  File "/home/pi/oprint/lib/python3.7/site-packages/busio.py", line 125, in init
    (scl, sda), i2cPorts
ValueError: No Hardware I2C on (scl,sda)=(3, 2)
Valid I2C ports: ((1, 3, 2), (0, 1, 0))
[...]
2022-09-15 22:56:09,716 - octoprint.util.comm - ERROR - Error while processing temperatures in emc2101, skipping
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/comm.py", line 2121, in _processTemperatures
    parsedTemps = hook(self, parsedTemps)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/__init__.py", line 1688, in wrapper
    return f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_emc2101/__init__.py", line 544, in get_graph_data
    temps = self.temperatures[sensorNum]
IndexError: list index out of range
2022-09-15 22:56:11,752 - octoprint.util.comm - ERROR - Error while processing temperatures in emc2101, skipping
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/comm.py", line 2121, in _processTemperatures
    parsedTemps = hook(self, parsedTemps)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/__init__.py", line 1688, in wrapper
    return f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_emc2101/__init__.py", line 544, in get_graph_data
    temps = self.temperatures[sensorNum]
IndexError: list index out of range
2022-09-15 22:56:13,747 - octoprint.util.comm - ERROR - Error while processing temperatures in emc2101, skipping
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/comm.py", line 2121, in _processTemperatures
    parsedTemps = hook(self, parsedTemps)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/__init__.py", line 1688, in wrapper
    return f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_emc2101/__init__.py", line 544, in get_graph_data
    temps = self.temperatures[sensorNum]
IndexError: list index out of range
...etc...

...which leads to a UI like... Bildschirmfoto 2022-09-16 um 00 06 40

...I also tried with Qwiic Shim, but same result.

JeremyLaurenson commented 2 years ago

It looks like its not detecting an ic2 bus. Is it enabled on your Raspberry PI?

lost-carrier commented 2 years ago

Erm... eh... shame on me... yes, that was in-deed the issue...

Sry... worked a lot with I2C on Arduino, but was completely not aware one need first to active this on a RasPi...

Thanks a lot - now it works!