dhhagan / py-opc

Python wrapper for the Alphasense OPC-N2 built around py-spidev
MIT License
30 stars 26 forks source link

Replaced isinstance check for spidev with hasattr check for xfer transfer function. The change was made to enable 'virtual SPI terminal' which is a separate python interface to a component that provide virtual SPI terminal. The virtual SPI terminal component may be external and can be accessed via various communication protocols other than SPI. The virtual SPI terminal python interface must expose this 'xfer' function and other functions found in spidev, especially the SPI mode. #34

Closed DancingQuanta closed 8 years ago

DancingQuanta commented 8 years ago

Replacing isinstance check with hasattr check for virtual SPI terminal.

dhhagan commented 8 years ago

Thanks for this, @DancingQuanta . When you get it up and working, will you add a section to the documentation to describe how to use this library with alternative SPI hardware configurations? I will merge and test this now...it should be released with v0.2.0.

DancingQuanta commented 7 years ago

Are you happy with the change so far?

dhhagan commented 7 years ago

It seems to work just fine! I haven't tried through USB, so am relying on others input for that. I'll try to get to some more updates in the near future but am crunched for time right now with some other projects. Thanks for the changes though...that's what OSS is all about! On Sat, Sep 24, 2016 at 10:29 AM Andrew Tolmie notifications@github.com wrote:

Are you happy with the change so far?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249367552, or mute the thread https://github.com/notifications/unsubscribe-auth/AEKwSMKFRZpUCEvGPnwuPAjMfhPQchNxks5qtTO9gaJpZM4J1SLK .

Regards,

David H Hagan PhD Student | Atmospheric Chemistry & Physics Department of Civil & Environmental Engineering Massachusetts Institute of Technology Cambridge, MA 02139 707.227.6695 | dhagan@mit.edu | https://www.davidhagan.me

DancingQuanta commented 7 years ago

Did you get one of these USB adapters from alphasense? The thing is, the change is an example of duck typing, have you heard of that?

On 24 Sep 2016 18:30, "David H Hagan" notifications@github.com wrote:

It seems to work just fine! I haven't tried through USB, so am relying on others input for that. I'll try to get to some more updates in the near future but am crunched for time right now with some other projects. Thanks for the changes though...that's what OSS is all about! On Sat, Sep 24, 2016 at 10:29 AM Andrew Tolmie notifications@github.com wrote:

Are you happy with the change so far?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249367552, or mute the thread https://github.com/notifications/unsubscribe-auth/ AEKwSMKFRZpUCEvGPnwuPAjMfhPQchNxks5qtTO9gaJpZM4J1SLK .

Regards,

David H Hagan PhD Student | Atmospheric Chemistry & Physics Department of Civil & Environmental Engineering Massachusetts Institute of Technology Cambridge, MA 02139 707.227.6695 | dhagan@mit.edu | https://www.davidhagan.me

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249377032, or mute the thread https://github.com/notifications/unsubscribe-auth/AIB3VbVASiRhG6ljyKg3jVqCDchUNq0yks5qtV5QgaJpZM4J1SLK .

dhhagan commented 7 years ago

I do have a few of them, but they are close to $100 each these days and I have around 100 OPCs.. everything I've built is embedded and uses the other going pins on the Pi. I do have a breakout board for the pi to opc that is open sourced that I can post if people want to order and solder their own boards. On Sat, Sep 24, 2016 at 1:43 PM Andrew Tolmie notifications@github.com wrote:

Did you get one of these USB adapters from alphasense? The thing is, the change is an example of duck typing, have you heard of that?

On 24 Sep 2016 18:30, "David H Hagan" notifications@github.com wrote:

It seems to work just fine! I haven't tried through USB, so am relying on others input for that. I'll try to get to some more updates in the near future but am crunched for time right now with some other projects. Thanks for the changes though...that's what OSS is all about! On Sat, Sep 24, 2016 at 10:29 AM Andrew Tolmie notifications@github.com wrote:

Are you happy with the change so far?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249367552, or mute the thread https://github.com/notifications/unsubscribe-auth/ AEKwSMKFRZpUCEvGPnwuPAjMfhPQchNxks5qtTO9gaJpZM4J1SLK .

Regards,

