Skip to content

base example gives error #3

@koaning

Description

@koaning

right after a clean install on rpi3

(env) pi@raspberrypi:~/AIY-projects-python/enviroplus-python/examples $ python compensated-temperature.py 
compensated-temperature.py - Use the CPU temperature
to compensate temperature readings from the BME280 sensor.
Method adapted from Initial State's Enviro pHAT review:
https://medium.com/@InitialState/tutorial-review-enviro-phat-for-raspberry-pi-4cd6d8c63441

Press Ctrl+C to exit!


Traceback (most recent call last):
  File "compensated-temperature.py", line 39, in <module>
    cpu_temp = get_cpu_temperature()
  File "compensated-temperature.py", line 29, in get_cpu_temperature
    return float(output[output.index('=') + 1:output.rindex("'")])
TypeError: a bytes-like object is required, not 'str

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions