{"id":3589,"date":"2025-04-19T06:13:15","date_gmt":"2025-04-19T06:13:15","guid":{"rendered":"https:\/\/iotthinghub.com\/?p=3589"},"modified":"2025-04-19T06:57:31","modified_gmt":"2025-04-19T06:57:31","slug":"stm32-live-server-update-thingspeak-cloud","status":"publish","type":"post","link":"https:\/\/iotthinghub.com\/?p=3589","title":{"rendered":"STM32 : Live Server Update (ThingSpeak Cloud)"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"3589\" class=\"elementor elementor-3589\">\n\t\t\t\t<div class=\"elementor-element elementor-element-6607e67 e-flex e-con-boxed e-con e-parent\" data-id=\"6607e67\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-56b0774 elementor-widget elementor-widget-text-editor\" data-id=\"56b0774\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>We already learn about ESP8266 softAccess mode to connect with internet. In this article we make a program to store indoor room temperature, pressure, humidity &amp; altitude to the thingSpeak cloud. Go to thingSpeak website &amp; create a channel after successful registration. Since we only write data to thingSpeak cloud, after successfully creating a channel with fields you can have-<\/p><p>Write a Channel Feed<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-387346a e-flex e-con-boxed e-con e-parent\" data-id=\"387346a\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7e431b4 elementor-widget elementor-widget-heading\" data-id=\"7e431b4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\"><span style=\"font-size:12.0pt;line-height:115%;font-family:&quot;ZCOOL XiaoWei&quot;\">GET https:\/\/api.thingspeak.com\/update?api_key=={API\nkey}&amp;field1=0<\/span><\/h5>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-d4fdffd e-flex e-con-boxed e-con e-parent\" data-id=\"d4fdffd\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-ff3e6e5 elementor-widget elementor-widget-text-editor\" data-id=\"ff3e6e5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Since it is a GET method we can check it directly into a browser for updating the value without Postman Application. Here we use BMP280 &amp; AHT20 I<sup>2<\/sup>C sensor for reading temperature, pressure, humidity &amp; altitude. To know how to interface with BMP280 &amp; AHT20 please go through my <a href=\"https:\/\/iotthinghub.com\/?p=3280\">I2C weather forecasting<\/a> article. Only BME280 can display temperature, humidity, pressure &amp; altitude value but for comparing reading we use 2 sensors, also it has low cost them BME280 or you can use only AHT20 for temperature &amp; humidity reading. You can use only 1 GPIO pin &amp; read temperature &amp; humidity data using DHT11 or DHT22. You can make a simple project with only ESP8266 module interface with DHT11 or DHT22 since it has 2 GPIO pin. We will discuss it on some other article, let\u2019s continue with our project. Here<\/p><ul><li>field1 = Temperature AHT20 &amp; field2 =Temperature BMP280<\/li><li>field3 = Humidity AHT20<\/li><li>field4 = Pressure BMP280<\/li><li>field5 = Altitude BMP280<\/li><\/ul><p>Download the file of my <a href=\"https:\/\/iotthinghub.com\/?p=3280\">I2C weather forecasting<\/a> article &amp; make a simple command for sending data to thingSpeak-<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4c7effd elementor-widget elementor-widget-text-editor\" data-id=\"4c7effd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #003366;\">sprintf(wifi_send,&#8221;AT+CIPSTART=\\&#8221;TCP\\&#8221;,\\&#8221;api.thingspeak.com\\&#8221;,80\\r\\n&#8221;);<\/span><br \/><span style=\"color: #003366;\">ESP8266_TX(wifi_send,&#8221;CONNECT&#8221;,200);<\/span><br \/><span style=\"color: #003366;\">sprintf(wifi_send,&#8221;GET \/update?api_key=%s&amp;field1=%.2f&amp;field2=%.2f&amp;field3=%.2f&amp;field4=%.2f&amp;field5=%.2f HTTP\/1.1\\r\\nHost: api.thingspeak.com\\r\\n\\r\\n\\r\\n&#8221;, API_Key_thingspeak, AHT20_Temperature, BMP280_Temperature, AHT20_Humidity, BMP280_Pressure, BMP280_Altitude);<\/span><br \/><span style=\"color: #003366;\">sprintf(TX_ID,&#8221;AT+CIPSEND=%d\\r\\n&#8221;,strlen(wifi_send));<\/span><br \/><span style=\"color: #003366;\">ESP8266_TX(TX_ID,&#8221;&gt;&#8221;,100); \/\/ Creating LINK<\/span><br \/><span style=\"color: #003366;\">sprintf(wifi_send,&#8221;GET \/update?api_key=%s&amp;field1=%.2f&amp;field2=%.2f&amp;field3=%.2f&amp;field4=%.2f&amp;field5=%.2f HTTP\/1.1\\r\\nHost: api.thingspeak.com\\r\\n\\r\\n\\r\\n&#8221;, API_Key_thingspeak, AHT20_Temperature, BMP280_Temperature, AHT20_Humidity, BMP280_Pressure, BMP280_Altitude);<\/span><br \/><span style=\"color: #003366;\">HAL_UART_Transmit(&amp;huart1,(uint8_t*)wifi_send,strlen(wifi_send),1000);<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7ed998f elementor-widget elementor-widget-text-editor\" data-id=\"7ed998f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Since the data will not update every seconds we will update it in every 5 minutes. For that purpose we use TIM17 interrupt function. Here we use 1.8 &#8221; TFT LCD display for display sensor data. Sensor value will update every minutes. Let\u2019s use another format of current local server time data form <a href=\"https:\/\/timezonedb.com\">https:\/\/timezonedb.com<\/a>. No need for internal RTC clock &amp; data will synchronize with server every time. \u00a0<\/p><p>All the data will store in thingSpeak server (for free account update available every 15s) &amp; you can read it any time. For device setting &amp; how it works please see my YouTube video, keep learning.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-11507c8 elementor-widget elementor-widget-image\" data-id=\"11507c8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"640\" height=\"278\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/04\/ThingSpeak-Cloud-1024x445.jpg\" class=\"attachment-large size-large wp-image-3651\" alt=\"\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/04\/ThingSpeak-Cloud-1024x445.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/04\/ThingSpeak-Cloud-300x130.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/04\/ThingSpeak-Cloud-768x334.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/04\/ThingSpeak-Cloud.jpg 1287w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-b8e27e2 e-flex e-con-boxed e-con e-parent\" data-id=\"b8e27e2\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2f8ae55 elementor-widget elementor-widget-video\" data-id=\"2f8ae55\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;youtube_url&quot;:&quot;https:\\\/\\\/youtu.be\\\/LCBpuSeVgvY&quot;,&quot;video_type&quot;:&quot;youtube&quot;,&quot;controls&quot;:&quot;yes&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-wrapper elementor-open-inline\">\n\t\t\t<div class=\"elementor-video\"><\/div>\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>We already learn about ESP8266 softAccess mode to connect with internet. In this article we make a program to store indoor room temperature, pressure, humidity &amp; altitude to the thingSpeak cloud. Go to thingSpeak website &amp; create a channel after successful registration. Since we only write data to thingSpeak cloud, after successfully creating a channel [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-3589","post","type-post","status-publish","format-standard","hentry","category-wireless-iot"],"_links":{"self":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3589"}],"version-history":[{"count":71,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3589\/revisions"}],"predecessor-version":[{"id":3664,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3589\/revisions\/3664"}],"wp:attachment":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}