Etape 1 : Installer OS sur la carte sd

 Aller sur https://www.armbian.com/orange-pi-zero/

Télécharger Ubuntu (Debian problèmes avec gpio, git, python-dev).

Dézipper le fichier Ambian. 

Télécharger Win32 Disk imager sur https://sourceforge.net/projects/win32diskimager/?source=typ_redirect

Installer le et lancer le.

Sélectionner le fichier .img de Ambian et indiquer l'emplacement de la carte SD.

Cliquer sur le bouton Write pour lancer l'installation de l'OS.

Etape 2 : Mise en route de l'orange pi zero

Insérer la carte SD, brancher le cable Ethernet et Alimentation.

Normalement, une led s'allume sur l'orange pi.

Aller sur votre box pour récupérer l'adresse ip de l'orange pi.

Etape 3 : Accéder à orange pi 

Lancer putty en SSH.

Indiquer l'adresse ip et connecter vous.

Par défaut, le login est root et le mot de passe 1234.

On vous demande de le changer.

Mettre le mot de passe sti2dsin (pour le lycée).

Etape 4 : Mettre à jour l'OS

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y

Etape 5 : Activer Désactiver le wifi

nmtui-connect


 

Etape 6 : Installer gpio c++

git clone https://github.com/xpertsavenue/WiringOP-Zero.git

Installation

cd WiringOP-Zero
chmod +x ./build
sudo ./build

Source : https://github.com/xpertsavenue/WiringOP-Zero

tuto

https://wiki.mchobby.be/index.php?title=Pi-WiringPi-Utilitaire-GPIO

 

Vérifier l'installation en tapant :    

Check the Pin definitions in WiringPi

Please use the gpio command in the command line to see the pin definitions:

gpio readall


Etape 7 : Installer gpio python

git clone --recursive https://github.com/lanefu/WiringPi-Python-OP.git 
cd WiringPi-Python-OP
rm -R WiringPi
cp -R $HOME/WiringOP-Zero ./
mv WiringOP-Zero WiringPi

4.Build WiringPi-Python-OP-ZERO library

sudo apt-get install python-dev python-setuptools swig
swig2.0 -python wiringpi.i
sudo python setup.py install
cd tests
sudo python test.py

WiringPi-Python-OP-ZERO have there pin.
PysPin PinInLib
1(3.3V)
2(5V)
3      8
4(5V)
5      9
6(GND)
7      7
8      15
9(GND)
10     16
11     0
12     1
13     2
14(GND)
15     3
16     4
17(3.3V)
18     5
19     12
20(GND)
21     13
22     6
23     14
24     10
25(GND)
26     11



Etape 5 : GPIO en python

lecture es entrées :
http://www.projetsdiy.fr/orange-pi-armbian-librairie-wiringpi-wiringop/#.WLvfWvnhDDc

 

Très bien : http://www.orangepi.org/Docs/WiringPi.html 

utilisation de wiringpi :

http://gilles.thebault.free.fr/spip.php?article44

 

 Etape 6 : Serveur web

installer python-pip pour télécharger facilement les librairies python

http sur pythonsudo apt-get install python-pip

simple server 

https://www.acmesystems.it/python_httpd

créer le fichier

nano httpserver.py

Contenu du fichier 

import sys
import wiringpi
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler

class LightsHandler(SimpleHTTPRequestHandler):
def do_GET(self):
print "handling " + self.path
if ("lightson" in self.path):
self.lights_on()
phtml = "light on"
elif ("lightsoff" in self.path):
self.lights_off()
phtml = "light off"
self.send_response(200)
self.send_header('Content-type','text/html')
self.end_headers()
# Send the html message
self.wfile.write(phtml)
return
 

def lights_on(self):
print "on"
wiringpi.digitalWrite(11,1)

def lights_off(self):
print "off"
wiringpi.digitalWrite(11,0)


HandlerClass = LightsHandler
ServerClass=BaseHTTPServer.HTTPServer
Protocol="HTTP/1.0"

server_address= ("", 8080)

HandlerClass.protocol_version = Protocol
httpd = ServerClass(server_address, HandlerClass)

sa = httpd.socket.getsockname()
print "serving"

wiringpi.wiringPiSetupPhys()
wiringpi.pinMode(11,1)


httpd.serve_forever()

Lancer le serveur

python  -m httpserver.py 

 

Source GPIO : https://gist.github.com/lanefu/f16a67195c9fa35c466c6b50cdaeadea 

https://github.com/lanefu/WiringPi-Python-OP

 Source : http://www.instructables.com/id/Orange-Pi-Plus-2-Armbian/?ALLSTEPS

 

MQTT : https://www.mysensors.org/build/orange

Arduino and Apple HomeKit Integration - Control Your Home From Siri! IoT Is Here

http://www.instructables.com/id/Arduino-and-Apple-HomeKit-Integration-Control-Your/?ALLSTEPS

 

Installer domoticz

https://projetsdiy.fr/installer-domoticz-sur-un-orange-pi-lite-wifi-sous-armbian/

 

 

 

En poursuivant votre navigation sur mon site, vous acceptez l’utilisation des Cookies et autres traceurs  pour réaliser des statistiques de visites et enregistrer sur votre machine vos activités pédagogiques. En savoir plus.