David H Hagan PhD Student | Atmospheric Chemistry & Physics Department of Civil & Environmental Engineering Massachusetts Institute of Technology Cambridge, MA 02139 707.227.6695 | dhagan@mit.edu | https://www.davidhagan.me

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249377032, or mute the thread < https://github.com/notifications/unsubscribe-auth/AIB3VbVASiRhG6ljyKg3jVqCDchUNq0yks5qtV5QgaJpZM4J1SLK

.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249377693, or mute the thread https://github.com/notifications/unsubscribe-auth/AEKwSISbp4kEtktrAiHqdK1ZLs3lCIWKks5qtWFRgaJpZM4J1SLK .

Regards,

David H Hagan PhD Student | Atmospheric Chemistry & Physics Department of Civil & Environmental Engineering Massachusetts Institute of Technology Cambridge, MA 02139 707.227.6695 | dhagan@mit.edu | https://www.davidhagan.me

DancingQuanta commented 7 years ago

That so many OPCs! Sure direct SPI is great for your scale. Are you planning to send these out into the field? Or what are you doing with them?

On 24 Sep 2016 19:09, "David H Hagan" notifications@github.com wrote:

I do have a few of them, but they are close to $100 each these days and I have around 100 OPCs.. everything I've built is embedded and uses the other going pins on the Pi. I do have a breakout board for the pi to opc that is open sourced that I can post if people want to order and solder their own boards. On Sat, Sep 24, 2016 at 1:43 PM Andrew Tolmie notifications@github.com wrote:

Did you get one of these USB adapters from alphasense? The thing is, the change is an example of duck typing, have you heard of that?

On 24 Sep 2016 18:30, "David H Hagan" notifications@github.com wrote:

It seems to work just fine! I haven't tried through USB, so am relying on others input for that. I'll try to get to some more updates in the near future but am crunched for time right now with some other projects. Thanks for the changes though...that's what OSS is all about! On Sat, Sep 24, 2016 at 10:29 AM Andrew Tolmie <notifications@github.com

wrote:

Are you happy with the change so far?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249367552, or mute the thread https://github.com/notifications/unsubscribe-auth/ AEKwSMKFRZpUCEvGPnwuPAjMfhPQchNxks5qtTO9gaJpZM4J1SLK .

Regards,

David H Hagan PhD Student | Atmospheric Chemistry & Physics Department of Civil & Environmental Engineering Massachusetts Institute of Technology Cambridge, MA 02139 707.227.6695 | dhagan@mit.edu | https://www.davidhagan.me

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249377032, or mute the thread < https://github.com/notifications/unsubscribe-auth/ AIB3VbVASiRhG6ljyKg3jVqCDchUNq0yks5qtV5QgaJpZM4J1SLK

.

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249377693, or mute the thread https://github.com/notifications/unsubscribe-auth/ AEKwSISbp4kEtktrAiHqdK1ZLs3lCIWKks5qtWFRgaJpZM4J1SLK .

Regards,

David H Hagan PhD Student | Atmospheric Chemistry & Physics Department of Civil & Environmental Engineering Massachusetts Institute of Technology Cambridge, MA 02139 707.227.6695 | dhagan@mit.edu | https://www.davidhagan.me

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249379017, or mute the thread https://github.com/notifications/unsubscribe-auth/AIB3VdNMZNtsqeKrqZDdga9BSaQ6n0o2ks5qtWdNgaJpZM4J1SLK .

dhhagan commented 7 years ago

@DancingQuanta : Yes. They are all either in the field, or soon to be in the field.

DancingQuanta commented 7 years ago

And what about data collection? Do these sensors form a network?

On 24 Sep 2016 22:35, "David H Hagan" notifications@github.com wrote:

@DancingQuanta https://github.com/DancingQuanta : Yes. They are all either in the field, or soon to be in the field.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dhhagan/py-opc/pull/34#issuecomment-249388986, or mute the thread https://github.com/notifications/unsubscribe-auth/AIB3VX5hUZoJJEUmw95HVaqgs33DmAiwks5qtZexgaJpZM4J1SLK .

dhhagan commented 7 years ago

@DancingQuanta They do. If you'd like more info, send me an email at dhagan@mit.edu and I will get more in depth..