Issue #065 [Accepted/open] - Missing function on GPIOPort expander driver

Posted by max.benedetti74

What steps will reproduce the problem? 1.Can I have some code examples to use the DS2408 please ?

I've try with:

from webiopi.utils import * from webiopi.devices.onewire import * from webiopi.devices.digital import GPIOPort from webiopi.devices.digital import DS2408

Setup a DS2408 with 1-Wire slave auto-detect

sw0 = DS2408()

sw0.setFunction(0, GPIO.OUT) sw0.setFunction(1, GPIO.OUT) sw0.setFunction(2, GPIO.OUT) sw0.setFunction(3, GPIO.OUT) sw0.setFunction(4, GPIO.OUT) sw0.setFunction(7, GPIO.OUT)

sw0.digitalWrite(0, GPIO.HIGH) time.sleep(5) #wait 5 seconds sw0.digitalWrite(0, GPIO.LOW)

But not work is correct the code ?

WebIOPi version used? =>0.6.0

Python version used? =>Python 2.7.3

Distro used? (WebIOPi has only been tested on Raspbian Wheezy) =>Raspbian Wheezy

Raspberry Pi board revision? (1 or 2) =>

For Javascript side bugs, Browser? =>

Please provide any additional information below.


Comment 1

Posted by max.benedetti74

Now I try agan and working but I try to read all inputs with sw0.digitalReadAll() and give an error below.

Traceback (most recent call last): File "ds24.py", line 29, in sw0.digitalReadAll() AttributeError: DS2408 instance has no attribute 'digitalReadAll'


Comment 2

Posted by trouch

Function missing

you can use portRead instead


Comment 3

Posted by trouch


Comment 4

Posted by trouch


Comment 5

Posted by trouch


Comment 6

Posted by trouch

Delayed for major release


Comment 7

Posted by andreas.riegg

Maybe you can retry your code with the updated 2408 driver from issue 95. For correct operation, please look at the driver comments and the setting of the RSTZ pin as this influences correct working of output ports.

Andreas