apfel post at 2018-8-13 20:20:44

I2C drivers for OrangePi PC 2

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.

apfel post at 2018-8-13 20:26:56

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. :(

svensly post at 2018-8-13 21:02:40

Hi,

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

igorpec post at 2018-8-14 02:35:53

... and here is how you manipulate hardware features, enable I2C, SPI, W1, ... https://docs.armbian.com/User-Guide_Armbian-Config/

apfel post at 2018-8-14 16:08:34

Thank you for the Tip!
I will try it.

svensly post at 2018-8-14 16:47:51

Mach das, schreib mal, ob du es hinbekommen hast. ;)

apfel post at 2018-8-17 22:07:36

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 ...

apfel post at 2018-8-18 18:23:55

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/7980-wiringpi-cant-work-for-h5-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/

svensly post at 2018-8-19 03:45:14

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:

git clone https://github.com/tumugin/WiringOP.git -b h5
dann musst du in den Ordner "WiringPi", die Datei WiringPi.c editieren. (sudo nano /WiringOP/wiringPi/wiringPi.c)
Finde die Funktion int isH5(void);
int isH5(void)
{
FILE *cpuFd ;
char line ;
char *d;
        if ((cpuFd = fopen ("/proc/cpuinfo", "r")) == NULL)
                piBoardRevOops ("Unable to open /proc/cpuinfo") ;
          while (fgets (line, 120, cpuFd) != NULL)
                {
                        if (strncmp (line, "Hardware", 8) == 0)
                        break ;
                }
               
        fclose (cpuFd) ;
        if (strncmp (line, "Hardware", 8) != 0)
                piBoardRevOops ("No \"Hardware\" line") ;
       
for (d = &line ; (*d == '\n') || (*d == '\r') ; --d)
    *d = 0 ;
if (wiringPiDebug)
    printf ("piboardRev: Hardware string: %s\n", line) ;
       
        if (strstr(line,"sun50i") != NULL)                        //guenter von sun7i auf sun8i
        {
                if (wiringPiDebug)
                printf ("Hardware:%s\n",line) ;
                return 1 ;
        }
        else
        {
                if (wiringPiDebug)
                printf ("Hardware:%s\n",line) ;
                return 0 ;
}Ersetzen durch:
int isH5(void)
{
   return 1;
}

und dann compilieren und installieren:
cd WiringOP
chmod +x ./build
sudo ./build
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
page: [1]
View full version: I2C drivers for OrangePi PC 2