{"id":407,"date":"2018-11-28T16:48:13","date_gmt":"2018-11-28T15:48:13","guid":{"rendered":"http:\/\/www.boichat.ch\/wpjrsp\/?p=407"},"modified":"2019-02-12T08:37:30","modified_gmt":"2019-02-12T07:37:30","slug":"travail-depuis-ubuntu-vs-windows","status":"publish","type":"post","link":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/","title":{"rendered":"Raspberry Pi 3, Java, Python depuis Linux Ubuntu"},"content":{"rendered":"<p>Tr\u00e8s gros travail pour cet article pour le rendre simple et<em><strong> sans avoir vraiment besoin du livre!<\/strong><\/em> L&rsquo;id\u00e9e est montrer un petit exemple en Python et en Java pour allumer ou \u00e9teindre deux leds, une verte et une rouge, suivant si un senseur de lumi\u00e8re d\u00e9tecte qu&rsquo;il y a ou non assez de lumi\u00e8re! La m\u00e9thode utilis\u00e9e est la m\u00eame que pour le livre et tous les composants attach\u00e9s au GPIO: sch\u00e9ma Fritzing, test en Python et codage en Java.<\/p>\n<p><span style=\"font-size: 24pt;\"><em><strong>Au contraire du livre, sous Windows PC, tout se fera ici sur un PC Ubuntu.<\/strong><\/em><\/span><\/p>\n<p>Dans l&rsquo;avant-propos de mon livre, dont les outils sont sp\u00e9cifiques \u00e0 Windows 10,\u00a0 j&rsquo;ai \u00e9crit \u00e0 la page VI:<\/p>\n<p><strong><span style=\"background-color: #00ccff; font-size: 14pt; font-family: helvetica, arial, sans-serif;\">Pour le d\u00e9veloppement, je n\u2019ai consid\u00e9r\u00e9 ici que l\u2019environnement Windows 10. Mais certains outils comme Eclipse existent aussi sous Linux (par exemple, Ubuntu) et sous Mac. Des programmes comme PuTTY ou WinSCP ont \u00e9galement leurs \u00e9quivalents dans ces syst\u00e8mes d\u2019exploitation.<\/span><\/strong><\/p>\n<p><b>La r\u00e9f\u00e9rence pour cet article-ci est Ubuntu 18.04.1 LTS, mais devrait \u00eatre applicable pour d&rsquo;autres versions de Linux. J&rsquo;assume que les utilisateurs ont de bonnes connaissances Linux et de d\u00e9veloppement. Moi-m\u00eame je ne suis qu&rsquo;un utilisateur Ubuntu occasionnel et qui aurait de la peine \u00e0 ajouter un raccourci \u00e0 Eclipse sur le bureau apr\u00e8s installation. Toutes les personnes d\u00e9sirant am\u00e9liorer cet article peuvent <\/b><a style=\"font-weight: bold;\" href=\"mailto:jean-bernard@boichat.ch?subject=Java et le Raspberry\u00a0Pi\u00a03 (WP-Ubuntu)\">me contacter et m&rsquo;envoyer du mat\u00e9riel<\/a><b>.\u00a0<\/b><\/p>\n<p>Pour la v\u00e9rification, j&rsquo;ai utilis\u00e9 un\u00a0Raspberry Pi Zero WH qui avait d\u00e9j\u00e0 une micro carte SD install\u00e9e depuis Windows 10 et fonctionnelle. J&rsquo;ai donc commenc\u00e9 par faire une sauvegarde (chapitre 3 du livre) de l&rsquo;image. Une sauvegarde sous Linux se fait avec la commande <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">dd <\/span><\/strong>(voir ci-dessous) avec les param\u00e8tres <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">if <\/span>et <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">of <\/span>invers\u00e9s.<\/p>\n<p>Lorsqu&rsquo;on utilise une carte d\u00e9j\u00e0 utilis\u00e9e, il n&rsquo;est pas possible d&rsquo;appliquer les proc\u00e9dures d\u00e9crites sous <a href=\"https:\/\/www.raspberrypi.org\/documentation\/installation\/installing-images\/linux.md\" target=\"_blank\" rel=\"noopener\">https:\/\/www.raspberrypi.org\/documentation\/installation\/installing-images\/linux.md<\/a>, proc\u00e9dure que j&rsquo;ai d&rsquo;ailleurs utilis\u00e9es et d\u00e9crites ici plus simplement.<\/p>\n<h3>Formatage<\/h3>\n<p>Il manque donc ici le formatage, absolument n\u00e9cessaire sur une micro carte SD non vierge,\u00a0 et nous utiliserons l&rsquo;utilitaire <strong>Disks<\/strong> d&rsquo;Ubuntu, ou un autre, pour le faire.<\/p>\n<h3>T\u00e9l\u00e9chargement<\/h3>\n<p>Depuis le site\u00a0<a href=\"https:\/\/raspbian-france.fr\/telechargements\/\" target=\"_blank\" rel=\"noopener\">Raspbian France<\/a>, j&rsquo;ai t\u00e9l\u00e9charg\u00e9 le fichier <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">Raspbian_latest.zip<\/span><\/strong> pour extraire l&rsquo;image\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\"><strong>2018-11-13-raspbian-stretch.img<\/strong><\/span>\u00a0 J&rsquo;ai d\u00e9pos\u00e9 cette derni\u00e8re dans mon r\u00e9pertoire Ubuntu\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">\/home\/jbb\/raspberryPi<\/span> que j&rsquo;avais pr\u00e9alablement cr\u00e9\u00e9.<\/p>\n<h3>Ecriture de l&rsquo;image<\/h3>\n<p>Pour le formatage et l&rsquo;\u00e9criture, nous utiliserons le m\u00eame adaptateur USB de carte SD que celui d\u00e9crit au chapitre 3.<\/p>\n<p>L&rsquo;utilitaire Linux <span style=\"font-size: 14pt;\"><strong>lsblk<\/strong>\u00a0<\/span>ex\u00e9cut\u00e9 dans une console Linux Terminal est essentiel pour d\u00e9terminer le \u00ab\u00a0device\u00a0\u00bb de notre micro carte SD. Chaque fois que nous ressortirons notre carte ou retirerons le c\u00e2ble USB, il faudra correctement \u00e9jecter\u00a0 ou <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">umount<\/span>\u00a0le device.<\/p>\n<p>Ici les deux derni\u00e8res lignes de <strong>lsbk<\/strong> avec ma carte install\u00e9e avant formatage:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">&#8230;<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">sdf 8:80 1 14.9G 0 disk<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">\u251c\u2500sdf1 8:81 1 43.9M 0 part \/media\/jbb\/boot<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">\u2514\u2500sdf2 8:82 1 3.1G 0 part \/media\/jbb\/rootfs<\/span><\/p>\n<p>Le\u00a0\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">\/media\/jbb\/boot <\/span>est \u00e9quivalent au <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">boot (K:) <\/span>sous Windows.<\/p>\n<p>Un\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">ls \/media\/jbb\/boot<\/span> est toujours possible pour examiner les fichiers.<br \/><strong>Conclusion:\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">\/dev\/sdf<\/span> est bien le device \u00e0 utiliser, mais pourrait \u00e9ventuellement \u00eatre diff\u00e9rent.<\/strong><\/p>\n<p>Apr\u00e8s formatage (pas n\u00e9cessaire pour une carte vierge) et apr\u00e8s avoir retir\u00e9 et remis notre carte, nous pourrons alors copier l&rsquo;image Raspbian sur la micro carte SD:<\/p>\n<p><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt; background-color: #ccffff;\">sudo dd bs=4M if=2018-11-13-raspbian-stretch.img of=\/dev\/sdf conv=fsync<\/span><\/strong><\/span><\/p>\n<p><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt; background-color: #ccffff;\">366+0 records out<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 10pt; background-color: #ccffff;\">1535115264 bytes (1.5 GB, 1.4 GiB) copied, 111.427 s, 13.8 MB\/s<\/span><\/strong><\/span><\/p>\n<p>Un <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">sync<\/span><\/strong>\u00a0pour terminer est toujours conseill\u00e9.<\/p>\n<p>Comme pr\u00e9c\u00e9demment, nous allons sortir correctement et remettre la carte avant un nouveau <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">lsblk<\/span><\/strong>:<\/p>\n<p><span style=\"background-color: #ccffff;\">sdf 8:80 1 14.9G 0 disk<\/span><br \/><span style=\"background-color: #ccffff;\">\u251c\u2500sdf1 8:81 1 43.9M 0 part \/media\/jbb\/boot<\/span><br \/><span style=\"background-color: #ccffff;\">\u2514\u2500sdf2 8:82 1 3.1G 0 part \/media\/jbb\/rootfs<\/span><\/p>\n<h3>D\u00e9finition de l&rsquo;adresse IP<\/h3>\n<p>Comme d\u00e9crit dans le livre au chapitre 3, il faut appliquer la proc\u00e9dure pour que le routeur puisse d\u00e9finir une adresse IP \u00e0 notre Raspberry Pi que nous n&rsquo;avons pas encore soumis \u00e0 un premier d\u00e9marrage. Ensuite nous irons dans le routeur pour d\u00e9finir l&rsquo;adresse static, donc fixe.<\/p>\n<p>Avec notre micro carte SD toujours dans le lecteur et mont\u00e9, un \u00e9diteur de texte sous Linux, voir avec <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">vi<\/span>\u00a0expliqu\u00e9 dans le livre, et dans une console Terminal, nous allons cr\u00e9er un fichier <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">ssh <\/span>vide dans le r\u00e9pertoire\u00a0 <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">\/media\/jbb\/boot<\/span> de la micro carte SD mont\u00e9. Lorsque termin\u00e9:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">ls -l ssh<\/span><br \/><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">0 bytes<\/span><\/p>\n<p>Le fichier le plus important, c&rsquo;est\u00a0<span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">wpa_supplicant.conf<\/span>\u00a0, qui doit se trouver aussi\u00a0 dans le r\u00e9pertoire\u00a0 <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">\/media\/jbb\/boot<\/span>. C&rsquo;est lui qui va \u00eatre utilis\u00e9 et ensuite effac\u00e9 automatiquement au premier d\u00e9marrage. Il nous permettra de d\u00e9finir une adresse IP \u00e0 notre Raspberry Pi. Avec <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">vi <\/span>ou un autre \u00e9diteur, nous d\u00e9poserons le contenu suivant dans ce fichier:<\/p>\n<p><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">country=FR<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">update_config=1<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">ctrl_interface=DIR=\/var\/run\/wpa_supplicant GROUP=netdev<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">network={<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">ssid=\u00a0\u00bbxxxx\u00a0\u00bb<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">psk=\u00a0\u00bbyyyy\u00a0\u00bb<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">key_mgmt=WPA-PSK<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt; background-color: #ccffff;\">}<\/span><\/strong><\/span><\/p>\n<p><strong><span style=\"font-family: 'courier new', courier, monospace;\">xxxx<\/span> <\/strong>est le nom du routeur et <strong><span style=\"font-family: 'courier new', courier, monospace;\">yyyy<\/span> <\/strong>la cl\u00e9 (le mot de passe), les m\u00eames que lorsque nous d\u00e9finissons une connexion WiFi pour un Smartphone. Le country peut \u00eatre diff\u00e9rent. C&rsquo;est clair.<\/p>\n<p>Apr\u00e8s v\u00e9rification de la pr\u00e9sence et du contenu de ces deux fichiers, nous pourrons alors retirer la micro carte SD avec un Eject sur l&rsquo;ic\u00f4ne du bureau de ce device ou alors avec un <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">umount \/media\/jbb\/boot<\/span>, mais apr\u00e8s avoir quitt\u00e9 son r\u00e9pertoire dans la console Terminal, c&rsquo;est clair.<\/p>\n<h3>Premier d\u00e9marrage<\/h3>\n<p>C&rsquo;est la m\u00eame proc\u00e9dure que est d\u00e9crite au chapitre 3: on insert la carte sur ou sous le Rasperry Pi suivant le mod\u00e8le, on l&rsquo;alimente et on v\u00e9rifie l&rsquo;adresse IP.<\/p>\n<p>La commande <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">arp -a<\/span> dans une console Terminal est la m\u00eame que sous Windows et l&rsquo;adresse physique devrait commencer par <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">b8-<\/span>. Cette valeur de d\u00e9but indique un Raspberry Pi r\u00e9cent. J&rsquo;ai constat\u00e9 que cette commande arp ne r\u00e9agissait pas imm\u00e9diatement: donc un peu de patience.<\/p>\n<p>En utilisant <span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\">arp -a<\/span> avant le d\u00e9marrage du Raspberry Pi, nous pourrions alors v\u00e9rifier la diff\u00e9rence et identifier la nouvelle adresse si nous avions plusieurs Raspberry Pi.<\/p>\n<p>Ce sera alors le bon moment pour acc\u00e9der \u00e0 notre routeur avec une interface Web et d&rsquo;y fixer l&rsquo;adresse IP.<\/p>\n<h3>Outils r\u00e9seaux sur Ubuntu<\/h3>\n<p>Ce n&rsquo;est pas vraiment tr\u00e8s clair de ce qu&rsquo;il faut vraiment au sujet des outils r\u00e9seaux Ubuntu et un<\/p>\n<p><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">sudo apt install net-tools<\/span><\/strong><\/p>\n<p>n&rsquo;est pas inutile!<\/p>\n<h3>Access ssh depuis Ubuntu<\/h3>\n<p>Pour acc\u00e9der au Raspberry Pi la commande ssh suffira:<\/p>\n<p><strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">ssh pi@192.168.1.134<\/span><\/strong><\/p>\n<p>et nous recevrons du Raspberry Pi :<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">pi@192.168.1.134&rsquo;s password:<\/span><\/p>\n<p>Nous pourrons alors acc\u00e9der \u00e0 notre Raspberry Pi comme avec <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">puTTY\u00a0<\/span>sous Windows avec le mot de passe <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">raspberry<\/span><\/strong>.<\/p>\n<h3>Configuration du Raspberry Pi<\/h3>\n<p>Dans l&rsquo;article <a href=\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/07\/raspberry-pi-zero-wh\/\" target=\"_blank\" rel=\"noopener\">Raspberry Pi Zero WH<\/a> nous en discutons quelques aspects mais il faudra se r\u00e9f\u00e9rer au livre pour, avec <strong><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">sudo raspi-config<\/span><\/strong>, changer le mot de passe et d\u00e9finir la zone europ\u00e9enne correcte de l&rsquo;heure. Nous devrons aussi installer le Pi4J, la librairie Java utilis\u00e9e pour les applications du livre, avec <span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\"><strong>curl -s get.pi4j.com | sudo bash<\/strong>.<\/span><\/p>\n<h3>Installation de FileZila<\/h3>\n<p><strong>FileZila<\/strong> est l&rsquo;\u00e9quivalent <strong>WinScp<\/strong> sous Windows 10. Il va nous permettre de transf\u00e9rer des fichiers Java compil\u00e9s et des script Python. Pour l&rsquo;installation sur Ubuntu, si n\u00e9cessaire et pas encore install\u00e9:<\/p>\n<p><span style=\"font-family: 'courier new', courier, monospace; font-size: 14pt;\">sudo apt-get install filezilla<\/span><\/p>\n<h3>Installation d&rsquo;Eclipse<\/h3>\n<p>Il faut se rendre sur le site d&rsquo;Eclipse,<br \/><a href=\"https:\/\/www.eclipse.org\/downloads\/packages\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.eclipse.org\/downloads\/packages\/<\/a> et t\u00e9l\u00e9charger<br \/><strong>eclipse-java-2018-09-linux-gtk-x86_64.tar.gz<\/strong>.<\/p>\n<p>De m\u00eame pour le JDK de Java et nous prendrons la version 8 dont nous avons besoin pour le d\u00e9veloppement d&rsquo;application Pi4J pour le Raspberry Pi: <a href=\"https:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk8-downloads-2133151.html\" target=\"_blank\" rel=\"noopener\">https:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk8-downloads-2133151.html<\/a>.<br \/>Le fichier sera\u00a0<strong>jdk-8u191-linux-x64.tar.gz <\/strong>et nous l&rsquo;installerons dans le r\u00e9pertoire\u00a0<strong>\/home\/jbb\/jdk1.8.0_191<\/strong>\u00a0o\u00f9 <strong>jbb<\/strong> est mon nom d&rsquo;utilisateur Ubuntu.<\/p>\n<p>Nous d\u00e9poserons Eclipse dans le r\u00e9pertoire <strong>\/home\/jbb\/eclipse-java-2018-09-linux-gtk-x86_64<\/strong>.<\/p>\n<p>Avant de pouvoir d\u00e9marrer Eclipse, il faudra d\u00e9finir quelques variables d&rsquo;environnement:<\/p>\n<p><span style=\"background-color: #ffcc99;\"><em><strong>sudo gedit \/etc\/profile<\/strong><\/em><\/span><br \/><span style=\"background-color: #ffcc99;\"><strong>JAVA_HOME=\/home\/jbb\/jdk1.8.0_191<\/strong><\/span><br \/><span style=\"background-color: #ffcc99;\"><strong>PATH=$PATH:$HOME\/bin:$JAVA_HOME\/bin<\/strong><\/span><br \/><span style=\"background-color: #ffcc99;\"><strong>export JAVA_HOME<\/strong><\/span><br \/><span style=\"background-color: #ffcc99;\"><strong>export JRE_HOME<\/strong><\/span><br \/><span style=\"background-color: #ffcc99;\"><strong>export PATH<\/strong><\/span><\/p>\n<p>Ensuite un reboot d&rsquo;Ubuntu sera n\u00e9cessaire.<\/p>\n<p>Dans le r\u00e9pertoire <strong>\/home\/jbb\/eclipse-java-2018-09-linux-gtk-x86_64\/eclipse<\/strong> se trouve notre binaire <strong>eclipse<\/strong> que nous pourrons d\u00e9marrer avec <strong>.\/eclipse &amp;<\/strong>.<\/p>\n<p>Nous d\u00e9finirons alors l&rsquo;espace de travail dans la fen\u00eatre pr\u00e9sent\u00e9e<br \/><strong>\/home\/jbb\/eclipse-workspace<\/strong> .<\/p>\n<p>En suivant les instruction du livre, nous pourrons cr\u00e9er un nouveau project <strong>Hello<\/strong> et y d\u00e9finir une classe de test:<\/p>\n<p><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">public class Hello {<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0 public static void main(String[] args) {<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0 \u00a0 System.out.println(\u00ab\u00a0Hello Ubuntu\u00a0\u00bb);<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0 }<\/span><\/strong><\/span><br \/><span style=\"background-color: #ccffff;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">}<\/span><\/strong><\/span><\/p>\n<p>Pour la v\u00e9rification, c&rsquo;est la m\u00eame d\u00e9marche que dans l&rsquo;article\u00a0<a href=\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/07\/raspberry-pi-zero-wh\/\" target=\"_blank\" rel=\"noopener\">Raspberry Pi Zero WH<\/a>\u00a0mais en utilisant <strong>FileZilla<\/strong> pour le t\u00e9l\u00e9chargement et <strong>ssh<\/strong> pour ex\u00e9cuter les scripts Python ou le code Java.<\/p>\n<h3>Sch\u00e9ma Fritzing<\/h3>\n<p>Des sch\u00e9mas Fritzing, des scripts Python et des classes Java pour des LEDs et le capteur de lumi\u00e8re se trouvent dans le livre aux chapitres 6, 8 et 16. L&rsquo;installation et l&rsquo;utilisation de Frizing y sont m\u00eame expliqu\u00e9es. Ce sch\u00e9ma a \u00e9t\u00e9 cr\u00e9e pour cet article:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-459\" src=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb-235x300.png\" alt=\"\" width=\"353\" height=\"451\" srcset=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb-235x300.png 235w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb-768x982.png 768w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb-801x1024.png 801w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb.png 1014w\" sizes=\"(max-width: 353px) 100vw, 353px\" \/><\/p>\n<p>Les pins GPIO et le logiciel sont \u00e9quivalent pour le Raspberry Pi 3 B ou le Zero WH. La position des broches est en annexe du livre ou <a href=\"http:\/\/pi4j.com\/pins\/model-b-plus.html\" target=\"_blank\" rel=\"noopener\">sur le site du Pi4J<\/a>.<\/p>\n<p>Les r\u00e9sistances de 330 Ohm sont n\u00e9cessaires pour prot\u00e9ger les circuits du Raspberry Pi.\u00a0 La capacit\u00e9 devra \u00eatre positionn\u00e9 correctement o\u00f9 le c\u00f4t\u00e9 positif devrait \u00eatre marqu\u00e9.<\/p>\n<p>Le fil jaune est connect\u00e9 \u00e0 la broche 13 physique (GPIO_02 du Pi4J). Les fils vert et orange utilisent les m\u00eames broches que le circuit au chapitre 5 et utilis\u00e9 dans le script Python\u00a0<strong>blink2led.py<\/strong> du chapitre suivant et dans l&rsquo;article\u00a0PyDev, <a href=\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/10\/31\/extension-plugin-pydev-pour-eclipse\/\" target=\"_blank\" rel=\"noopener\">un IDE Python pour Eclipse (usage: le GPIO du Raspberry Pi)<\/a>.<\/p>\n<p>Image du circuit avec le Raspberry Pi Zero WH:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-456\" src=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/circuit-300x179.png\" alt=\"\" width=\"464\" height=\"277\" srcset=\"https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/circuit-300x179.png 300w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/circuit-768x459.png 768w, https:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/circuit.png 813w\" sizes=\"(max-width: 464px) 100vw, 464px\" \/><\/p>\n<h3>Script Python<\/h3>\n<p>Le code Python suivant, d\u00e9pos\u00e9 dans le fichier <strong><span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\">lightleds.py<\/span>, r<\/strong>e\u00e7oit en continu l&rsquo;intensit\u00e9 lumineuse du capteur. La r\u00e9f\u00e9rence du code source Python se trouve dans l&rsquo;avant-propos du livre.<\/p>\n<p>La limite de 9000 allume la led rouge. La valeur re\u00e7ue est inverse \u00e0 l&rsquo;intensit\u00e9. En dessus de 9000, on pourrait allumer un luminaire contr\u00f4ler par un relais (chapitre 15 du livre).<\/p>\n<pre style=\"overflow: auto; width: 100%; height: 100%; background-color: #fafcdc;\"># coding: utf-8\nimport RPi.GPIO as GPIO\nimport time\n\nGPIO.setmode(GPIO.BOARD)\n\n#D\u00e9finition des pins sur les broches 13, 12 et 15\nlightPin = 13 # (GPIO 2)\nLedPinGreen = 12 # pin15 (Pi4J GPIO_01)\nLedPinRed = 15 # pin15 (Pi4J GPIO_03)\n# pin3 la terre\n\ndef rc_time (lightPin):\n  count = 0\n\n  #Configuration en sortie\n  GPIO.setup(lightPin, GPIO.OUT)\n  GPIO.output(lightPin, GPIO.LOW)\n  time.sleep(0.1) #pause de charge\n\n  #Configuration en entr\u00e9e\n  GPIO.setup(lightPin, GPIO.IN)\n\n  #Comptage\n  while (GPIO.input(lightPin) == GPIO.LOW):\n    count += 1\n\nreturn count\n\ntry:\n  GPIO.setup(LedPinRed, GPIO.OUT) # LedPinRed en mode output\n  GPIO.setup(LedPinGreen, GPIO.OUT) # LedPinGreen en mode  output\n\n  # Boucle \u00e9ternelle\n  while True:\n    value = rc_time(lightPin)\n    print value\n    if value &gt; 9000:\n      GPIO.output(LedPinRed, GPIO.HIGH) # Allume la led rouge\n      GPIO.output(LedPinGreen, GPIO.LOW) # Eteint la led verte\n    else:\n      GPIO.output(LedPinGreen, GPIO.HIGH) # Allume la led verte\n      GPIO.output(LedPinRed, GPIO.LOW) # Eteint la led rouge\n\nexcept KeyboardInterrupt:\n  pass\nfinally:\n  GPIO.cleanup()\n\nGPIO.setmode(GPIO.BOARD)\n<\/pre>\n<p>L&rsquo;instruction\u00a0<span style=\"background-color: #ffff99; font-size: 10pt;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">GPIO.setmode(GPIO.BOARD)<\/span><\/strong><\/span> indique que nous travaillons avec les broches physique.<\/p>\n<p>Ce script Python peut \u00eatre directement pr\u00e9par\u00e9 sur le Raspberry Pi avec un \u00e9diteur et ex\u00e9cut\u00e9 avec la commande <strong>python lightleds.py<\/strong>. Attention si nous copions collons d&rsquo;Ubuntu au Raspberry Pi, de bien v\u00e9rifier l&rsquo;indentation indispensable aux scripts Python.<\/p>\n<p>L&rsquo;article\u00a0<a href=\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/08\/programmez-en-java-sans-le-pi4j\/\" target=\"_blank\" rel=\"noopener\">Programmez en Java sans le Pi4J<\/a> explique comment nous pourrions ex\u00e9cuter ce script en Java sans utiliser la librairie Pi4J.<\/p>\n<h3>Exercices<\/h3>\n<h4>Exercice 1<\/h4>\n<p>Modifier\u00a0<strong><span style=\"font-size: 14pt; font-family: 'courier new', courier, monospace;\">lightleds.py<\/span><\/strong>\u00a0pour qu&rsquo;il re\u00e7oive comme param\u00e8tre la valeur limite (ici 9000) et un y\/n pour montrer ou non \u00e0 l&rsquo;\u00e9cran la valeur mesur\u00e9e\u00a0 (c&rsquo;est \u00e0 dire <span style=\"font-size: 14pt;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">print value<\/span><\/strong><\/span>). Programmez correctement le script pour que les deux param\u00e8tres soient optionnels et dans n&rsquo;importe quel ordre.<\/p>\n<h2>Partie Java<\/h2>\n<p>Ecrire le code Java sous Eclipse contenant la m\u00eame fonction que le code Python ci-dessus, est la proc\u00e9dure habituelle adopt\u00e9e dans le livre.<\/p>\n<p>Le code pr\u00e9sent\u00e9 ici ne contiendra ni de code de simulation c\u00f4t\u00e9 PC Ubuntu ni de <strong>System.out.print()<\/strong> de test et sera donc beaucoup plus simple que les exemples dans le livre. Il faudra juste qu&rsquo;il compile sous Eclipse et Ubuntu, pas plus. Donc, attention\u00a0aux erreurs.<\/p>\n<p>Dans le livre nous v\u00e9rifions avec du code Java le syst\u00e8me d&rsquo;exploitation et nous simulons la pr\u00e9sence de composants <strong>GPIO<\/strong>. Pour le capteur de lumi\u00e8re nous utilisons la m\u00e9thode\u00a0<strong>Math.random()<\/strong>\u00a0 pour g\u00e9n\u00e9rer des valeurs al\u00e9atoires.<\/p>\n<p>Si nous d\u00e9sirons utiliser du code du livre pour l&rsquo;ex\u00e9cuter sous Eclipse d&rsquo;Ubuntu, il faudra juste corriger:<\/p>\n<p><span style=\"font-size: 12pt;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">if (System.getProperty(\u00ab\u00a0os.name\u00a0\u00bb).startsWith(\u00ab\u00a0Windows\u00a0\u00bb)) {<\/span><\/strong><\/span><\/p>\n<p>avec:<\/p>\n<p><span style=\"font-size: 12pt;\"><strong><span style=\"font-family: 'courier new', courier, monospace;\">if (System.getProperty(\u00ab\u00a0os.name\u00a0\u00bb).startsWith(\u00ab\u00a0Linux\u00a0\u00bb)) {<\/span><\/strong><\/span><\/p>\n<p>Le code qui suit a \u00e9t\u00e9 d\u00e9velopp\u00e9 sous Windows dont le projet Eclipse\u00a0<strong>LightReadLeds<\/strong> a \u00e9t\u00e9 ensuite copi\u00e9 sur un PC Ubuntu dans son Workspace. Je n&rsquo;ai \u00e9videmment\u00a0 utilis\u00e9 que mon livre: un bon exercice de v\u00e9rification pour moi. Il faudra consulter le chapitre 16 et la classe <strong>LightRead<\/strong> pour les d\u00e9tails de l&rsquo;impl\u00e9mentation qui est similaire ici.<\/p>\n<h3>La classe\u00a0LightReadLeds<\/h3>\n<p><a href=\"http:\/\/www.boichat.ch\/codesource\/LightReadLeds.java\" target=\"_blank\" rel=\"noopener\">Nous trouverons ici le code source de cette classe<\/a>\u00a0qui est un peu diff\u00e9rente de <strong>LightRead<\/strong>\u00a0du livre.<\/p>\n<pre style=\"overflow: auto; width: 100%; height: 100%; background-color: #fafcdc;\">import java.util.ArrayList;\nimport java.util.Collections;\n\nimport com.pi4j.io.gpio.GpioController;\nimport com.pi4j.io.gpio.GpioFactory;\nimport com.pi4j.io.gpio.GpioPinDigitalMultipurpose;\nimport com.pi4j.io.gpio.GpioPinDigitalOutput;\nimport com.pi4j.io.gpio.Pin;\nimport com.pi4j.io.gpio.PinMode;\nimport com.pi4j.io.gpio.PinPullResistance;\nimport com.pi4j.io.gpio.PinState;\nimport com.pi4j.io.gpio.RaspiPin;\n\npublic class <strong>LightReadLeds<\/strong> {\n  private GpioController gpio;\n  private GpioPinDigitalMultipurpose pin;\n  private GpioPinDigitalOutput ledPinR;\n  private GpioPinDigitalOutput ledPinV;\n\n  private ArrayList <strong>listOfValues<\/strong>;\n\n  public <strong>LightReadLeds<\/strong>(Pin pinPi4jLight,\n    Pin pinPi4jLedR, Pin pinPi4jLedV) {\n    gpio = GpioFactory.getInstance();\n    pin = gpio.provisionDigitalMultipurposePin(pinPi4jLight,    \n                        PinMode.DIGITAL_INPUT, \n                        PinPullResistance.PULL_DOWN);\n\n    ledPinR = gpio.provisionDigitalOutputPin(pinPi4jLedR);\n    ledPinV = gpio.provisionDigitalOutputPin(pinPi4jLedV);\n  }\n\n  public void <strong>ledsOnOff<\/strong>(int level, int limit) {\n    if (level &lt; limit) {\n      ledPinR.setState(PinState.HIGH);\n      ledPinV.setState(PinState.LOW);\n    }\n    else {\n      ledPinR.setState(PinState.LOW);\n      ledPinV.setState(PinState.HIGH);\n    }\n  }\n\n  public int <strong>getValue<\/strong>(int nbRead) { \/\/Valeur de la lumi\u00e8re ambiante\n    listOfValues = new ArrayList();\n \n    for (int i = 0; i &lt; nbRead; i++) {\n      pin.setMode(PinMode.DIGITAL_OUTPUT); \/\/Comme sortie\n\n      pin.setState(PinState.LOW);\n      try {\n        Thread.sleep(100);\n      }\n      catch (InterruptedException e) {\n      }\n\n      \/\/ Configure the pin as an input pin now\n      pin.setMode(PinMode.DIGITAL_INPUT); \/\/Comme entr\u00e9e\n\n      int value = 0; \/\/Niveau de recharge\n      for (int j = 0; j &lt; 20000; j++) {\n        if (pin.getState() == PinState.HIGH) {\n          break;\n        }\n        value++;\n      }\n\n      listOfValues.add(value);\n   }\n\n    return computeAverage(nbRead, 2); \/\/Moyenne\n  }\n\n  public int <strong>computeAverage<\/strong>(int nbTrials, int nbFirst) {\n    Collections.sort(listOfValues);\n\n    int count1 = 0;\n    int count2 = 0;\n    int sum = 0;\n\n    for (Integer oneValue : listOfValues) {\n      if (count1 &gt;= ((nbTrials\/4) + nbFirst)) {\n        if (count1 &lt; (nbTrials - (nbTrials \/ 4))) {\n          count2++;\n          sum += oneValue;\n        }\n      }\n      count1++;\n    }\n\n    return sum \/ count2;\n  }\n\n  public static void <strong>main<\/strong>(String[] args) throws InterruptedException {\n    LightReadLeds lRB = \n                  new LightReadLeds(RaspiPin.GPIO_02, RaspiPin.GPIO_01\n                                    RaspiPin.GPIO_03);\n    for (int i = 0; i &lt; 20; i++) {\n      int level = lRB.getValue(10); \/\/10 lectures\n      System.out.println(\"Value: \" + level);\n\n      lRB.ledsOnOff(level, 600);\n      Thread.sleep(100);\n    }\n  }\n}\n<\/pre>\n<p>Nous avons d\u00e9fini dans le constructeur de la classe <strong>LightReadLeds<\/strong> la d\u00e9finition des 3 broches correspondants au sch\u00e9ma Fritzing ci-dessus.<\/p>\n<p>Pour les d\u00e9tails des classes du Pi4J, il faudra se r\u00e9f\u00e9rer au livre. Une classe comme\u00a0<strong>GpioPinDigitalMultipurpose\u00a0<\/strong>, par exemple, est \u00e9videmment r\u00e9f\u00e9renc\u00e9 dans l&rsquo;index et ensuite nous retrouverons un ou plusieurs cas d&rsquo;utilisation avec la description et le code Java.<\/p>\n<p>La m\u00e9thode\u00a0<strong>getValue()<\/strong> va nous permettre d&rsquo;obtenir une valeur d&rsquo;intensit\u00e9 de lumi\u00e8re. C&rsquo;est identique au code Python: nous chargeons la capacit\u00e9, nous changeons de direction la broche, et nous calculons le temps de d\u00e9charge. Nous d\u00e9posons le r\u00e9sultat dans la collection\u00a0<strong>listOfValues<\/strong>.<\/p>\n<p>La m\u00e9thode <strong>computeAverage<\/strong><strong>()<\/strong> va nous trier les valeurs pour pouvoir retirer les premi\u00e8res valeurs (nbFirst) et calculer la moyenne.<\/p>\n<p>Le <strong>main()<\/strong> va boucler 20 fois, et la m\u00e9thode\u00a0<strong>ledsOnOff()<\/strong> va allumer une des LEDs suivant la valeur calcul\u00e9e, inverse de l&rsquo;intensit\u00e9.<\/p>\n<h3>Ex\u00e9cuter LightReadLeds sur le Raspberry Pi<\/h3>\n<p>Apr\u00e8s compilation de <strong><span style=\"font-size: 12pt;\">LightReadLeds\u00a0<\/span><\/strong>dans Eclipse, de la m\u00eame mani\u00e8re que d\u00e9crite dans le livre, nous pourrons transf\u00e9rer avec FileZilla le fichier\u00a0<span style=\"font-size: 12pt;\">LightReadLeds<\/span>.class dans \/home\/pi\/java et cr\u00e9er un fichier ex\u00e9cutable <strong>.sh<\/strong> avec <strong>ssh<\/strong> depuis Ubuntu contenant<\/p>\n<p><strong><span style=\"font-size: 12pt;\">java -Dpi4j.linking=dynamic -classpath .:\/opt\/pi4j\/lib\/&rsquo;*&rsquo; LightReadLeds<\/span><\/strong><\/p>\n<p>C&rsquo;est exactement la m\u00eame proc\u00e9dure que pour la classe <strong>LightRead<\/strong> du chapitre 16.<\/p>\nDate de la derni\u00e8re modification: 12 f\u00e9vrier 2019\n","protected":false},"excerpt":{"rendered":"<p>Tr\u00e8s gros travail pour cet article pour le rendre simple et sans avoir vraiment besoin du livre! L&rsquo;id\u00e9e est montrer un petit exemple en Python&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Raspberry Pi 3, Java, Python depuis Linux Ubuntu - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Raspberry Pi 3, Java, Python depuis Linux Ubuntu - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3\" \/>\n<meta property=\"og:description\" content=\"Tr\u00e8s gros travail pour cet article pour le rendre simple et sans avoir vraiment besoin du livre! L&rsquo;id\u00e9e est montrer un petit exemple en Python&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/\" \/>\n<meta property=\"og:site_name\" content=\"Un livre sur Java, Python, Eclipse et le Raspberry Pi 3\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-28T15:48:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-02-12T07:37:30+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb-235x300.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jean-Bernard Boichat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/#website\",\"url\":\"https:\/\/www.boichat.ch\/wpjrsp\/\",\"name\":\"Un livre sur Java, Python, Eclipse et le Raspberry Pi 3\",\"description\":\"Jean-Bernard Boichat - Auteur chez Eyrolles\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.boichat.ch\/wpjrsp\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/#primaryimage\",\"inLanguage\":\"fr-FR\",\"url\":\"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb-235x300.png\",\"contentUrl\":\"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb-235x300.png\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/#webpage\",\"url\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/\",\"name\":\"Raspberry Pi 3, Java, Python depuis Linux Ubuntu - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3\",\"isPartOf\":{\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/#primaryimage\"},\"datePublished\":\"2018-11-28T15:48:13+00:00\",\"dateModified\":\"2019-02-12T07:37:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/#\/schema\/person\/fe6328cc5b74b8a6e8d841285a928751\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.boichat.ch\/wpjrsp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Raspberry Pi 3, Java, Python depuis Linux Ubuntu\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/#\/schema\/person\/fe6328cc5b74b8a6e8d841285a928751\",\"name\":\"Jean-Bernard Boichat\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.boichat.ch\/wpjrsp\/#personlogo\",\"inLanguage\":\"fr-FR\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/862886ce35a52b9d13595e18ac3c3ea5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/862886ce35a52b9d13595e18ac3c3ea5?s=96&d=mm&r=g\",\"caption\":\"Jean-Bernard Boichat\"},\"sameAs\":[\"http:\/\/www.boichat.ch\"],\"url\":\"https:\/\/www.boichat.ch\/wpjrsp\/author\/bjb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Raspberry Pi 3, Java, Python depuis Linux Ubuntu - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/","og_locale":"fr_FR","og_type":"article","og_title":"Raspberry Pi 3, Java, Python depuis Linux Ubuntu - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3","og_description":"Tr\u00e8s gros travail pour cet article pour le rendre simple et sans avoir vraiment besoin du livre! L&rsquo;id\u00e9e est montrer un petit exemple en Python&hellip;","og_url":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/","og_site_name":"Un livre sur Java, Python, Eclipse et le Raspberry Pi 3","article_published_time":"2018-11-28T15:48:13+00:00","article_modified_time":"2019-02-12T07:37:30+00:00","og_image":[{"url":"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb-235x300.png"}],"twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"Jean-Bernard Boichat","Dur\u00e9e de lecture estim\u00e9e":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.boichat.ch\/wpjrsp\/#website","url":"https:\/\/www.boichat.ch\/wpjrsp\/","name":"Un livre sur Java, Python, Eclipse et le Raspberry Pi 3","description":"Jean-Bernard Boichat - Auteur chez Eyrolles","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.boichat.ch\/wpjrsp\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"fr-FR"},{"@type":"ImageObject","@id":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/#primaryimage","inLanguage":"fr-FR","url":"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb-235x300.png","contentUrl":"http:\/\/www.boichat.ch\/wpjrsp\/wp-content\/uploads\/2018\/12\/lightleds_bb-235x300.png"},{"@type":"WebPage","@id":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/#webpage","url":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/","name":"Raspberry Pi 3, Java, Python depuis Linux Ubuntu - Un livre sur Java, Python, Eclipse et le Raspberry Pi 3","isPartOf":{"@id":"https:\/\/www.boichat.ch\/wpjrsp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/#primaryimage"},"datePublished":"2018-11-28T15:48:13+00:00","dateModified":"2019-02-12T07:37:30+00:00","author":{"@id":"https:\/\/www.boichat.ch\/wpjrsp\/#\/schema\/person\/fe6328cc5b74b8a6e8d841285a928751"},"breadcrumb":{"@id":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.boichat.ch\/wpjrsp\/2018\/11\/28\/travail-depuis-ubuntu-vs-windows\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.boichat.ch\/wpjrsp\/"},{"@type":"ListItem","position":2,"name":"Raspberry Pi 3, Java, Python depuis Linux Ubuntu"}]},{"@type":"Person","@id":"https:\/\/www.boichat.ch\/wpjrsp\/#\/schema\/person\/fe6328cc5b74b8a6e8d841285a928751","name":"Jean-Bernard Boichat","image":{"@type":"ImageObject","@id":"https:\/\/www.boichat.ch\/wpjrsp\/#personlogo","inLanguage":"fr-FR","url":"https:\/\/secure.gravatar.com\/avatar\/862886ce35a52b9d13595e18ac3c3ea5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/862886ce35a52b9d13595e18ac3c3ea5?s=96&d=mm&r=g","caption":"Jean-Bernard Boichat"},"sameAs":["http:\/\/www.boichat.ch"],"url":"https:\/\/www.boichat.ch\/wpjrsp\/author\/bjb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/posts\/407"}],"collection":[{"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/comments?post=407"}],"version-history":[{"count":0,"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/posts\/407\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/media?parent=407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/categories?post=407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boichat.ch\/wpjrsp\/wp-json\/wp\/v2\/tags?post=407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}