View: 11654|Reply: 8

I2C drivers for OrangePi PC 2

[Copy link]

1

threads

5

posts

22

credits

Novice

Rank: 1

credits
22
Published in 2018-8-13 20:20:44 | Show all floors |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| Published in 2018-8-13 20:26:56 | Show all floors
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

18

posts

122

credits

Registered member

Rank: 2

credits
122
Published in 2018-8-13 21:02:40 | Show all floors
Hi,

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

9

threads

634

posts

4427

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
4427
Published in 2018-8-14 02:35:53 | Show all floors
... 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| Published in 2018-8-14 16:08:34 | Show all floors
Thank you for the Tip!
I will try it.

0

threads

18

posts

122

credits

Registered member

Rank: 2

credits
122
Published in 2018-8-14 16:47:51 | Show all floors
Mach das, schreib mal, ob du es hinbekommen hast. ;)

1

threads

5

posts

22

credits

Novice

Rank: 1

credits
22
 Author| Published in 2018-8-17 22:07:36 | Show all floors
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| Published in 2018-8-18 18:23:55 | Show all floors
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

18

posts

122

credits

Registered member

Rank: 2

credits
122
Published in 2018-8-19 03:45:14 | Show all floors
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 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 code
Ersetzen durch:
  1. int isH5(void)
  2. {
  3.      return 1;
  4. }
Copy code


und dann compilieren und installieren:
  1. cd WiringOP
  2. chmod +x ./build
  3. sudo ./build
Copy 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 need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list