Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 1877|Reply: 8

I2C drivers for OrangePi PC 2

[Copy link]

1

Threads

5

Posts

22

Credits

Novice

Rank: 1

Credits
22
Post time 2018-8-13 20:20:44 | Show all posts |Read mode
Hello,

i want to use the I2C interface on the H5 board PC 2.
But i have to find out that the I2C drivers are not part of the image.
So this cannot be used and I2C is dead.

Where i can i get the missing drivers for your kernel 3.10.65 ?

I already tried to install the original kernel 3.16.0-4-arm64 of the Jessie-Distribution, but it does not boot.

1

Threads

5

Posts

22

Credits

Novice

Rank: 1

Credits
22
 Author| Post time 2018-8-13 20:26:56 | Show all posts
I am using Debian Desktop (updated:2017-05-12).

I tried today Raspbian Desktop (updated:2018-02-07), but it has the same kernel with the same missing drivers.

0

Threads

19

Posts

122

Credits

Registered member

Rank: 2

Credits
122
Post time 2018-8-13 21:02:40 | Show all posts
Hi,

try Armbian Linux. Best supported OS for Orange Pi:
https://www.armbian.com/orange-pi-pc2/

8

Threads

616

Posts

4128

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
4128
Post time 2018-8-14 02:35:53 | Show all posts
... and here is how you manipulate hardware features, enable I2C, SPI, W1, ... https://docs.armbian.com/User-Guide_Armbian-Config/

1

Threads

5

Posts

22

Credits

Novice

Rank: 1

Credits
22
 Author| Post time 2018-8-14 16:08:34 | Show all posts
Thank you for the Tip!
I will try it.

0

Threads

19

Posts

122

Credits

Registered member

Rank: 2

Credits
122
Post time 2018-8-14 16:47:51 | Show all posts
Mach das, schreib mal, ob du es hinbekommen hast. ;)

1

Threads

5

Posts

22

Credits

Novice

Rank: 1

Credits
22
 Author| Post time 2018-8-17 22:07:36 | Show all posts
Edited by apfel at 2018-8-17 22:11
svensly replied at 2018-8-13 21:02
Hi,

try Armbian Linux. Best supported OS for Orange Pi:

Yes - this is really a great step to a working Debian Distribution.

It seems everything is working like a charm:
  • Info output at booting
  • Easy configuration and upgrade with armbian-config
  • Different screen resolutions including Full HD
  • I2C Hardware support
  • etc.

This should be the standard for the OrangePi downloads ...

1

Threads

5

Posts

22

Credits

Novice

Rank: 1

Credits
22
 Author| Post time 2018-8-18 18:23:55 | Show all posts
Edited by apfel at 2018-8-18 20:04
svensly replied at 2018-8-14 16:47
Mach das, schreib mal, ob du es hinbekommen hast. ;)

Nachdem man eine Reihe von Paketen wie X-Server, XFCE und nodm nachinstalliert hat, startet dann auch eine Oberfläche - wenn man eine haben möchte.

Was noch nicht läuft ist WiringPi.
https://forum.armbian.com/topic/ ... -cpu-orangepi-pc-2/

root@orangepipc2:~# gpio readall
piBoardRev: Unable to determine board revision from /proc/cpuinfo
-> No "Hardware" line
->  You may want to check:
->  http://www.orangepi.org/

0

Threads

19

Posts

122

Credits

Registered member

Rank: 2

Credits
122
Post time 2018-8-19 03:45:14 | Show all posts
apfel replied at 2018-8-18 18:23
Nachdem man eine Reihe von Paketen wie X-Server, XFCE und nodm nachinstalliert hat, startet dann au ...

Hi,

das Problem ist bekannt.
Dafür ist eine kleine Modifikation nötig der WiringPi.c
Lad dir Wirinpi runter:

  1. git clone https://github.com/tumugin/WiringOP.git -b h5
Copy the Code

dann musst du in den Ordner "WiringPi", die Datei WiringPi.c editieren. (sudo nano /WiringOP/wiringPi/wiringPi.c)
Finde die Funktion int isH5(void);
  1. int isH5(void)
  2. {
  3.   FILE *cpuFd ;
  4.   char line [120] ;
  5.   char *d;
  6.         if ((cpuFd = fopen ("/proc/cpuinfo", "r")) == NULL)
  7.                 piBoardRevOops ("Unable to open /proc/cpuinfo") ;
  8.           while (fgets (line, 120, cpuFd) != NULL)
  9.                 {
  10.                         if (strncmp (line, "Hardware", 8) == 0)
  11.                         break ;
  12.                 }
  13.                
  14.         fclose (cpuFd) ;
  15.         if (strncmp (line, "Hardware", 8) != 0)
  16.                 piBoardRevOops ("No \"Hardware\" line") ;
  17.        
  18.   for (d = &line [strlen (line) - 1] ; (*d == '\n') || (*d == '\r') ; --d)
  19.     *d = 0 ;
  20.   if (wiringPiDebug)
  21.     printf ("piboardRev: Hardware string: %s\n", line) ;
  22.        
  23.         if (strstr(line,"sun50i") != NULL)                        //guenter von sun7i auf sun8i
  24.         {
  25.                 if (wiringPiDebug)
  26.                 printf ("Hardware:%s\n",line) ;
  27.                 return 1 ;
  28.         }
  29.         else
  30.         {
  31.                 if (wiringPiDebug)
  32.                 printf ("Hardware:%s\n",line) ;
  33.                 return 0 ;
  34. }
Copy the Code
Ersetzen durch:
  1. int isH5(void)
  2. {
  3.      return 1;
  4. }
Copy the Code


und dann compilieren und installieren:
  1. cd WiringOP
  2. chmod +x ./build
  3. sudo ./build
Copy the Code

Das Problem ist es wird keine Hardwarezeile ausgegeben. Deshalb funktioniert WiringPi so nicht. Da wir aber wissen, dass es ein H5 Prozessor ist, können wir die abfrage direkt als "wahr" deklarieren.
Hab es unterwegs gemacht. Hoffe es klappt auch. ;)

LG
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-10-15 04:48 GMT+8 , Processed in 0.034947 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list