{"id":502,"date":"2014-03-23T21:43:24","date_gmt":"2014-03-23T20:43:24","guid":{"rendered":"https:\/\/www.fanjoe.be\/?p=502"},"modified":"2014-06-16T22:18:25","modified_gmt":"2014-06-16T20:18:25","slug":"installation-de-la-sonde-ds18b20","status":"publish","type":"post","link":"https:\/\/www.fanjoe.be\/?p=502","title":{"rendered":"Lecture de la sonde DS18B20 sur iPhone"},"content":{"rendered":"<p>\u00c7a y est, j&rsquo;ai re\u00e7u la sonde il y a quelques jours par la poste et elle est maintenant install\u00e9e.<\/p>\n<p>J&rsquo;avais expliqu\u00e9 dans <a title=\"Sonde DS18B20\" href=\"https:\/\/www.fanjoe.be\/?p=359\" target=\"_blank\">ce billet<\/a> comment afficher la temp\u00e9rature sur une page web.<\/p>\n<p>Avec quelques astuces compl\u00e9mentaires, voici comment j&rsquo;ai transform\u00e9 cette page en app pour iPhone.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Transformer une page web en app<\/strong><\/span><\/p>\n<p>C&rsquo;est tr\u00e8s simple. Il suffit d&rsquo;ajouter une ligne dans le header de la page :<\/p>\n<pre>&lt;meta name=\"apple-mobile-web-app-capable\" content=\"yes\"&gt;\r\n&lt;meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\"&gt;\r\n&lt;link rel=\"apple-touch-icon\" href=\"favicon.ico\" \/&gt;<\/pre>\n<p>La premi\u00e8re ligne va permettre de cr\u00e9er une web app autonome sur un p\u00e9riph\u00e9rique iOS.<\/p>\n<p>La seconde va configurer la couleur le la barre de menu en noir.<\/p>\n<p>La troisi\u00e8me va donner le chemin vers l&rsquo;ic\u00f4ne \u00e0 placer sur l&rsquo;\u00e9cran d&rsquo;accueil.<br \/>\nDans notre cas, le dossier ou se trouve la page qui affiche la temp\u00e9rature.<br \/>\nL\u2019ic\u00f4ne sera une image JPG ou PNG carr\u00e9e. iOS se chargera d&rsquo;arrondir les coins.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Prot\u00e9ger la page par un mot de passe sous Nginx<\/strong><\/span><\/p>\n<p>Il faut tout d&rsquo;abord cr\u00e9er un fichier contenant le couple login\/mot de passe crypt\u00e9.<br \/>\nOn va le placer \u00e0 la racine du dossier \u00e0 prot\u00e9ger.<\/p>\n<p>On va le cr\u00e9er avec la commande <strong>htpasswd<\/strong> :<\/p>\n<pre>sudo htpasswd -c \/var\/www\/<strong>&lt;chemin vers le dossier&gt;<\/strong>\/.htpasswd <strong>MonLogin<\/strong>\r\nNew password:\r\nRe-type new password:\r\nAdding password for user <strong>MonLogin<\/strong><\/pre>\n<p>Avec -c pour cr\u00e9er un fichier. Sans lui, le couple log\/pass sera ajout\u00e9 au fichier existant.<\/p>\n<p>Ensuite, il suffit d&rsquo;ajouter ce code \u00e0 la configuration de Nginx :<\/p>\n<pre>location \/ {\r\nauth_basic \"Administrator Login\";\r\nauth_basic_user_file \/var\/www\/<strong>&lt;chemin vers le dossier&gt;<\/strong>\/.htpasswd;\r\n}<\/pre>\n<p><span style=\"text-decoration: underline;\"><strong>Installation de l&rsquo;ic\u00f4ne sur la page d&rsquo;accueil :<\/strong><\/span><\/p>\n<p>Dans Safari, entrez l&rsquo;adresse sous forme :<\/p>\n<pre>http:\/\/login:motdepasse@www.nomdedomaine.tld\/&lt;chemin vers le dossier&gt;\/pagetemperature.php<\/pre>\n<p>Safari va peut-\u00eatre vous signaler un phishing. Ignorez-le.<\/p>\n<p>Suivez ensuite le pas-\u00e0-pas en images ci-dessous.<\/p>\n<div class=\"tiled-gallery type-rectangular tiled-gallery-unresized\" data-original-width=\"980\" data-carousel-extra='null' itemscope itemtype=\"http:\/\/schema.org\/ImageGallery\" > <div class=\"gallery-row\" style=\"width: 980px; height: 488px;\" data-original-width=\"980\" data-original-height=\"488\" > <div class=\"gallery-group images-1\" style=\"width: 327px; height: 488px;\" data-original-width=\"327\" data-original-height=\"488\" > <div class=\"tiled-gallery-item tiled-gallery-item-large\" itemprop=\"associatedMedia\" itemscope itemtype=\"http:\/\/schema.org\/ImageObject\"> <a href=\"https:\/\/i0.wp.com\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-01.png?ssl=1\" border=\"0\" itemprop=\"url\"> <meta itemprop=\"width\" content=\"323\"> <meta itemprop=\"height\" content=\"484\"> <img decoding=\"async\" class=\"\" data-attachment-id=\"520\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-01.png\" data-orig-size=\"640,960\" data-comments-opened=\"1\" data-image-title=\"Install-DS18B20-01\" data-image-description=\"\" data-medium-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-01-200x300.png\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-01.png\" src=\"https:\/\/i0.wp.com\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-01.png?w=323&#038;h=484&#038;ssl=1\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-01.png 640w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-01-200x300.png 200w\" width=\"323\" height=\"484\" loading=\"lazy\" data-original-width=\"323\" data-original-height=\"484\" itemprop=\"http:\/\/schema.org\/image\" title=\"Install-DS18B20-01\" alt=\"Hameconnage\" style=\"width: 323px; height: 484px;\" \/> <\/a> <div class=\"tiled-gallery-caption\" itemprop=\"caption description\"> Hameconnage <\/div> <\/div> <\/div> <!-- close group --> <div class=\"gallery-group images-1\" style=\"width: 327px; height: 488px;\" data-original-width=\"327\" data-original-height=\"488\" > <div class=\"tiled-gallery-item tiled-gallery-item-large\" itemprop=\"associatedMedia\" itemscope itemtype=\"http:\/\/schema.org\/ImageObject\"> <a href=\"https:\/\/i0.wp.com\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-02.png?ssl=1\" border=\"0\" itemprop=\"url\"> <meta itemprop=\"width\" content=\"323\"> <meta itemprop=\"height\" content=\"484\"> <img decoding=\"async\" class=\"\" data-attachment-id=\"521\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-02.png\" data-orig-size=\"640,960\" data-comments-opened=\"1\" data-image-title=\"Install-DS18B20-02\" data-image-description=\"\" data-medium-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-02-200x300.png\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-02.png\" src=\"https:\/\/i0.wp.com\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-02.png?w=323&#038;h=484&#038;ssl=1\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-02.png 640w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-02-200x300.png 200w\" width=\"323\" height=\"484\" loading=\"lazy\" data-original-width=\"323\" data-original-height=\"484\" itemprop=\"http:\/\/schema.org\/image\" title=\"Install-DS18B20-02\" alt=\"Ajouter \u00e0 la page d&#039;accueil\" style=\"width: 323px; height: 484px;\" \/> <\/a> <div class=\"tiled-gallery-caption\" itemprop=\"caption description\"> Ajouter \u00e0 la page d&rsquo;accueil <\/div> <\/div> <\/div> <!-- close group --> <div class=\"gallery-group images-1\" style=\"width: 326px; height: 488px;\" data-original-width=\"326\" data-original-height=\"488\" > <div class=\"tiled-gallery-item tiled-gallery-item-large\" itemprop=\"associatedMedia\" itemscope itemtype=\"http:\/\/schema.org\/ImageObject\"> <a href=\"https:\/\/i0.wp.com\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-03.png?ssl=1\" border=\"0\" itemprop=\"url\"> <meta itemprop=\"width\" content=\"322\"> <meta itemprop=\"height\" content=\"484\"> <img decoding=\"async\" class=\"\" data-attachment-id=\"522\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-03.png\" data-orig-size=\"640,960\" data-comments-opened=\"1\" data-image-title=\"Install-DS18B20-03\" data-image-description=\"\" data-medium-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-03-200x300.png\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-03.png\" src=\"https:\/\/i0.wp.com\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-03.png?w=322&#038;h=484&#038;ssl=1\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-03.png 640w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-03-200x300.png 200w\" width=\"322\" height=\"484\" loading=\"lazy\" data-original-width=\"322\" data-original-height=\"484\" itemprop=\"http:\/\/schema.org\/image\" title=\"Install-DS18B20-03\" alt=\"Donner un nom \u00e0 l&#039;ic\u00f4ne\" style=\"width: 322px; height: 484px;\" \/> <\/a> <div class=\"tiled-gallery-caption\" itemprop=\"caption description\"> Donner un nom \u00e0 l&rsquo;ic\u00f4ne <\/div> <\/div> <\/div> <!-- close group --> <\/div> <!-- close row --> <div class=\"gallery-row\" style=\"width: 980px; height: 733px;\" data-original-width=\"980\" data-original-height=\"733\" > <div class=\"gallery-group images-1\" style=\"width: 490px; height: 733px;\" data-original-width=\"490\" data-original-height=\"733\" > <div class=\"tiled-gallery-item tiled-gallery-item-large\" itemprop=\"associatedMedia\" itemscope itemtype=\"http:\/\/schema.org\/ImageObject\"> <a href=\"https:\/\/i0.wp.com\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-04.png?ssl=1\" border=\"0\" itemprop=\"url\"> <meta itemprop=\"width\" content=\"486\"> <meta itemprop=\"height\" content=\"729\"> <img decoding=\"async\" class=\"\" data-attachment-id=\"523\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-04.png\" data-orig-size=\"640,960\" data-comments-opened=\"1\" data-image-title=\"Install-DS18B20-04\" data-image-description=\"\" data-medium-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-04-200x300.png\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-04.png\" src=\"https:\/\/i0.wp.com\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-04.png?w=486&#038;h=729&#038;ssl=1\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-04.png 640w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-04-200x300.png 200w\" width=\"486\" height=\"729\" loading=\"lazy\" data-original-width=\"486\" data-original-height=\"729\" itemprop=\"http:\/\/schema.org\/image\" title=\"Install-DS18B20-04\" alt=\"L&#039;ic\u00f4ne sur la page d&#039;accueil\" style=\"width: 486px; height: 729px;\" \/> <\/a> <div class=\"tiled-gallery-caption\" itemprop=\"caption description\"> L&rsquo;ic\u00f4ne sur la page d&rsquo;accueil <\/div> <\/div> <\/div> <!-- close group --> <div class=\"gallery-group images-1\" style=\"width: 490px; height: 733px;\" data-original-width=\"490\" data-original-height=\"733\" > <div class=\"tiled-gallery-item tiled-gallery-item-large\" itemprop=\"associatedMedia\" itemscope itemtype=\"http:\/\/schema.org\/ImageObject\"> <a href=\"https:\/\/i0.wp.com\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-05.png?ssl=1\" border=\"0\" itemprop=\"url\"> <meta itemprop=\"width\" content=\"486\"> <meta itemprop=\"height\" content=\"729\"> <img decoding=\"async\" class=\"\" data-attachment-id=\"524\" data-orig-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-05.png\" data-orig-size=\"640,960\" data-comments-opened=\"1\" data-image-title=\"Install-DS18B20-05\" data-image-description=\"\" data-medium-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-05-200x300.png\" data-large-file=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-05.png\" src=\"https:\/\/i0.wp.com\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-05.png?w=486&#038;h=729&#038;ssl=1\" srcset=\"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-05.png 640w, https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-05-200x300.png 200w\" width=\"486\" height=\"729\" loading=\"lazy\" data-original-width=\"486\" data-original-height=\"729\" itemprop=\"http:\/\/schema.org\/image\" title=\"Install-DS18B20-05\" alt=\"L&#039;affichage de la Web App\" style=\"width: 486px; height: 729px;\" \/> <\/a> <div class=\"tiled-gallery-caption\" itemprop=\"caption description\"> L&rsquo;affichage de la Web App <\/div> <\/div> <\/div> <!-- close group --> <\/div> <!-- close row --> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00c7a y est, j&rsquo;ai re\u00e7u la sonde il y a quelques jours par la poste et elle est maintenant install\u00e9e.<\/p>\n<p>&#8230;<\/p>\n","protected":false},"author":1,"featured_media":504,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[179,10,3,12],"tags":[32,33,18],"class_list":["post-502","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domotique","category-geek","category-informatique","category-raspberrypi","tag-iphone","tag-password","tag-sonde-ds18b20","end"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.fanjoe.be\/wp-content\/uploads\/2014\/03\/Install-DS18B20-00.jpg","_links":{"self":[{"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/posts\/502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=502"}],"version-history":[{"count":0,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/posts\/502\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=\/wp\/v2\/media\/504"}],"wp:attachment":[{"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fanjoe.be\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}