Update installer.sh
This commit is contained in:
parent
e2d171efe1
commit
ab48b3df2e
1 changed files with 57 additions and 5 deletions
62
installer.sh
62
installer.sh
|
|
@ -31,7 +31,7 @@ tar xfv avrdude-7.0.tar.gz && cd avrdude-7.0/
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
# Clonen van de repository
|
# Clonen van de GrovePi repository
|
||||||
echo -e "${green}Clonen van GrovePi repository...${reset}"
|
echo -e "${green}Clonen van GrovePi repository...${reset}"
|
||||||
sudo rm -rf /opt/grovepi
|
sudo rm -rf /opt/grovepi
|
||||||
sudo git clone https://github.com/DexterInd/GrovePi /opt/grovepi
|
sudo git clone https://github.com/DexterInd/GrovePi /opt/grovepi
|
||||||
|
|
@ -47,18 +47,70 @@ echo -e "${green}GrovePi installeren...${reset}"
|
||||||
cd /opt/grovepi/Script
|
cd /opt/grovepi/Script
|
||||||
sudo bash install.sh
|
sudo bash install.sh
|
||||||
|
|
||||||
# Installeren van i2c-tools
|
# Installeren i2c-tools
|
||||||
cd /opt/grovepi/Scripts/i2c-tools-3.1.0
|
cd /opt/grovepi/Scripts/i2c-tools-3.1.0
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
# Installeren van i2c-tools python
|
# Installeren i2c-tools python
|
||||||
cd /opt/grovepi/Scripts/i2c-tools-3.1.0/py-smbus
|
cd /opt/grovepi/Scripts/i2c-tools-3.1.0/py-smbus
|
||||||
sudo python3 setup.py build
|
sudo python3 setup.py build
|
||||||
sudo python3 setup.py install
|
sudo python3 setup.py install
|
||||||
|
|
||||||
# Installeren van wiringpi
|
# Installeren en aanpassen van WiringPi
|
||||||
pip3 install wiringpi --break-system-packages
|
cd /home/pi && git clone https://github.com/WiringPi/WiringPi
|
||||||
|
cd WiringPi && sudo rm wiringPi/wiringPiLegacy.c
|
||||||
|
cat > wiringPi/wiringPiLegacy.c <<EOL
|
||||||
|
#include <wiringPi.h>
|
||||||
|
#include "wiringPiLegacy.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
extern int wiringPiDebug;
|
||||||
|
|
||||||
|
const char* GetPiRevisionLegacy(char* line, int linelength, unsigned int* revision) {
|
||||||
|
// Verwijder de toegang tot /proc/cpuinfo
|
||||||
|
// FILE *cpuFd;
|
||||||
|
// if ((cpuFd = fopen ("/proc/cpuinfo", "r")) == NULL)
|
||||||
|
// piGpioLayoutOops ("Unable to open /proc/cpuinfo");
|
||||||
|
|
||||||
|
// In plaats van gegevens te lezen uit /proc/cpuinfo, kunnen we de revision
|
||||||
|
// altijd als een voorbeeld instellen.
|
||||||
|
// Simuleer een revision (bijvoorbeeld als een bekende waarde, zoals 0x900092)
|
||||||
|
*revision = 0x900092;
|
||||||
|
|
||||||
|
if (wiringPiDebug)
|
||||||
|
printf("GetPiRevisionLegacy: Simulated Revision: 0x%x\n", *revision);
|
||||||
|
|
||||||
|
return "Revision Simulated";
|
||||||
|
}
|
||||||
|
|
||||||
|
int piGpioLayoutLegacy(void) {
|
||||||
|
// Verwijder de toegang tot /proc/cpuinfo
|
||||||
|
// FILE *cpuFd;
|
||||||
|
// char line[120];
|
||||||
|
// if ((cpuFd = fopen("/proc/cpuinfo", "r")) == NULL)
|
||||||
|
// piGpioLayoutOops ("Unable to open /proc/cpuinfo");
|
||||||
|
|
||||||
|
// In plaats van te controleren op hardware-informatie uit /proc/cpuinfo,
|
||||||
|
// kunnen we de layout altijd een bekende waarde geven, bijvoorbeeld 2 (wat
|
||||||
|
// overeenkomt met de meeste recente Raspberry Pi-modellen zoals de B+).
|
||||||
|
int gpioLayout = 2; // Dit is een standaardwaarde
|
||||||
|
|
||||||
|
if (wiringPiDebug)
|
||||||
|
printf("piGpioLayout: Returning layout: %d\n", gpioLayout);
|
||||||
|
|
||||||
|
return gpioLayout;
|
||||||
|
}
|
||||||
|
EOL
|
||||||
|
|
||||||
|
# Installeren van WiringPi python
|
||||||
|
cd /home/pi && git clone git clone --recursive https://github.com/WiringPi/WiringPi-Python.git
|
||||||
|
cd WiringPi-Python && sudo rm -rf WiringPi && sudo cp -r /home/pi/WiringPi /home/pi/WiringPi-Python/
|
||||||
|
sudo python3 setup.py build
|
||||||
|
sudo python3 setup.py install
|
||||||
|
|
||||||
# Controle uitvoeren
|
# Controle uitvoeren
|
||||||
echo -e "${green}GrovePi test uitvoeren...${reset}"
|
echo -e "${green}GrovePi test uitvoeren...${reset}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue