dhhagan / py-opc

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

Allow choice of pyserial module alongside spidev #31

Closed DancingQuanta closed 8 years ago

DancingQuanta commented 8 years ago

In my current project I have a sensor connected to SPI to USB converter which I can query using pyserial module. I think the pyserial module must be added to this useful module and I could do a pull request but this involves large reorganisation of code and so I think we need to discuss this.

dhhagan commented 8 years ago

Hi @DancingQuanta : So if I understand correctly, you have successfully been able to use this library with pyserial and a usb-spi converter rather than GPIO? Have you tested it on anything other than an RPI? I have no problems adding it to the module, but would need to make sure it works on various architectures first. One of the perks of spidev is it works on non-RPi platforms. Feel free to fork it and send a PR though.

DancingQuanta commented 8 years ago

Hello @dhhagan I spoke too soon. I did not understand how my USB-SPI converter work and now discovered the converter is multi-purpose converter (I2C SPi OI, etc) which means that it requires setting up before tranmsitting any data to sensor and receiving from the sensor.

The converter is USB-ISS; from https://www.robot-electronics.co.uk/htm/usb_iss_tech.htm. To talk to the sensor, a byte sequence is sent to the converter where the first byte asks the converter to transmit the rest of the sequence to the sensor.

Now having understood my converter I figured it is much better to integrate this into spidev rather than the py-

Sorry about jumping the gun! Closing the issue