0

unknown Platform with adafruit_python_dht
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

unknown Platform with adafruit_python_dht

by aemm2019 on Sat Jun 01, 2019 1:17 pm

Hello,

on my manjaro raspi3 b+ (Linux-5.1.5-1-MANJARO-ARM-aarch64-with-arch) after installation I always get

[..]Adafruit_DHT/common.py", line 63, in get_platform
raise RuntimeError('Unknown platform.')

is adafruit not made for manjaro ARM ?

If so .. Why ?

BR,
A.Emm

aemm2019
 
Posts: 2
Joined: Sat Jun 01, 2019 1:12 pm

Re: unknown Platform with adafruit_python_dht

by aemm2019 on Sat Jun 01, 2019 1:34 pm

in platform_detect.py I can see the following lines:

Code: Select all | TOGGLE FULL SIZE
with open('/proc/cpuinfo', 'r') as infile:
        cpuinfo = infile.read()
    # Match a line like 'Hardware   : BCM2709'
    match = re.search('^Hardware\s+:\s+(\w+)$', cpuinfo,
                      flags=re.MULTILINE | re.IGNORECASE)
    if not match:
        # Couldn't find the hardware, assume it isn't a pi.
        return None
    if match.group(1) == 'BCM2708':
        # Pi 1
        return 1
    elif match.group(1) == 'BCM2709':
        # Pi 2
        return 2
    elif match.group(1) == 'BCM2835':
        # Pi 3
        return 3
    elif match.group(1) == 'BCM2837':
        # Pi 3b+
        return 3


in my case cpuinfo is expected to contain a line with "BCM2837".. on my manjaro arm cpuinfo looks like that:

Code: Select all | TOGGLE FULL SIZE
[root@rasp3 examples]# cat /proc/cpuinfo
processor   : 0
BogoMIPS   : 38.40
Features   : fp asimd evtstrm crc32 cpuid
CPU implementer   : 0x41
CPU architecture: 8
CPU variant   : 0x0
CPU part   : 0xd03
CPU revision   : 4


this is strange. and I mean the detection mechanism. It works only on special distributions ?

aemm2019
 
Posts: 2
Joined: Sat Jun 01, 2019 1:12 pm

Re: unknown Platform with adafruit_python_dht

by franklin97355 on Sat Jun 01, 2019 5:01 pm

Try downloading Raspbian from the Pi foundation site and see if that works. Our code works with Raspbian, other distro may be reporting differently and you may need to modify the code to accommodate that.

franklin97355
 
Posts: 20636
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Please be positive and constructive with your questions and comments.