sunfounder / Sunfounder_Smart_Video_Car_Kit_for_RaspberryPi

Sunfounder Smart Video Car Kit for Raspberry Pi
http://www.sunfounder.com
137 stars 117 forks source link

PCA9685.py -- raise ValueError('Reading Pi type error, Your Pi "{0}"" is not in the list #21

Open vshomepi opened 7 years ago

vshomepi commented 7 years ago

This is occurring on a Raspberry PI ZERO. Other versions I've used 2 and 3 are working fine.

UPDATE: The library does work by defaulting the bus to 1. NOT recommended... It does get me by for now.

def _get_bus_number(self):
    pi_type = GPIO.RPI_INFO['TYPE']
    print ('----------pi_type----------')
    print (pi_type)
    print ('---------------------------')
    if pi_type in self._BUS_0_TYPES:
        bus_number = 0
    elif pi_type in self._BUS_1_TYPES:
        bus_number = 1
    else:
        bus_number = 1
        #raise ValueError('Reading Pi type error, Your Pi "{0}"" is not in the list.\n  Please post an Issus at our Github Page or contract us\n    Github page: https://github.com/sunfounder/Sunfounder_Smart_Video_Car_Kit_for_RaspberryPi/issues\n    Email: support@sunfounder.com\n    SunFounder'.format(pi_type))
sunfounder commented 7 years ago

Can you post out your error information for us, sothat we could solve this problem for the others, thank you.

vshomepi commented 7 years ago

Please note the else statement and the commented out line. This is the error I see. Now see the print statements. The "pi_type" variable displays "unknown", this was causing the raise statement to execute. Hope this helps...