{"id":2619,"date":"2022-07-27T00:29:33","date_gmt":"2022-07-26T22:29:33","guid":{"rendered":"https:\/\/miniprojets.net\/?p=2619"},"modified":"2022-12-17T17:20:55","modified_gmt":"2022-12-17T16:20:55","slug":"winky-version-2-an-open-source-project-for-linky-meters-with-wi-fi","status":"publish","type":"post","link":"https:\/\/miniprojets.net\/index.php\/en\/2022\/07\/27\/winky-version-2-an-open-source-project-for-linky-meters-with-wi-fi\/","title":{"rendered":"Winky Version 2 &#8211; An Open-Source project for Linky meters with Wi-Fi"},"content":{"rendered":"\n<p>Hello everyone,<\/p>\n\n\n\n<p>Today, I present to you add updates to the Winky project  which will make it 100% autonomous.<\/p>\n\n\n\n<p>For version 1, you had to wait for the super capacitors to be charged before turning on the ESP01 power supply. This presented a problem, especially after a power cut, because the Winky would not power up on its own\u2026.&nbsp;In short, now we will see how to solve this problem.<\/p>\n\n\n\n<p>What you also need to know is that only the \u00b5controller\/Power card needs to be modified\/upgraded.<\/p>\n\n\n\n<p>The current functional version is V2 for hardware and V5 for firmware<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>0. Introduction<\/strong><\/h2>\n\n\n\n<p>First of all, this project is licensed under CC BY-NC-SA 4.0<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>And is supported by &nbsp;CNRS\/UGA\/G-INP \u2013 G2ELAB within the framework of IDEX EcoSesa and the future observatory for energy transition<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/07\/image-45.png\" alt=\"\" \/><figcaption>You can also retrieve all the files to recreate your WinKy (Code, PCB and STL) on the Gricad gitlab at the following address:<br><a href=\"https:\/\/gricad-gitlab.univ-grenoble-alpes.fr\/ferrarij\/winky\">https:\/\/gricad-gitlab.univ-grenoble-alpes.fr\/ferrarij\/winky<\/a><br>If you want to actively participate in the improvement of the project and also participate as a candidate in the experiments of the laboratory, do not hesitate to contact us either through the GitLab or at the email address&nbsp;<a href=\"mailto:jerome.ferrari@g2elab.grenoble-inp.fr\">jerome.ferrari@g2elab.grenoble- inp.fr<\/a>.<\/figcaption><\/figure>\n\n\n\n<p>Now that the introductions are done again, we can get to the heart of the matter.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-fonctionnalites-attendues\">I. Expected features<\/h2>\n\n\n\n<p>Currently, the linky data accessible via the Enedis portal only gives data from the previous day&#8217;s load curves with a time step of 30 min.&nbsp;However, we can use the TIC (Tele Information Client) socket of the Linky to obtain them in real time.&nbsp;This is why we have chosen to build a system that can transcribe this data and send it to a personal server and thus allow users or organizations to better manage their consumption.<\/p>\n\n\n\n<p>The expected functions for this gateway are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>It should be able to start up independently from the Linky&#8217;s ICT socket<\/li><li>It should be able to retrieve the information transmitted by the&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.enedis.fr\/linky-compteur-communicant\" target=\"_blank\"><strong>Linky<\/strong><\/a><em>&nbsp;meter on the Customer Tele-Information<\/em>&nbsp;or&nbsp;<strong>TIC<\/strong>&nbsp;output<\/li><li>It should be able to send this information via the Wi-Fi network to an application server, to which the user can connect and view his data.<\/li><li>Be 100% autonomous and maintenance-free, except for reconfiguration of the Wi-Fi or the MQTT broker<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ii-linky-et-tic\">II.&nbsp;Linky and TIC<\/h2>\n\n\n\n<p>In this paragraph, I advise you to read the explanatory section that we devoted in the article <a href=\"https:\/\/miniprojets.net\/index.php\/2021\/07\/28\/loky-open-source-projet-pour-linky\/embed\/#?secret=bbiQn4wahB\">https:\/\/miniprojets.net\/index.php\/2021\/07\/28\/loky-open-source-projet-pour-linky\/embed\/#?secret=bbiQn4wahB<\/a><\/p>\n\n\n\n<p>LoKy \u2013 Open-source project for Linky with LoRaWAN<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"iii-logiciels-et-composants-utilises-pour-concevoir-le-winky-v2\">III.&nbsp;Software and components used to design the WinKy V2<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"a-outils-et-logiciels\">a.&nbsp;Tools and Software<\/h3>\n\n\n\n<p>In this project, the following software and tools were used:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>KiCad:&nbsp;&nbsp;<a href=\"https:\/\/kicad-pcb.org\/download\/\">v5.1.5<\/a><\/li><li>Arduino:&nbsp;&nbsp;<a href=\"https:\/\/www.arduino.cc\/en\/Main\/Software\">IDE<\/a><\/li><li>Mosquito<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"b-composants\">b.&nbsp;Components<\/h3>\n\n\n\n<p>Here are the main components of&nbsp;<strong>WinKy<\/strong>:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>ESP01S<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"536\" height=\"403\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/ESP01-1.png\" alt=\"\"><\/td><\/tr><tr><td>Optocoupler<em>&nbsp;PC814<\/em><\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"522\" height=\"476\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/03\/pc814-e1615308772967.jpg\" alt=\"\"><\/td><\/tr><tr><td>2 x 5.5V 0.5F super capacitors<\/td><td><img decoding=\"async\" src=\"https:\/\/www.mouser.fr\/images\/avx\/lrg\/SCM_Series_DSL.jpg\"><\/td><\/tr><tr><td>1 x  033CC0 3.3v regulator<\/td><td><img decoding=\"async\" src=\"https:\/\/www.mouser.fr\/images\/mouserelectronics\/images\/DPAK_3_t.jpg\" alt=\"STMicroelectronics L4931ABDT35TR\"><\/td><\/tr><tr><td>1 x MCP1702-4002E Voltage controller<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"404\" height=\"453\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image.png\" alt=\"\"><\/td><\/tr><tr><td>1  x &nbsp;<em>KA75330<\/em>&nbsp;3.3V Voltage controller<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"297\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image.png\" alt=\"\"><\/td><\/tr><tr><td>4 x 1n4148 diodes or equivalents<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"376\" height=\"284\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-1.png\" alt=\"\"><\/td><\/tr><tr><td>1 x  0.1\u00b5f capacitor<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"431\" height=\"376\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-2.png\" alt=\"\"><\/td><\/tr><tr><td>1 x  3.3\u00b5f electrolytic capacitor<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"375\" height=\"367\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-3.png\" alt=\"\"><\/td><\/tr><tr><td>1 x  3.3kohms resistor<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"234\" height=\"229\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-5.png\" alt=\"\"><\/td><\/tr><tr><td>1 x 100kohms resistor<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"234\" height=\"229\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-5.png\" alt=\"\"><\/td><\/tr><tr><td>1 x 1.2kohms resistor<\/td><td><img loading=\"lazy\" decoding=\"async\" width=\"234\" height=\"229\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-5.png\" alt=\"\"><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u2026you can find all these components in the schematic provided in the WinKy&#8217; project&#8217;s GitLab repository.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">IV.&nbsp;Prototyping of the different electronic stages<\/h2>\n\n\n\n<p>In this part, I follow essentially the same steps as seen in the previous version but I will focus on the energy optimization issue. <a href=\"https:\/\/miniprojets.net\/index.php\/2021\/09\/08\/winky-open-source-projet-pour-linky-avec-wifi\/embed\/#?secret=b3lsDXT1GE\">https:\/\/miniprojets.net\/index.php\/2021\/09\/08\/winky-open-source-projet-pour-linky-avec-wifi\/embed\/#?secret=b3lsDXT1GE<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"a-le-decodage-d-infotic\">a.&nbsp;The decoding of InfoTIC<\/h2>\n\n\n\n<p>With all the specifications given by the datasheet, we must demodulate the ASK signals from InfoTIC.&nbsp;The most effective way is to take advantage of an optocoupler:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/03\/Decodeur-1024x341.jpg\" alt=\"\" class=\"wp-image-1777\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/03\/Decodeur-1024x341.jpg 1024w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/03\/Decodeur-300x100.jpg 300w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/03\/Decodeur-768x255.jpg 768w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/03\/Decodeur.jpg 1251w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>This schematic is familiar to anyone who has ever worked with&nbsp;<strong>TIC<\/strong>&nbsp;whether it is the Linky or the previous generation.&nbsp;For people unfamiliar with this means of demodulation, you can read more about it in this&nbsp;<a rel=\"noreferrer noopener\" href=\"http:\/\/hallard.me\/demystifier-la-teleinfo\/\" target=\"_blank\">article<\/a>&nbsp;by Charles.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"b-le-stockage-de-l-energie-avec-alimtic\">b.&nbsp;Energy storage with AlimTIC<\/h2>\n\n\n\n<p>This part is based on the work done on the Loky.&nbsp;However, Wi-Fi consumes more more energy as compared to Lora for transmission, it will therefore be necessary to add a super capacitor and play on the ESP01&#8217;s energy management strategy.<\/p>\n\n\n\n<p>I also decoupled the power part from the teleinfo part at the power supply level because the ESP01 does not support more than 3.3V at the input.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"c-modification-de-l-esp01\">c.&nbsp;Modification of the ESP01<\/h2>\n\n\n\n<p>For this part, I got a lot of help from the following sites:<\/p>\n\n\n\n<p><a href=\"http:\/\/framboiseaupotager.blogspot.com\/2019\/09\/tout-sur-le-deep-sleep-des-esp8266.html\">http:\/\/frambooiseaupotager.blogspot.com\/2019\/09\/tout-sur-le-deep-sleep-des-esp8266.html<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.instructables.com\/Enable-DeepSleep-on-an-ESP8266-01\/\">https:\/\/www.instructables.com\/Enable-DeepSleep-on-an-ESP8266-01\/<\/a><\/p>\n\n\n\n<p>To sum things up, the big concern the ESP01&#8217;s consumption in the different stages of operation:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>When it wakes up the first time, the Wi-Fi is directly active and consumes a lot of energy.<\/li><li>When the Wi-Fi is transmitting. The goal here is to put it in DeepSleep mode when the data transmission ends.<\/li><li>The LED indicating its status lights up as soon as it starts up, consumes energy for nothing and in addition brought me a lot of problems ^^.<\/li><\/ul>\n\n\n\n<p>Here is a table showing the consumption in the different modes of the ESP01 extracted from the site&nbsp;<a href=\"http:\/\/framboiseaupotager.blogspot.com\/2019\/09\/tout-sur-le-deep-sleep-des-esp8266.html\">http:\/\/frambooiseaupotager.blogspot.com\/2019\/09\/tout-sur-le-deep-sleep-des-esp8266.html<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"575\" height=\"236\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-2.png\" alt=\"\" class=\"wp-image-2391\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-2.png 575w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-2-300x123.png 300w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/figure>\n\n\n\n<p>To put the device in DeepSleep, you must modify the ESP01 in order to take advantage of this function.&nbsp;This is the trickiest part because you have to solder pin 8 (XPD_DCDC) to the reset pin because this pin goes low when the ESP8266 goes into WakeUp mode.<\/p>\n\n\n\n<p>So I suggest you follow this Instructables page:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.instructables.com\/Enable-DeepSleep-on-an-ESP8266-01\/\">https:\/\/www.instructables.com\/Enable-DeepSleep-on-an-ESP8266-01\/<\/a><\/p>\n\n\n\n<p>And here is another site with more detailed explanations.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.tech-spy.co.uk\/2019\/04\/enable-deep-sleep-esp-01\/embed\/#?secret=OINAluCDb2\">https:\/\/www.tech-spy.co.uk\/2019\/04\/enable-deep-sleep-esp-01\/embed\/#?secret=OINAluCDb2<\/a><\/p>\n\n\n\n<p>For me, the modification to allow deep sleep looks like this.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"272\" height=\"384\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-3.png\" alt=\"\" class=\"wp-image-2395\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-3.png 272w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-3-213x300.png 213w\" sizes=\"auto, (max-width: 272px) 100vw, 272px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"431\" height=\"312\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-4.png\" alt=\"\" class=\"wp-image-2396\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-4.png 431w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-4-300x217.png 300w\" sizes=\"auto, (max-width: 431px) 100vw, 431px\" \/><\/figure>\n\n\n\n<p>I also removed the LED<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"402\" height=\"489\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-6.png\" alt=\"\" class=\"wp-image-2476\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-6.png 402w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-6-247x300.png 247w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/figure>\n\n\n\n<p>Now that everything is ok, we can move on to the data recovery part.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"d-surveillance-et-gestion-de-l-energie\">d.&nbsp;Energy monitoring and management<\/h2>\n\n\n\n<p>Not being a trained electronics engineer, this part was the one that posed the most problem to solve because it was necessary to find a balance between sending time, discharging time and cutting the power supply of the \u00b5controller.<\/p>\n\n\n\n<p>For this, I had to make modifications on both the hardware and the software.<\/p>\n\n\n\n<p>At the software level, my solution was based on the recommendations found here:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.bakke.online\/index.php\/2017\/05\/21\/reducing-wifi-power-consumption-on-esp8266-part-1\/\">https:\/\/www.bakke.online\/index.php\/2017\/05\/21\/reducing-wifi-power-consumption-on-esp8266-part-1\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.bakke.online\/index.php\/2017\/05\/21\/reducing-wifi-power-consumption-on-esp8266-part-2\/\">https:\/\/www.bakke.online\/index.php\/2017\/05\/21\/reducing-wifi-power-consumption-on-esp8266-part-2\/<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.bakke.online\/index.php\/2017\/05\/21\/reducing-wifi-power-consumption-on-esp8266-part-3\/\">https:\/\/www.bakke.online\/index.php\/2017\/05\/21\/reducing-wifi-power-consumption-on-esp8266-part-3\/<\/a><\/p>\n\n\n\n<p>and for the Hardware part, I used some information from this forum:<\/p>\n\n\n\n<p><a href=\"https:\/\/electronics.stackexchange.com\/questions\/568018\/pullup-resistor-value-between-ka75330-and-reset-pin-of-esp-01-if-vcc-3-3v-or-l\">https:\/\/electronics.stackexchange.com\/questions\/568018\/pullup-resistor-value-between-ka75330-and-reset-pin-of-esp-01-if-vcc-3-3v-or-l<\/a><\/p>\n\n\n\n<p>To sum up, the bulk of the work was to correctly configure the voltage control part and connect everything to the Enable pin of the ESP01 so that it only triggers its first wakeup when there is enough energy in the super capacitors.<\/p>\n\n\n\n<p><em>For this, I used a KA75330<\/em>&nbsp;voltage controller&nbsp;coupled with a reset circuit assembly in order to give a delay before authorizing the Enable pin of the circuit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"e-tests\">e.&nbsp;Testing<\/h2>\n\n\n\n<p>To test if the modifications made to the Winky (V2) give the desired results, we will observe the different phases of life: (1- start-up, 2- in normal operation,3- simulate a power cut, 4- simulate power being restored)<\/p>\n\n\n\n<p>On the different oscilloscope captures, the yellow curve shows the voltage of the supercaps, the blue curve shows the signal on the Enable pin<\/p>\n\n\n\n<p><strong>First start<\/strong><\/p>\n\n\n\n<p>We can see that after 70s the super capacitors have accumulated enough energy to allow the \u00b5controller to start up and the program will execute the following instructions<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Wake<\/li><li>turn off wifi<\/li><li>Fall asleep for 30 seconds<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135152-1024x768.jpg\" alt=\"\" class=\"wp-image-2488\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135152-1024x768.jpg 1024w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135152-300x225.jpg 300w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135152-768x576.jpg 768w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135152-1536x1152.jpg 1536w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135152-2048x1536.jpg 2048w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135152-160x120.jpg 160w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After 30 seconds, the program will do the following steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Wake up and turn wifi back on<\/li><li>Read tick values<\/li><li>Send data to MQTT broker<\/li><li>Go back to sleep for 30 seconds and go back for a cycle<\/li><\/ul>\n\n\n\n<p>It takes about 12 seconds<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135502-1024x768.jpg\" alt=\"\" class=\"wp-image-2489\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135502-1024x768.jpg 1024w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135502-300x225.jpg 300w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135502-768x576.jpg 768w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135502-1536x1152.jpg 1536w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135502-2048x1536.jpg 2048w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_135502-160x120.jpg 160w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Normal life stage<\/strong><\/p>\n\n\n\n<p>The program will loop through the same steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Wake<\/li><li>turn off wifi<\/li><li>Fall asleep for 30 seconds<\/li><li>Wake up and turn wifi back on<\/li><li>Read tick values<\/li><li>Send data to MQTT broker<\/li><li>Go back to sleep for 30 seconds and go back for a cycle<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134818-1024x768.jpg\" alt=\"\" class=\"wp-image-2490\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134818-1024x768.jpg 1024w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134818-300x225.jpg 300w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134818-768x576.jpg 768w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134818-1536x1152.jpg 1536w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134818-2048x1536.jpg 2048w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134818-160x120.jpg 160w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Life phase when a power outage occurs<\/strong><\/p>\n\n\n\n<p>When a power outage occurs the program will continue to try to live normally, however, the voltage monitoring circuit will block the Enable pin and disable the \u00b5controller.<\/p>\n\n\n\n<p>The rebounds that we observe are due to the effect of the supercaps which, as soon as they are no longer solicited, \u201cregain\u201d voltage and therefore re-authorize the Enable pin and so on.&nbsp;This phenomenon lasts only 15 seconds before stopping.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134359-1024x768.jpg\" alt=\"\" class=\"wp-image-2491\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134359-1024x768.jpg 1024w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134359-300x225.jpg 300w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134359-768x576.jpg 768w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134359-1536x1152.jpg 1536w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134359-2048x1536.jpg 2048w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134359-160x120.jpg 160w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Power restoration phase<\/strong><\/p>\n\n\n\n<p>In this phase, we can see that the supercapacitors, thanks to the voltage control circuit, have not lost any energy (or very little because the assembly at this time only consumes 1\u00b5A) and only when restarting of the current the assembly returns normally.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134615-1024x768.jpg\" alt=\"\" class=\"wp-image-2492\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134615-1024x768.jpg 1024w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134615-300x225.jpg 300w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134615-768x576.jpg 768w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134615-1536x1152.jpg 1536w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134615-2048x1536.jpg 2048w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/20220207_134615-160x120.jpg 160w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The next tests will aim to reduce the time between each sending of data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"f-le-schematique-final-retenu\">f.&nbsp;The final diagram selected<\/h2>\n\n\n\n<p>In the end, the functional assembly is as depicted below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"724\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-7-1024x724.png\" alt=\"\" class=\"wp-image-2495\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-7-1024x724.png 1024w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-7-300x212.png 300w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-7-768x543.png 768w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-7-1536x1086.png 1536w, https:\/\/miniprojets.net\/wp-content\/uploads\/2022\/02\/image-7-2048x1448.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now that everything is ok, we can move on to the data recovery part.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"v-serveur-mqtt-jeedom\">V. MQTT Server + JEEDOM<\/h2>\n\n\n\n<p>For this part, if you have already read my previous articles, you become familiar with this part.<\/p>\n\n\n\n<p>Come on a little reminder?&nbsp;For this, I invite you first to configure your raspberry or others with the following links:<\/p>\n\n\n\n<p>Installation of Jeedom \u2014 &gt; See my previous article&nbsp;<a href=\"https:\/\/miniprojets.net\/index.php\/2019\/05\/13\/jeedom-ou-comment-domotiser-sa-maison-en-quelques-clics\/\">https:\/\/miniprojets.net\/index.php\/2019\/05\/13\/jeedom-ou-comment-domotiser-sa-maison-en-quelques-clics\/<\/a><\/p>\n\n\n\n<p>Installation of Mosquitto -&gt; I recommend the following site&nbsp;<a href=\"https:\/\/projetsdiy.fr\/jeedom-mqtt-objets-connectes-domotique-diy\/\">https:\/\/projetsdiy.fr\/jeedom-mqtt-objets-connectes-domotique-diy\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"vi-firmware-de-loky\">VI.&nbsp;LoKy&nbsp;Firmware<\/h2>\n\n\n\n<p>Before starting to program the ESP01, a small interface must be created or purchased.<\/p>\n\n\n\n<p>I offer you this article which allows you to choose yours<\/p>\n\n\n\n<p><a href=\"https:\/\/projetsdiy.fr\/esp01-quel-programmer-choisir-modification-activer-flash-mode\/\">https:\/\/projetsdiy.fr\/esp01-quel-programmer-choisir-modification-activer-flash-mode\/<\/a><\/p>\n\n\n\n<p>Or make your own if you already have a Mini-USB to TTL FT232RL adapter that we use to program the LoKy<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"798\" height=\"664\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-5.png\" alt=\"\" class=\"wp-image-2397\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-5.png 798w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-5-300x250.png 300w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-5-768x639.png 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><\/figure>\n\n\n\n<p>For this you need:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A 6\u00d710 hole plate<\/li><li>A female header of 1\u00d76 pins<\/li><li>A 2x4pin female header<\/li><li>A push button<\/li><\/ul>\n\n\n\n<p>Then you have to connect the elements as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"713\" height=\"625\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-6.png\" alt=\"\" class=\"wp-image-2398\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-6.png 713w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-6-300x263.png 300w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><figcaption>The principle diagram<\/figcaption><\/figure>\n\n\n\n<p>And what it actually looks like\u2026.&nbsp;Good\u2026.&nbsp;you can&#8217;t blame me for the cable monochrome ^^.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"305\" height=\"213\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-7.png\" alt=\"\" class=\"wp-image-2399\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-7.png 305w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-7-300x210.png 300w\" sizes=\"auto, (max-width: 305px) 100vw, 305px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"689\" height=\"583\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-8.png\" alt=\"\" class=\"wp-image-2400\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-8.png 689w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-8-300x254.png 300w\" sizes=\"auto, (max-width: 689px) 100vw, 689px\" \/><\/figure>\n\n\n\n<p>Now all that remains is to program it.<\/p>\n\n\n\n<p>For this, I recommend you  read this article and configure your Arduino IDE.<\/p>\n\n\n\n<p><a href=\"https:\/\/projetsdiy.fr\/esp01-esp01s-debuter-ide-arduino-platformio-quel-module-choisir-reperage-broches\/\">https:\/\/projetsdiy.fr\/esp01-esp01s-debuter-ide-arduino-platformio-quel-module-choisir-reperage-broches\/<\/a><\/p>\n\n\n\n<p>Once done, you can take the program that is on the Winky project repository:<\/p>\n\n\n\n<p><a href=\"https:\/\/gricad-gitlab.univ-grenoble-alpes.fr\/ferrarij\/winky\">https:\/\/gricad-gitlab.univ-grenoble-alpes.fr\/ferrarij\/winky<\/a><\/p>\n\n\n\n<p>Then edit it to read:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The SSID of your wifi network on which it will connect<\/li><li>The password of your wifi network<\/li><li>the IP address of your MQTT server<\/li><\/ul>\n\n\n\n<p>You can also add topics because in the present code, I only put the PAPP as an example<\/p>\n\n\n\n<p>Once all that is done, you can flash it and put it in place.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"vii-mise-en-place-et-mise-en-route-du-winky\">VII.&nbsp;Installation and start-up of the WinKy<\/h2>\n\n\n\n<p>Attention, now that your Winky is programmed, you can set it up.<\/p>\n\n\n\n<p>Now plug your WinKy into the Linky&#8217;s TIC socket.<\/p>\n\n\n\n<p>Normally we are done for the installation part.<\/p>\n\n\n\n<p>However, before closing the cover of your Linky, I advise you to wait because there may be adjustments to be made to the duration of DeepSleep.&nbsp;(Default set to 60 seconds).<\/p>\n\n\n\n<p>It will be necessary to modify the line of code ESP.deepSleep(60000000);&nbsp;if you need to extend the cooldown of your Supercapa.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"viii-verification-du-bon-fonctionnement-de-votre-winky\">VIII.&nbsp;Checking that your WinKy is working properly<\/h2>\n\n\n\n<p>Normally, if everything works correctly, you will see your WinKy appear on your MQTT interface of your Jeedom<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"121\" height=\"163\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-9.png\" alt=\"\" class=\"wp-image-2402\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"177\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-10-1024x177.png\" alt=\"\" class=\"wp-image-2403\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-10-1024x177.png 1024w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-10-300x52.png 300w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-10-768x133.png 768w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-10-1536x266.png 1536w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-10.png 1599w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Check the Log box to see how often your counter data is uploaded.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"437\" src=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-11.png\" alt=\"\" class=\"wp-image-2404\" srcset=\"https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-11.png 624w, https:\/\/miniprojets.net\/wp-content\/uploads\/2021\/09\/image-11-300x210.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><figcaption>There!&nbsp;You now have access to your Linky data in real time via WiFi.<\/figcaption><\/figure>\n\n\n\n<p>I hope you have learned something and do not hesitate to send us your feedback as well as the problems you encounter, we appreciate your contribution to&nbsp;<strong>WinKy<\/strong>&nbsp;.<\/p>\n\n\n\n<p>And see you soon for new articles and new sensors.<\/p>\n\n\n\n<p>Jerome Ferrari<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello everyone, Today, I present to you add updates to the Winky project which will make it 100% autonomous. For&hellip;<\/p>\n","protected":false},"author":9,"featured_media":2455,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[86],"class_list":["post-2619","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized-en","tag-linky-en"],"_links":{"self":[{"href":"https:\/\/miniprojets.net\/index.php\/wp-json\/wp\/v2\/posts\/2619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/miniprojets.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/miniprojets.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/miniprojets.net\/index.php\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/miniprojets.net\/index.php\/wp-json\/wp\/v2\/comments?post=2619"}],"version-history":[{"count":0,"href":"https:\/\/miniprojets.net\/index.php\/wp-json\/wp\/v2\/posts\/2619\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/miniprojets.net\/index.php\/wp-json\/wp\/v2\/media\/2455"}],"wp:attachment":[{"href":"https:\/\/miniprojets.net\/index.php\/wp-json\/wp\/v2\/media?parent=2619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/miniprojets.net\/index.php\/wp-json\/wp\/v2\/categories?post=2619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/miniprojets.net\/index.php\/wp-json\/wp\/v2\/tags?post=2619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}