<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Arduino Archives - OVHcloud Blog</title>
	<atom:link href="https://blog.ovhcloud.com/tag/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.ovhcloud.com/tag/arduino/</link>
	<description>Innovation for Freedom</description>
	<lastBuildDate>Thu, 24 Oct 2019 13:15:45 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.ovhcloud.com/wp-content/uploads/2019/07/cropped-cropped-nouveau-logo-ovh-rebranding-32x32.gif</url>
	<title>Arduino Archives - OVHcloud Blog</title>
	<link>https://blog.ovhcloud.com/tag/arduino/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>IOT: Pushing data to OVHcloud metrics timeseries from Arduino</title>
		<link>https://blog.ovhcloud.com/iot-pushing-data-to-ovhcloud-metrics-timeseries-from-arduino/</link>
		
		<dc:creator><![CDATA[Cyrille Meichel]]></dc:creator>
		<pubDate>Thu, 24 Oct 2019 12:56:04 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[IOT]]></category>
		<category><![CDATA[Metrics]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=16087</guid>

					<description><![CDATA[Last spring, I built a wood oven in my garden. I&#8217;ve wanted to have one for years, and I finally decided to make it. To use it, I make a big fire inside for two hours, remove all the embers, and then it&#8217;s ready for cooking. The oven accumulates the heat during the fire and [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fiot-pushing-data-to-ovhcloud-metrics-timeseries-from-arduino%2F&amp;action_name=IOT%3A%20Pushing%20data%20to%20OVHcloud%20metrics%20timeseries%20from%20Arduino&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-image"><figure class="aligncenter"><img fetchpriority="high" decoding="async" width="1024" height="537" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/IMG_0417-1024x537.jpg" alt="From Arduino to OVHcloud Metrics" class="wp-image-16156" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/IMG_0417-1024x537.jpg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/IMG_0417-300x157.jpg 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/IMG_0417-768x403.jpg 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/IMG_0417.jpg 1199w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>Last spring, I built a wood oven in my garden. I&#8217;ve wanted to have one for years, and I finally decided to make it. To use it, I make a big fire inside for two hours, remove all the embers, and then it&#8217;s ready for cooking. The oven accumulates the heat during the fire and then releases it.</p>



<div class="wp-block-image"><figure class="alignright is-resized"><img decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/IMG_20190820_162149.jpg" alt="" class="wp-image-16089" width="252" height="225" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/IMG_20190820_162149.jpg 800w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/IMG_20190820_162149-300x268.jpg 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/IMG_20190820_162149-768x686.jpg 768w" sizes="(max-width: 252px) 100vw, 252px" /></figure></div>



<p>Once the embers are removed, I have to prioritise the dishes I want to cook as the temperature drops:</p>



<ul class="wp-block-list"><li>Pizza: 280°C</li><li>Bread: 250°C</li><li>Rice pudding: 180°C</li><li>Meringues: 100°C</li></ul>



<p>I built a first version of a thermometer with an Arduino, to be able to check the temperature. This thermometer, made of a thermocouple (i.e. a sensor that measures high temperatures), displays the inside temperature on a little LCD screen.</p>



<div class="wp-block-image"><figure class="aligncenter is-resized"><img decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/thermocouple-arduino-1024x324.png" alt="" class="wp-image-16090" width="461" height="145" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/thermocouple-arduino-1024x324.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/thermocouple-arduino-300x95.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/thermocouple-arduino-768x243.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/thermocouple-arduino.png 1159w" sizes="(max-width: 461px) 100vw, 461px" /></figure></div>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/diagram-1024x598.png" alt="" class="wp-image-16092" width="338" height="197" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/diagram-1024x598.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/diagram-300x175.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/diagram-768x449.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/diagram.png 1364w" sizes="auto, (max-width: 338px) 100vw, 338px" /></figure></div>



<p>The next step was to anticipate when to stuff dishes into the oven. Watching the temperature dropping down for hours was not a good idea. I needed the heat diagram of my oven! A heat diagram is just the chart of the temperature over a given period of time. But writing down temperature on a paper every ten minutes&#8230; wait&#8230; it will last more than 30 hours. </p>



<p><strong>Please, let me sleep !</strong></p>



<p>This needs some automation. Fortunately, OVHcloud has the solution: Metrics Data Platform: <a href="https://www.ovh.com/fr/data-platforms/metrics/" data-wpel-link="exclude">https://www.ovh.com/fr/data-platforms/metrics/</a></p>



<h2 class="wp-block-heading">The Hardware</h2>



<p>The aim of the project is to plug a sensor onto an Arduino that will send data to <strong>OVHcloud Metrics Data Platform</strong> (<a href="https://www.ovh.com/fr/data-platforms/metrics/" data-wpel-link="exclude">https://www.ovh.com/fr/data-platforms/metrics/</a>) via the network. Basically, the Arduino will use the local wifi network to push temperature data to OVHcloud servers.</p>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/buy-esp8266.png" alt="" class="wp-image-16095" width="239" height="86" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/buy-esp8266.png 995w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/buy-esp8266-300x109.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/buy-esp8266-768x278.png 768w" sizes="auto, (max-width: 239px) 100vw, 239px" /></figure></div>



<p>Do you know ESP8266? It&#8217;s&nbsp;a low-cost (<strong>less than</strong> <strong>2€!</strong>) wifi microchip with full TCP/IP stack and microcontroller capability.</p>



<h3 class="wp-block-heading">ESP8266 functional diagram</h3>



<figure class="wp-block-image is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/esp8266-1.png" alt="" class="wp-image-16096" width="754" height="364" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/esp8266-1.png 933w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/esp8266-1-300x145.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/esp8266-1-768x370.png 768w" sizes="auto, (max-width: 754px) 100vw, 754px" /></figure>



<h3 class="wp-block-heading">Implementation: Wemos</h3>



<p>ESP8266 is not quite so easy to use on its own:</p>



<ul class="wp-block-list"><li>Must be powered at 3.3V (not too much, or it will burn)</li><li>No USB</li></ul>



<div class="wp-block-image"><figure class="alignright"><img loading="lazy" decoding="async" width="207" height="250" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/wemos.png" alt="" class="wp-image-16097"/></figure></div>



<p>That&#8217;s why it is better to use a solution that implements ESP8266 for us. Here is the Wemos!</p>



<ul class="wp-block-list"><li>Powered at 5V (6V is still ok)</li><li>USB for serial communication (for debugging)</li><li>Can be programmed via USB</li><li>Can be programmed with Arduino IDE</li><li>Costs less than 3€</li></ul>



<h2 class="wp-block-heading">Prepare your Arduino IDE</h2>



<h3 class="wp-block-heading">Install the integrated development environment</h3>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/download-arduino.png" alt="" class="wp-image-16098" width="423" height="169" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/download-arduino.png 917w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/download-arduino-300x120.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/download-arduino-768x307.png 768w" sizes="auto, (max-width: 423px) 100vw, 423px" /></figure></div>



<p>First of all you need to install Arduino IDE. It&#8217;s free, and available for any platform (Mac, Windows, Linux). Go to&nbsp;<a href="https://www.arduino.cc/en/main/software" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">https://www.arduino.cc/en/main/software</a>&nbsp;and download the version corresponding to your platform. At the time of writing, the current version is 1.8.10.</p>



<h3 class="wp-block-heading">Additional configuration for ESP8266</h3>



<p>When you install the Arduino IDE, it will only be capable of programming official Arduinos. Let&#8217;s add the firmware and libraries for ESP8266&#8230;&nbsp;</p>



<div class="wp-block-image"><figure class="aligncenter is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/step06.png" alt="" class="wp-image-16099" width="392" height="226" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/step06.png 999w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step06-300x174.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step06-768x445.png 768w" sizes="auto, (max-width: 392px) 100vw, 392px" /></figure></div>



<p>Start Arduino and open the &#8220;Preferences&#8221; window (<strong>File &gt; Preferences</strong>).</p>



<p>Enter&nbsp;<code><a href="https://arduino.esp8266.com/stable/package_esp8266com_index.json" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">https://arduino.esp8266.com/stable/package_esp8266com_index.json</a></code>&nbsp;into the&nbsp;&#8220;Additional Board Manager URLs&#8221;&nbsp;field. You can add multiple URLs, separating them with commas.</p>



<div style="height:115px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/step07.png" alt="" class="wp-image-16100" width="393" height="220" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/step07.png 1002w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step07-300x168.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step07-768x431.png 768w" sizes="auto, (max-width: 393px) 100vw, 393px" /></figure></div>



<p>Now open &#8220;Boards Manager&#8221; from the<strong>&nbsp;Tools &gt; Board</strong>&nbsp;menu and install&nbsp;the <em>esp8266</em>&nbsp;platform (don&#8217;t forget to select your ESP8266 board from the <strong>Tools &gt; Board</strong> menu after installation).</p>



<p>You are now ready!</p>



<h2 class="wp-block-heading">Order a Metrics Data Platform</h2>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/step00-1024x484.png" alt="" class="wp-image-16101" width="308" height="145" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/step00-1024x484.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step00-300x142.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step00-768x363.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step00.png 1321w" sizes="auto, (max-width: 308px) 100vw, 308px" /></figure></div>



<p></p>



<p>Go&nbsp;to the&nbsp;OVHcloud&nbsp;Metrics&nbsp;Data&nbsp;Platform&nbsp;website:&nbsp;<a href="https://www.ovh.com/fr/data-platforms/metrics/" data-wpel-link="exclude">https://www.ovh.com/fr/data-platforms/metrics/</a>. Click&nbsp;on&nbsp;the&nbsp;free&nbsp;trial, and finalise your order. If you don&#8217;t have an account, just create one. With this trial you will have 12 metrics (i.e. 12 sets of records). In this example, we will only use one.</p>



<h3 class="wp-block-heading">Retrieve your token</h3>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/step03.png" alt="" class="wp-image-16102" width="127" height="129" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/step03.png 353w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step03-296x300.png 296w" sizes="auto, (max-width: 127px) 100vw, 127px" /></figure></div>



<p>Go to the OVH Control Panel:&nbsp;<a href="https://www.ovh.com/manager/cloud/#/" data-wpel-link="exclude">https://www.ovh.com/manager/cloud/#/</a>. On the left-hand panel, you should have&nbsp;<strong>Metrics</strong>&nbsp;and a new service inside.</p>



<div style="height:65px" aria-hidden="true" class="wp-block-spacer"></div>



<p>In the&nbsp;&#8220;Tokens&#8221;&nbsp;tab, you can copy the<strong>&nbsp;write&nbsp;token</strong>.&nbsp;Keep it, as we will need it later.</p>



<div class="wp-block-image"><figure class="aligncenter is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/step04-1024x295.png" alt="" class="wp-image-16103" width="633" height="182" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/step04-1024x295.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step04-300x87.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step04-768x222.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step04.png 1539w" sizes="auto, (max-width: 633px) 100vw, 633px" /></figure></div>



<p>Note that to configure Grafana, you will need the <strong>read token</strong>.</p>



<h3 class="wp-block-heading">Retrieve the host of the Metrics Data Platform</h3>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/step05-1024x439.png" alt="" class="wp-image-16104" width="339" height="146" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/step05-1024x439.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step05-300x129.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step05-768x329.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step05.png 1526w" sizes="auto, (max-width: 339px) 100vw, 339px" /></figure></div>



<p>The host of your Metrics Data Platform is given in your service description.&nbsp;In the &#8220;Platforms&#8221; tab, copy the <strong>opentsdb host</strong>. Keep it, as we will need it later.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Deeper into the program</h2>



<p>Now let&#8217;s have a look at an example. Here is a code that will push static data to OVHcloud Metrics Data Platform. You can use it with your sensor. You just have to code the sensor measure. When running, the Wemos will:</p>



<ul class="wp-block-list"><li>Try to connect to you wifi network</li><li>If successful, push data to OVHcloud Metrics Data Platform</li></ul>



<p>The whole source code is available on my github: &nbsp;<a href="https://github.com/landru29/ovh_metrics_wemos" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">https://github.com/landru29/ovh_metrics_wemos</a>. </p>



<p>There are six main files:</p>



<ul class="wp-block-list"><li><em>ovh_metrics_wemos.ino</em>: the main file</li><li><em>wifi.cpp</em>: class that implements the process to connect to wifi via WPS (Wifi Protected Setup)</li><li><em>wifi.h</em>: header file for the wifi</li><li><em>metrics.cpp</em>: class that sends the metric data to OVHcloud Metrics Data Platform via HTTPS</li><li><em>metrics.h</em>: header file for metrics</li><li><em>config.h.sample</em>: model to create your configuration file (see below)</li></ul>



<h3 class="wp-block-heading">Create your configuration file</h3>



<p>If you try to compile the program, you will get errors, as some definitions are missing. We need to declare them in a file:&nbsp;<strong>config.h</strong>.</p>



<ol class="wp-block-list"><li>Copy&nbsp;<strong>config.h.sample</strong>&nbsp;into&nbsp;<strong>config.h</strong></li><li>Copy the write token you got in paragraph 5.1 (#define&nbsp;<strong>TOKEN</strong>&nbsp;&#8220;xxxxxx&#8221;)</li><li>Copy the host you got in paragraph 5.2 (#define&nbsp;<strong>HOST</strong>&nbsp;&#8220;xxxxxx&#8221;)</li></ol>



<h3 class="wp-block-heading">Get the fingerprint of the certificate</h3>



<p>As the Wemos will request through HTTPS, we need the certificate fingerprint. You will need the host you just grabbed from the&nbsp;&#8220;Platforms&#8221;&nbsp;tab and then:</p>



<h4 class="wp-block-heading">Linux users</h4>



<p>Just run this little script:</p>



<pre class="wp-block-code"><code class="">HOST=opentsdb.gra1.metrics.ovh.net; echo | openssl s_client -showcerts -servername ${HOST} -connect ${HOST}:443 2>/dev/null | openssl x509 -noout -fingerprint -sha1 -inform pem | sed -e "s/.*=//g" | sed -e "s/\:/ /g"</code></pre>



<p>Copy the result in your&nbsp;<strong><code>config.h&nbsp;</code></strong><code>(#define&nbsp;<strong>FINGERPRINT</strong>&nbsp;"xx xx ..")</code>.</p>



<h4 class="wp-block-heading">MAC users</h4>



<p>Just run this little script:</p>



<pre class="wp-block-code"><code class="">HOST=opentsdb.gra1.metrics.ovh.net; echo | openssl s_client -showcerts -servername ${HOST} -connect ${HOST}:443 2>/dev/null | openssl x509 -noout -fingerprint -sha1 -inform pem | sed -e "s/.*=//g" | sed -e "s/\:/ /g"</code></pre>



<p>Copy the result in your&nbsp;<strong><code>config.h&nbsp;</code></strong><code>(#define&nbsp;<strong>FINGERPRINT</strong>&nbsp;"xx xx ..")</code>.</p>



<h4 class="wp-block-heading">Windows users</h4>



<p>In your browser, go to <a href="https://opentsdb.gra1.metrics.ovh.net" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">https://opentsdb.gra1.metrics.ovh.net</a>. Click on the lock next to the URL to display the fingerprint of the certificate. Replace all &#8216;:&#8217; with one space.</p>



<h2 class="wp-block-heading">Compile the project and upload it to the Wemos</h2>



<ol class="wp-block-list"><li>Open the&nbsp;<code>.ino</code>&nbsp;file in the Arduino IDE (you should have six tabs in the project)</li><li>Plug the&nbsp;Wemos&nbsp;into you computer</li><li>Select the port from&nbsp;<strong>Tools &gt; Port</strong></li><li>On the top-left side, click on the arrow to upload the program</li><li>Once uploaded, you can open the serial monitor:&nbsp;<strong>Tools &gt; Serial Monitor</strong></li></ol>



<p>Right now, the program should fail, as the&nbsp;Wemos&nbsp;will not be able to connect to your wifi network.</p>



<h2 class="wp-block-heading">Run the program</h2>



<p>As we&#8217;ve already seen, the first run crashes. It&#8217;s because you need to launch a WPS connection, so depending on your internet modem, you will need to launch a WPS transaction. This could be a physical button on the modem, or a software action to trigger on the console (<a href="https://en.wikipedia.org/wiki/Wi-Fi_Protected_Setup" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">https://en.wikipedia.org/wiki/Wi-Fi_Protected_Setup</a>).</p>



<p>When the process is launched on the modem side, you have something like 30 seconds to power the Wemos.</p>



<ol class="wp-block-list"><li>Plug in your&nbsp;Wemos&nbsp;via USB =&gt; the program is running</li><li>Select the port from&nbsp;<strong>Tools &gt; Port</strong>&nbsp;(it may have changed)</li><li>Open the serial monitor:<strong>&nbsp;Tools &gt; Serial Monitor</strong></li></ol>



<p>Now you can follow the process.</p>



<h3 class="wp-block-heading">Wifi connection</h3>



<p>In the serial monitor (adjust the bit rate to 9600), you should get:</p>



<pre class="wp-block-preformatted"><code>Try to connect</code>
&nbsp;
<code>WPS config start</code>
<code>Trying to connect to &lt;your modem&gt; with saved config ...|SUCCESS</code>
<code>IP address:&nbsp;192.168.xx.xx</code></pre>



<p>If the wifi connection was successful, the serial console should display a local IP address (192.168.xx.xx), otherwise, it failed. Try again by triggering WPS on your modem and restarting the Wemos (unplug it and plug it back in).</p>



<h3 class="wp-block-heading">Sending data to OVHcloud Metrics Data Platform</h3>



<p>Now the Wemos is POSTing a request on the OVHcloud server. The serial console shows you the JSON it will send:</p>



<pre class="wp-block-preformatted"><code>------------------------------------------------</code>
<code>POST opentsdb.gra1.metrics.ovh.net/api/put</code>
<code>[{"metric":&nbsp;"universe","value":42,"tags":{}}]</code>
<code>------------------------------------------------</code>
<code>beginResult:&nbsp;0</code>
<code>http:&nbsp;204</code>
<code>response: xxxx</code></pre>



<p>If&nbsp;<strong><code>beginResult</code></strong>&nbsp;is negative, connection to the OVHcloud server failed. It could mean that the&nbsp;<code>FINGERPRINT</code>&nbsp;is wrong.</p>



<p>If&nbsp;<strong><code>http</code></strong>&nbsp;is not&nbsp;<code>2xx</code>&nbsp;(it should be&nbsp;<code>204</code>), the server could not process your request. It may mean that the&nbsp;<code>TOKEN</code>&nbsp;is wrong.</p>



<p>You got a 204? Great! It&#8217;s a success. Let&#8217;s check that on Grafana&#8230;</p>



<h2 class="wp-block-heading">Configure Grafana</h2>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/step08.png" alt="" class="wp-image-16107" width="280" height="168" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/step08.png 747w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/step08-300x180.png 300w" sizes="auto, (max-width: 280px) 100vw, 280px" /></figure></div>



<p>Go to OVHcloud Grafana:&nbsp;<a href="https://grafana.metrics.ovh.net/login" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">https://grafana.metrics.ovh.net/login</a>.&nbsp;Log in with your OVHcloud account.</p>



<h3 class="wp-block-heading">Configure a data source</h3>



<p>Click on &#8220;Add data source&#8221;.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="93" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/grafana00-1024x93.png" alt="" class="wp-image-16108" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana00-1024x93.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana00-300x27.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana00-768x70.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana00.png 1885w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<div class="wp-block-image"><figure class="alignright is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/grafana01.png" alt="" class="wp-image-16109" width="273" height="224" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana01.png 973w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana01-300x247.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana01-768x631.png 768w" sizes="auto, (max-width: 273px) 100vw, 273px" /></figure></div>



<ul class="wp-block-list"><li><em>Name</em>: choose one</li><li><em>Type</em>: OpenTSDB</li><li><em>URL</em>: https://&lt;host you got from your manager (see below)&gt;</li><li><em>Access</em>: direct</li><li>Check &#8220;Basic Auth&#8221;</li><li><em>User</em>: metrics</li><li><em>Password</em>: &lt;Read token from your manager (see below)&gt;</li></ul>



<p>Click on the &#8220;Add&#8221; button&#8230;</p>



<p>&#8230; and save it.</p>



<h3 class="wp-block-heading">Create your first chart</h3>



<p>Go back to&nbsp;<a href="https://grafana.metrics.ovh.net/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">https://grafana.metrics.ovh.net/</a>&nbsp;and click on &#8220;New Dashboard&#8221;.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="84" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/grafana03-1024x84.png" alt="" class="wp-image-16110" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana03-1024x84.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana03-300x24.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana03-768x63.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana03.png 1886w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Click on &#8220;Graph&#8221;.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="84" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/grafana04-1024x84.png" alt="" class="wp-image-16111" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana04-1024x84.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana04-300x25.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana04-768x63.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana04.png 1894w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Click on &#8220;Panel title&#8221;, then &#8220;Edit&#8221;.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="126" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/grafana05-1024x126.png" alt="" class="wp-image-16112" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana05-1024x126.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana05-300x37.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana05-768x95.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/grafana05.png 1887w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Select your metric in the &#8220;metric name&#8221; field. The software must suggest the name <em>universe</em> (the name specified in the Arduino program). If it doesn&#8217;t, this means the metrics were not correctly sent by the Wemos. Close the &#8220;edit&#8221; panel (click the cross on the right) and save your configuration (top-left of the window).</p>



<h2 class="wp-block-heading">Result analysis</h2>



<h3 class="wp-block-heading">Temperature rise</h3>



<p>The first result to analyse is the temperature rise. The sensor was lying on the bricks of the oven. The yellow chart is the oven temperature, and the green chart is the ambient temperature.</p>



<ol class="wp-block-list"><li>Between 11:05 and 11:10, there is a step at about 85°C. It seems to be the moisture of the oven that was drying.</li><li>Then there&#8217;s a temperature drop, so I added some more wood to the oven (i.e. introduced cold stuff).</li><li>At about 11:20, the slope is lighter, and I have no idea why. Fire not strong enough? Moisture deeper in the bricks?</li></ol>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="418" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/four-1024x418.png" alt="" class="wp-image-16113" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/four-1024x418.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/four-300x122.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/four-768x313.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/four.png 1871w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Temperature dropdown</h3>



<p>At this point, I moved all the embers at the back of the oven and put the sensor where the fire was burning. That&#8217;s why the chart begins at 400°C.</p>



<ol class="wp-block-list"><li>The temperature dropdown seems to be something like <strong>F(t) = A/t</strong></li><li>At about 15:40, I changed the power supply from a phone power supply plugged in at 230V to a car battery with a voltage regulator (which seemed to be shitty)</li><li>The ambient temperature is quite high between 15:00 and 17:00. It was a sunny day, so the sun was directly heating the circuit.</li></ol>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="417" src="https://www.ovh.com/blog/wp-content/uploads/2019/10/four2-1024x417.png" alt="" class="wp-image-16114" srcset="https://blog.ovhcloud.com/wp-content/uploads/2019/10/four2-1024x417.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/four2-300x122.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/four2-768x313.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2019/10/four2.png 1871w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fiot-pushing-data-to-ovhcloud-metrics-timeseries-from-arduino%2F&amp;action_name=IOT%3A%20Pushing%20data%20to%20OVHcloud%20metrics%20timeseries%20from%20Arduino&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
