Menu

#186 Unable to import module, update cpuinfo?

Done
None
Critical
Patch
2020-07-30
2020-07-30
Joe Ho
No

Hi Ben,

I have scripts to import RPI.GPIO module, it used to work fine, then all of sudden it stopped working.

It has the This module can only be run on a Raspberry Pi! error. I look at the code, it seems the cpuinfo has been updated/chagned. Here is my cpuinfo. BCM2711???????

processor : 0
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 1
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 2
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 3
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

Hardware : BCM2711
Revision : c03111
Serial : 1000000091c50795
Model : Raspberry Pi 4 Model B Rev 1.1

Discussion

  • Ben Croston

    Ben Croston - 2020-07-30

    What version of RPi.GPIO are you using?

     
  • Joe Ho

    Joe Ho - 2020-07-30

    0.7.0

    / # pip show rpi.gpio
    Name: RPi.GPIO
    Version: 0.7.0
    Summary: A module to control Raspberry Pi GPIO channels
    Home-page: http://sourceforge.net/projects/raspberry-gpio-python/
    Author: Ben Croston
    Author-email: ben@croston.org
    License: MIT
    Location: /usr/local/lib/python3.7/site-packages
    Requires:
    Required-by:

    i did some googling, CPU always been BCM2711, but they didn't update cpuinfo until recently.

     
    • Ben Croston

      Ben Croston - 2020-07-30

      What do you get when you:
      $ cat /proc/device-tree/system/linux,revision

       
    • Ben Croston

      Ben Croston - 2020-07-30

      Also:
      $ hexdump /proc/device-tree/system/linux,revision

       
  • Ben Croston

    Ben Croston - 2020-07-30

    Which distro are you using? Is it 64 bit?

     
  • Joe Ho

    Joe Ho - 2020-07-30

    Sorry, I re-read the code, it seems like it's failing at:

    if ((fp = fopen("/proc/device-tree/system/linux,revision", "r"))) {
    uint32_t n;
    if (fread(&n, sizeof(n), 1, fp) != 1) {
    fclose(fp);
    return -1;
    }
    sprintf(revision, "%x", ntohl(n));
    found = 1;
    }

    I am using this inside a docker, /proc/device-tree/ is empty, symlink to sys/firmware is empty.

    I wil try map it to see if it works. It used to work fine, not sure what has changed.

    Thanks,
    Joe

     
  • Joe Ho

    Joe Ho - 2020-07-30

    Hosts = Raspbian buster
    Docker = alpine

     
  • Joe Ho

    Joe Ho - 2020-07-30

    putting the container in privileged mode fixes the issue. Not a clean fix, but will do for now. I will close the ticket. Thx.

     
  • Joe Ho

    Joe Ho - 2020-07-30

    I can't close the ticket, only you can lol.

     
  • Ben Croston

    Ben Croston - 2020-07-30
    • status: New --> Done
    • assigned_to: Ben Croston
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.