Sol icon indicating copy to clipboard operation
Sol copied to clipboard

Non-functional after upgrading to CircuitPython 7.30

Open shakfu opened this issue 2 years ago • 1 comments

I recently updated Sol to CircuitPython 7.30 and after doing so, the module stopped working (blinking green light) and after installing Mu, and opening a serial console, importing code.py, it turned out that the .mpy format changed from CircuitPython versions 6 to 7

I used the circup python module to check which ones needed to be updated and two modules: adafruit_bus_device and neopixel needed to be updated, and I went ahead.

After restarting, there were still green flashing lights and I opened code.py on Mu and tried to run it and it gave the following error:

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 84, in <module>
  File "/lib/winterbloom_sol/__init__.py", line 40, in run
  File "/lib/winterbloom_sol/sol.py", line 292, in __init__
  File "/lib/winterbloom_sol/sol.py", line 187, in __init__
  File "/lib/winterbloom_ad_dacs/_common.py", line 126, in soft_reset
  File "/lib/winterbloom_ad_dacs/_common.py", line 122, in send_command
AttributeError: 'SPIDevice' object has no attribute 'spi'

I checked the call in _common.py line 115:

spi_device = SPIDevice(spi, cs_io, polarity=0, phase=1, baudrate=5000000)

There doesn't seem to be a problem as the interface hasn't changed much:


# new version of spi_device.py
# https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/blob/main/adafruit_bus_device/spi_device.py
def __init__(self, spi: SPI, chip_select: Optional[DigitalInOut] = None, *,
        cs_active_value: bool = False,
        baudrate: int = 100000,
        polarity: int = 0,
        phase: int = 0,
        extra_clocks: int = 0
    ) -> None:
        self.spi = spi
        self.baudrate = baudrate
        self.polarity = polarity
        self.phase = phase
        self.extra_clocks = extra_clocks
        self.chip_select = chip_select
        self.cs_active_value = cs_active_value
        if self.chip_select:
            self.chip_select.switch_to_output(value=True)

# old version used spi_device.py
# https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/blob/cf7eabc4fa079a1443f548aed8ee2966af9b5fc1/adafruit_bus_device/spi_device.py
def __init__(self, spi, chip_select=None, *,
                 baudrate=100000, polarity=0, phase=0, extra_clocks=0):
        self.spi = spi
        self.baudrate = baudrate
        self.polarity = polarity
        self.phase = phase
        self.extra_clocks = extra_clocks
        self.chip_select = chip_select
        if self.chip_select:
            self.chip_select.switch_to_output(value=True)

I'm a bit stuck how to proceed. Can you please advice on what could be the fix, or if it's too much of pain (considering this module is discontinued) can you let me know how to downgrade to make it work again.

Thanks!

shakfu avatar Jun 10 '22 00:06 shakfu

I downgraded to circuit python 6.3 (adafruit-circuitpython-winterbloom_sol-en_US-6.3.0.uf2) and it worked with the last (April 30th 2021 Release). It's working fine again.

shakfu avatar Jun 10 '22 14:06 shakfu

I downgraded to circuit python 6.3 (adafruit-circuitpython-winterbloom_sol-en_US-6.3.0.uf2) and it worked with the last (April 30th 2021 Release). It's working fine again.

Do you remember where you found this uf2 file?

mclainv avatar Oct 16 '22 06:10 mclainv

@mclainv wrote:

Do you remember where you found this uf2 file?

Yes, you can get all things related to circuit python and winterbloom sol from the CircuitPython page for winterbloom sol.

More specifically, the file can be downloaded from the Amazon S3 archive linked to on that page.

shakfu avatar Oct 16 '22 06:10 shakfu

Oh gosh y'all I'm sorry that I've just now seen this issue. I'll take some time this week to make sure that Sol works with the latest CircuitPython.

theacodes avatar Oct 17 '22 01:10 theacodes

Hey folks, I've published a new release of Sol's firmware and libraries that fixes this. Please update your libraries and let me know if you run into any other issues.

https://github.com/wntrblm/Sol/releases/tag/2022.10.17

theacodes avatar Oct 17 '22 22:10 theacodes

@theacodes Just tested the fix and it works great. Thanks very much :smile:

shakfu avatar Oct 19 '22 14:10 shakfu

Wonderful to hear!

On Wed, Oct 19, 2022, 10:12 AM Shakeeb Alireza @.***> wrote:

@theacodes https://github.com/theacodes Just tested the fix and it works great. Thanks very much 😄

— Reply to this email directly, view it on GitHub https://github.com/wntrblm/Sol/issues/9#issuecomment-1284085560, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5I4443APXSAESCYCYVTTWD76WTANCNFSM5YL2WVHA . You are receiving this because you were mentioned.Message ID: @.***>

theacodes avatar Oct 19 '22 14:10 theacodes