Hello there,
First of all I wanted to share my gratitude for this wealth of knowledge and all the work that has gone into creating Mycodo. As a software engineer, I certainly know and appreciate the energy it takes to get something like this productized and available to the community and wanted to say amazing job Kyle and all contributors
Total newbie to the cultivation world and just finished setting up an incubator and a fruiting environment controlled by Mycodo and for the most part it has been a super easy task with all the work being done by the software. I am having a problem I haven’t been able to get around yet relating to LCD. I have a SSD1306 LCD display that is recognized by the i2c scanner and is at the right address. But when I add it to Mycodo I get python errors complaining a method not found. Now the strange thing is that the LCD is configured as I2C but the error comes in from spi_device.py not i2c_device.py. This by itself seems strange (but I have to say I haven’t put any effort into understanding the architecture of the system top to bottom so that may totally be fine, just seems strange). Any suggestions on where to look/poke trying to figure this out:
2024-04-11 22:58:53,466 - ERROR - mycodo.function.display_ssd1306_oled_128x32_i2c_837fd6c9 - Error initializing, trying again in 5 seconds: name ‘DigitalInOut’ is not defined
Traceback (most recent call last):
File “/var/mycodo-root/mycodo/abstract_base_controller.py”, line 57, in try_initialize
self.initialize()
File “/home/morteza/Mycodo/mycodo/functions/display_ssd1306_oled_128x32_i2c.py”, line 378, in initialize
from mycodo.devices.lcd_pioled_circuitpython import PiOLEDCircuitpython
File “/var/mycodo-root/mycodo/devices/lcd_pioled_circuitpython.py”, line 5, in
import adafruit_ssd1306
File “/var/mycodo-root/env/lib/python3.11/site-packages/adafruit_ssd1306.py”, line 17, in
from adafruit_bus_device import i2c_device, spi_device
File “/var/mycodo-root/env/lib/python3.11/site-packages/adafruit_bus_device/spi_device.py”, line 29, in
class SPIDevice:
File “/var/mycodo-root/env/lib/python3.11/site-packages/adafruit_bus_device/spi_device.py”, line 76, in SPIDevice
chip_select: Optional[DigitalInOut] = None,
^^^^^^^^^^^^
NameError: name ‘DigitalInOut’ is not defined
2024-04-11 22:58:58,477 - ERROR - mycodo.function.display_ssd1306_oled_128x32_i2c_837fd6c9 - Error initializing, trying again in 5 seconds: name ‘DigitalInOut’ is not defined
Traceback (most recent call last):
File “/var/mycodo-root/mycodo/abstract_base_controller.py”, line 57, in try_initialize
self.initialize()
File “/home/morteza/Mycodo/mycodo/functions/display_ssd1306_oled_128x32_i2c.py”, line 378, in initialize
from mycodo.devices.lcd_pioled_circuitpython import PiOLEDCircuitpython
File “/var/mycodo-root/mycodo/devices/lcd_pioled_circuitpython.py”, line 5, in
import adafruit_ssd1306
File “/var/mycodo-root/env/lib/python3.11/site-packages/adafruit_ssd1306.py”, line 17, in
from adafruit_bus_device import i2c_device, spi_device
File “/var/mycodo-root/env/lib/python3.11/site-packages/adafruit_bus_device/spi_device.py”, line 29, in
class SPIDevice:
File “/var/mycodo-root/env/lib/python3.11/site-packages/adafruit_bus_device/spi_device.py”, line 76, in SPIDevice
chip_select: Optional[DigitalInOut] = None,
^^^^^^^^^^^^
NameError: name ‘DigitalInOut’ is not defined
2024-04-11 22:59:03,479 - ERROR - mycodo.function.display_ssd1306_oled_128x32_i2c_837fd6c9 - Initialization errored 3 times; giving up. Maybe the following traceback can help diagnose the issue.
Traceback (most recent call last):
File “/var/mycodo-root/mycodo/abstract_base_controller.py”, line 57, in try_initialize
self.initialize()
File “/home/morteza/Mycodo/mycodo/functions/display_ssd1306_oled_128x32_i2c.py”, line 378, in initialize
from mycodo.devices.lcd_pioled_circuitpython import PiOLEDCircuitpython
File “/var/mycodo-root/mycodo/devices/lcd_pioled_circuitpython.py”, line 5, in
import adafruit_ssd1306
File “/var/mycodo-root/env/lib/python3.11/site-packages/adafruit_ssd1306.py”, line 17, in
from adafruit_bus_device import i2c_device, spi_device
File “/var/mycodo-root/env/lib/python3.11/site-packages/adafruit_bus_device/spi_device.py”, line 29, in
class SPIDevice:
File “/var/mycodo-root/env/lib/python3.11/site-packages/adafruit_bus_device/spi_device.py”, line 76, in SPIDevice
chip_select: Optional[DigitalInOut] = None,
^^^^^^^^^^^^
NameError: name ‘DigitalInOut’ is not defined
2024-04-11 22:59:03,480 - DEBUG - mycodo.controllers.controller_function_837fd6c9 - loop() found
2024-04-11 22:59:03,480 - DEBUG - mycodo.controllers.controller_function_837fd6c9 - listener() not found
2024-04-11 22:59:03,480 - INFO - mycodo.controllers.controller_function_837fd6c9 - Activated in 10061.5 ms
2024-04-11 22:59:03,480 - ERROR - mycodo.function.display_ssd1306_oled_128x32_i2c_837fd6c9 - LCD not set up
2024-04-11 22:59:13,483 - ERROR - mycodo.function.display_ssd1306_oled_128x32_i2c_837fd6c9 - LCD not set up
2024-04-11 22:59:15,984 - INFO - mycodo.controllers.controller_function_837fd6c9 - Deactivated in 110.2 ms