Giter Club home page Giter Club logo

Comments (8)

rm-hull avatar rm-hull commented on June 3, 2024

That is the error I would expect smbus to throw because there is nothing at the 'remote' address (whatever the value in self._addr is). Are you suggesting that this should be wrapped/captured & rethrown in a luma.core.error instead?

from luma.core.

thijstriemstra avatar thijstriemstra commented on June 3, 2024

It's very similar to #5 (same code path) but a different error. I suggest we catch them and throw appropriate core.errors. This is what luma.core is for imo, make it easier.

from luma.core.

thijstriemstra avatar thijstriemstra commented on June 3, 2024

@rm-hull so this is basically (always) a DeviceAddressError?

from luma.core.

thijstriemstra avatar thijstriemstra commented on June 3, 2024

@kplindegaard any idea how we should treat this error?

from luma.core.

kplindegaard avatar kplindegaard commented on June 3, 2024

@thijstriemstra I haven't really put much emphasis on catching anything from ioctl and possible exceptions it may throw if it's unable to perform the prescribed action as you understand. But yeah, this is typically what you experience when there is no device present on that given i2c address. I mean, I have sent illegal buffers totally unrecognizable for the slave device, but that's a different story. Whereas this is "device not available on this address" type issue.

from luma.core.

thijstriemstra avatar thijstriemstra commented on June 3, 2024

Thanks for the feedback @kplindegaard!

from luma.core.

thijstriemstra avatar thijstriemstra commented on June 3, 2024

Added serial-error branch and output is now:

$ python examples/3d_box.py -i i2c --display sh1106
usage: 3d_box.py [-h] [--config CONFIG]
                 [--display {ssd1306,ssd1322,ssd1325,ssd1331,sh1106,pcd8544,st7735,max7219,neopixel}]
                 [--width WIDTH] [--height HEIGHT] [--rotate {0,1,2,3}]
                 [--interface {i2c,spi}] [--i2c-port I2C_PORT]
                 [--i2c-address I2C_ADDRESS] [--spi-port SPI_PORT]
                 [--spi-device SPI_DEVICE] [--spi-bus-speed SPI_BUS_SPEED]
                 [--bcm-data-command BCM_DATA_COMMAND] [--bcm-reset BCM_RESET]
                 [--bcm-backlight BCM_BACKLIGHT]
                 [--block-orientation {horizontal,vertical}]
                 [--mode {1,RGB,RGBA}]
                 [--framebuffer {diff_to_previous,full_frame}]
                 [--bgr {True,False}]
3d_box.py: error: I2C device not found on address: 60

from luma.core.

thijstriemstra avatar thijstriemstra commented on June 3, 2024

fixed since 0.5.2

from luma.core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.