没有找到RPi.GPIO和WiringPi.(I can't find RPi.GPIO and WiringPi)

固件版本是EMMC:VIM3_Ubuntu-server-focal_Linux-4.9_arm64_EMMC_V0.9-20200530,文档中GPIO访问方法、WiringPi和RPi.GPIO均无法找到。论坛中帖子给出的访问方法可以实现对37口的读写,相关配置的读取和帖子中的也是一样的,但是编程不方便,固件已经刷过几次了,均找不到,请问是没有集成进去还是需要另行安装?

The firmware I use is EMMC: VIM3_Ubuntu-server-focal_Linux-4.9_arm64_EMMC_V0.9-20200530. It is said WiringPi and RPi.GPIO has been moved to VIM3, but I cannot find them. I have seen the topic and achieved reading and writing on pin 37. But it is not convenient to program with python or C++. The file I cat is the same as the topic. I have reboot more than one time. There is someone who can help me?

@gpxin 20.04 没有集成进固件里,你需要去我们的github自己clone到板子上.按照readme运行.
或者升级到最新的版本,最新的ota版本的固件已经将wiringpi添加进去了

1 Like
root@Khadas:~# cd /tmp
root@Khadas:/tmp# git clone https://github.com/khadas/WiringPi.git
Cloning into 'WiringPi'...
remote: Enumerating objects: 1765, done.
remote: Counting objects: 100% (1765/1765), done.
remote: Compressing objects: 100% (630/630), done.
remote: Total 1765 (delta 1129), reused 1678 (delta 1056), pack-reused 0
Receiving objects: 100% (1765/1765), 5.09 MiB | 2.40 MiB/s, done.
Resolving deltas: 100% (1129/1129), done.
root@Khadas:/tmp# cd WiringPi/
root@Khadas:/tmp/WiringPi# ./build

root@Khadas:/tmp/WiringPi# cd gpio/
root@Khadas:/tmp/WiringPi/gpio# ./gpio

root@CBMicroV2:/tmp/WiringPi/gpio# ./gpio readall
 +------+-----+----------+------+---+----+---- Model  Khadas VIM3 --+----+---+------+----------+-----+------+
 | GPIO | wPi |   Name   | Mode | V | DS | PU/PD | Physical | PU/PD | DS | V | Mode |   Name   | wPi | GPIO |
 +------+-----+----------+------+---+----+-------+----++----+-------+----+---+------+----------+-----+------+
 |      |     |       5V |      |   |    |       |  1 || 21 |       |    |   |      | GND      |     |      |
 |      |     |       5V |      |   |    |       |  2 || 22 | P/U   |    | 1 | ALT1 | PIN.A15  | 6   |  475 |
 |      |     |   USB_DM |      |   |    |       |  3 || 23 | P/U   |    | 1 | ALT1 | PIN.A14  | 7   |  474 |
 |      |     |   USB_DP |      |   |    |       |  4 || 24 |       |    |   |      | GND      |     |      |
 |      |     |      GND |      |   |    |       |  5 || 25 | P/U   |    | 1 | ALT0 | PIN.AO2  | 8   |  498 |
 |      |     |   MCU3V3 |      |   |    |       |  6 || 26 | P/U   |    | 1 | ALT0 | PIN.AO3  | 9   |  499 |
 |      |     |  MCUNRST |      |   |    |       |  7 || 27 |       |    |   |      | 3V3      |     |      |
 |      |     |  MCUSWIM |      |   |    |       |  8 || 28 |       |    |   |      | GND      |     |      |
 |      |     |      GND |      |   |    |       |  9 || 29 | P/D   |    | 0 | ALT0 | PIN.A1   | 10  |  461 |
 |      |  18 |     ADC0 |      |   |    |       | 10 || 30 | P/D   |    | 1 | ALT0 | PIN.A0   | 11  |  460 |
 |      |     |      1V8 |      |   |    |       | 11 || 31 | P/D   |    | 0 | ALT0 | PIN.A3   | 12  |  463 |
 |      |  19 |     ADC1 |      |   |    |       | 12 || 32 | P/D   |    | 0 | ALT0 | PIN.A2   | 13  |  462 |
 |  506 |   1 | PIN.AO10 | ALT3 | 0 |    |   P/U | 13 || 33 | P/D   |    | 0 | ALT1 | PIN.A4   | 14  |  464 |
 |      |     |     GND3 |      |   |    |       | 14 || 34 |       |    |   |      | GND      |     |      |
 |  433 |   2 |   PIN.H6 |  OUT | 0 |    |   P/D | 15 || 35 | P/D   |    | 0 | OUT  | PWM-F    | 15  |  432 |
 |  434 |   3 |   PIN.H7 |  OUT | 0 |    |   P/D | 16 || 36 |       |    |   |      | RTC      |     |      |
 |      |     |      GND |      |   |    |       | 17 || 37 | P/D   |    | 0 | IN   | PIN.H4   | 16  |  431 |
 |  497 |   4 |  PIN.AO1 | ALT0 | 1 |    |   P/U | 18 || 38 |       |    |   |      | MCU-FA1  |     |      |
 |  496 |   5 |  PIN.AO0 | ALT0 | 1 |    |   P/U | 19 || 39 | P/D   |    | 0 | IN   | PIN.Z15  | 17  |  426 |
 |      |     |      3V3 |      |   |    |       | 20 || 40 |       |    |   |      | GND      |     |      |
 +------+-----+----------+------+---+----+-------+----++----+-------+----+---+------+----------+-----+------+
2 Likes

thanks! It works, you are so kind. I don’t find the git repository before and decide to find it next weekeend, and I have finished it today :slight_smile:

好的,我已经解决这个问题了 ,python下可以使用wiringpi了 :wink: