﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Arduino Discussions</title>
    <description>Latest discussions happening in the Arduino category</description>
    <link>https://www.aboveunity.com</link>
    <item>
      <title>Arduino Clone - Mega Wemos WiFi - Web Server</title>
      <description>&lt;p&gt;My Friends,&lt;/p&gt;&#xD;
&lt;p&gt;Today, I want to go through, and explain how to setup the Mega Wemos WiFi Arduino Clone for a Web Server. Yes, I have done this before, some time ago: &lt;a href="../../thread/mcu-controlled-aeroponics-growing-system/"&gt;Here&lt;/a&gt;.&lt;/p&gt;&#xD;
&lt;p&gt;Recently I built a Small Incubator with My Kids, we want to raise our Chickens and Ducks in the Incubator because the Mums are not very dedicated to their Eggs, and they wanted to help, of course I had to make it complicated, and they quickly lost interest, but are very much enjoying seeing the&amp;nbsp; progress!&lt;/p&gt;&#xD;
&lt;p&gt;We are Re-Purposing a small Freezer, one that was still working, but was giving us a few problems, so re retired it, Stripped it out and cleaned it up a little:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/880ac190-98d6-42b7-9f67-afff00220855_new-incubator.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;The Shelves have been cleaned up and will go back in. We will have an Incandescent Light Bulb as a Heating Element, and a Temperature Sensor, controlling a small Relay:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/2a86f551-9449-4077-a54c-afff002401be_top-of-the-enclosure.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/8971cd9d-c221-4a18-8925-afff00241d05_inside-the-enclosure.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;All this, the completed Controller Box will go in where the Compressor used to be, after a clean up:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/6595dc14-6194-4021-8697-afff0029c137_where-the-compressor-used-to-live.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;The Arduino Clone, Mega Wemos:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/ee1cd547-fce3-403a-b098-abd7003e5f26_wemos-mega-wifi-r3-modulet.jpg?width=690&amp;amp;upscale=false"&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Is a fantastic Board, but it is a bit finicky to get going, 100% It takes some time, and some knowledge to figure out some of the problems associated with it.&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;h3&gt;Approach&lt;/h3&gt;&#xD;
&lt;p&gt;There are several ways we can approach this subject:&lt;/p&gt;&#xD;
&lt;ol&gt;&#xD;
&lt;li&gt;Use the ESP8622 as its own Web Server - Runs its own Web Server Code.&lt;/li&gt;&#xD;
&lt;li&gt;Run the Code from the Mega 2560 as a By-Pass Web Server.&lt;/li&gt;&#xD;
&lt;/ol&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;We will test the second option, run a Web Server as a By-Pass Web Server on the Mega 2560, and see how we go. The First option will be next.&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;h3&gt;Step 1 - Update the Firmware&lt;/h3&gt;&#xD;
&lt;p&gt;Its up to you, you can skip this step and move to step 2, and see if you have any problems? Try it and see!&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img src="https://docs.ai-thinker.com/lib/tpl/material/images/icon_logo.png?width=690" alt="" width="18" height="18"&gt; &lt;a href="https://docs.ai-thinker.com/en/esp8266/sdk"&gt;AI Thinker&lt;/a&gt; is the Company that has put this Configuration together and made it available for use, Thanks AI Thinker.&lt;/p&gt;&#xD;
&lt;p&gt;FYI: See the &lt;a href="https://nodemcu.readthedocs.io/en/release/flash/"&gt;NodeMCU Website&lt;/a&gt; for a very good tutorial on Firmware Updates.&lt;/p&gt;&#xD;
&lt;p&gt;https://www.youtube.com/watch?v=YUqvgvuMjCQ&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;First, you need to update the Firmware! The Firmware you need to update, is for the ESP8266 WiFi Chip on board.&lt;/p&gt;&#xD;
&lt;p&gt;To do this, your "Mega +WiFi R3 Module ATmega2560+ESP8266 32Mb Memory USB-TTL CH340G Mega NodeMCU ESP8266" board, needs to have the Jumper buttons set:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/394715c0-9938-4982-af02-abdd014f9b52_mega-wifi-jumper-pin-configurations.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Switch your Jumper Buttons, and the RX/TX Switch, to:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/395a6564-08d3-4225-9d62-abdd01528449_mega-wifi-jumper-pins-for-firmware-upload-mode.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Luckily this is very easy, the best method I found was following this video:&lt;/p&gt;&#xD;
&lt;p&gt;https://youtu.be/E250CVUWNB0&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;Firmware Download&lt;/strong&gt;:&lt;/p&gt;&#xD;
&lt;ul&gt;&#xD;
&lt;li&gt;&lt;a href="../../Downloads/Microcontrollers/Mega+ESP8266/AiThinker%20ESP8266%2032Mb%20V1.5.4%20Firmware.zip"&gt;Firmware and&amp;nbsp;ESPTool&lt;/a&gt;&amp;nbsp;Firmware is inside the "At_firmware_bin1.54" directory.&lt;/li&gt;&#xD;
&lt;/ul&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Extract all your Zip Contents to: 'C:\Wemos\' like this:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/767dbf06-5d07-48db-ae51-afff0009d9fe_file-structure.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Install Python 3.0 or above onto your&amp;nbsp; PC if it is not already. &lt;a href="https://www.python.org/downloads/release/python-370/"&gt;Here&lt;/a&gt; is the Python Download Link.&lt;/p&gt;&#xD;
&lt;p&gt;Open a Command Prompt as Administrator, Elevated Permissions:&lt;/p&gt;&#xD;
&lt;ol&gt;&#xD;
&lt;li&gt;Right Click the Command Prompt.&lt;/li&gt;&#xD;
&lt;li&gt;Go to Run as Administrator.&lt;/li&gt;&#xD;
&lt;li&gt;Click Yes.&lt;/li&gt;&#xD;
&lt;/ol&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/47782679-6486-4811-820c-afff000bf11b_run-command-prompt-as-an-elevated-user.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;At the Command Prompt, type in: &lt;strong&gt;cd C:\Wemos\&lt;/strong&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/e313af36-e6f7-4b05-a2ff-afff000ceb1d_command-prompt-change-directory.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;As you can see, this changes the Directory to C:\Wemos\&lt;/p&gt;&#xD;
&lt;p&gt;From the Command Prompt, type in:&lt;/p&gt;&#xD;
&lt;pre class="language-python"&gt;&lt;code&gt;python esptool.py --port &amp;lt;YOURCOMPORT&amp;gt; write_flash 0x0000 "At_firmware_bin1.54\AiThinker_ESP8266_DIO_32M_32M_20160615_V1.5.4.bin"&lt;/code&gt;&lt;/pre&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Where your Com Port may be &lt;strong&gt;com11&lt;/strong&gt;:&lt;/p&gt;&#xD;
&lt;pre class="language-python"&gt;&lt;code&gt;python esptool.py --port com11 write_flash 0x0000 "At_firmware_bin1.54\AiThinker_ESP8266_DIO_32M_32M_20160615_V1.5.4.bin"&lt;/code&gt;&lt;/pre&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Of course, you need to check what Com Port your "Mega +WiFi R3 Module ATmega2560+ESP8266 32Mb Memory USB-TTL CH340G Mega NodeMCU ESP8266" board is connected on, and replace with your Com Port!&lt;/p&gt;&#xD;
&lt;p&gt;If you get an error:&lt;/p&gt;&#xD;
&lt;pre class="language-python"&gt;&lt;code&gt;ModuleNotFoundError: No module named 'serial'&lt;/code&gt;&lt;/pre&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Them just run:&lt;/p&gt;&#xD;
&lt;pre class="language-python"&gt;&lt;code&gt;C:\Wemos&amp;gt;pip install pyserial&lt;/code&gt;&lt;/pre&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;And then try again.&lt;/p&gt;&#xD;
&lt;p&gt;You should see:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/ce7fd9d7-08f7-4c54-8db4-afff00200271_firmware-updated-on-esp8266.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; On some boards, you may have to do this step several times, I have had one board, that just would not take the Update! Even though it said it was successful! Test and if your WiFi does not work, ESP Not Initialised, repeat this step.&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;h3&gt;Step 2&lt;/h3&gt;&#xD;
&lt;p&gt;When you're done, finished the firmware Flash, set your Jumper Switches back to: "CH340 connect to Mega2560 COM3 connect to ESP8266" mode, so you can use the ATMega and the ESP8266 like a normal Arduino.&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/49a1f6fc-ed88-436a-b2c2-abdd01514952_mega-wifi-jumper-pins.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;After you have this done, plug in your Mega and upload the following Code:&lt;/p&gt;&#xD;
&lt;pre class="language-cpp"&gt;&lt;code&gt;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// Header:                                                                                                                           //&#xD;
////////////////////////////////////////                                                                                             //&#xD;
// Includes:                          //                                                                                             //&#xD;
#include &amp;lt;Wire.h&amp;gt;                     // I2C Protocol...                                                                             //&#xD;
#include "WiFiEsp.h"                  // ESP8266 WiFi Library...                                                                     //&#xD;
#include &amp;lt;OneWire.h&amp;gt;                  // OneWire Library DS18B20 Dallas Temperature Sensor...                                        //&#xD;
#include &amp;lt;DallasTemperature.h&amp;gt;        // DS18B20 Dallas Temperature Sensor Library...                                                //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
&#xD;
&#xD;
&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// WiFi Esp Client:                                                                                                                  //&#xD;
////////////////////////////////////////                                                                                             //&#xD;
// Initialize WiFi Client:            //                                                                                             //&#xD;
WiFiEspClient client;                 // A Client that makes a Connection.                                                           //&#xD;
                                      //                                                                                             //&#xD;
WiFiEspServer server(80);             // Init the WiFi Web Server on Port 80.                                                        //&#xD;
                                      //                                                                                             //&#xD;
int status = WL_IDLE_STATUS;          // The Wifi radio's status                                                                     //&#xD;
                                      //                                                                                             //&#xD;
// WiFi Credentials:                  //                                                                                             //&#xD;
char ssid[] = "YourSSID";               // Your Network SSID (name)                                                                    //&#xD;
char pass[] = "YourPassword";             // Your Network Password                                                                       //&#xD;
                                      //                                                                                             //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
&#xD;
&#xD;
&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// WiFi Esp Client:                                                                                                                  //&#xD;
////////////////////////////////////////                                                                                             //&#xD;
IPAddress LocalIP(192,168,1,15);      // Set the Local Static IP Address.                                                            //&#xD;
IPAddress Gateway(192,168,1,1);       // Set the Local Static IP Address.                                                            //&#xD;
IPAddress Subnet(255,255,255,0);      // Set the Local Static IP Address.                                                            //&#xD;
IPAddress PrimaryDNS(192,168,1,1);    // Set the Local Static IP Address.                                                            //&#xD;
IPAddress SecondaryDNS(192,168,1,1);  // Set the Local Static IP Address.                                                            //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
&#xD;
&#xD;
&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// DallasTemperature Temperature Init:                                                                                               //&#xD;
////////////////////////////////////////                                                                                             //&#xD;
// Temperature Sensor Init:           //                                                                                             //&#xD;
bool Reading = false;                 // Reading Sensor Boolean.                                                                     //&#xD;
int SensorPin = 10;                   // The Temprature Sensor Pin.                                                                  //&#xD;
OneWire wire(SensorPin);              // One Wire Reference, set the pin to your Digital Pin.                                        //&#xD;
DallasTemperature DS18B20(&amp;amp;wire);     // The DS18B20 DallasTemperature Sensor Reference...                                           //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
&#xD;
&#xD;
&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// Relay Control Init:                                                                                                               //&#xD;
////////////////////////////////////////                                                                                             //&#xD;
// Temperature Sensor Init:           //                                                                                             //&#xD;
int RelayPin = 12;                    // The Temprature Sensor Pin.                                                                  //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
&#xD;
&#xD;
&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// The optimum incubation temperature of wild fowl eggs is within a wide range of values, varying from 33&amp;ordm;C to 39&amp;ordm;C,                 //&#xD;
// whereas a narrower range (37&amp;ordm;C to 38&amp;ordm;C) is considered as optimum for domestic poultry (Visschedijk, 1991).                        //&#xD;
////////////////////////////////////////                                                                                             //&#xD;
float Celsius = 0;                    // Current Temp.                                                                               //&#xD;
float TMin = 37.0;                    // Min Temp.                                                                                   //&#xD;
float TMax = 38.0;                    // Max Temp.                                                                                   //&#xD;
// Normal ale fermentation temperatures range from 68 to 72 &amp;deg;F (20 to 22 &amp;deg;C) and lager fermentation temperatures from 45 to          //&#xD;
// 55 &amp;deg;F (7 to 13 &amp;deg;C). Also keep in mind that the heat generated by an active fermentation can warm a typical 5-gallon (19-L)        //&#xD;
// batch of beer by 10 to 15 degrees Fahrenheit (5.5 to 8.3 degrees Celsius).                                                        //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
&#xD;
&#xD;
&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// The Server Response Header:                                                                                                       //&#xD;
//////////////////////////////////////////////////                                                                                   //&#xD;
const String Header = "HTTP/1.1 200 OK\r\n"     //                                                                                   //&#xD;
                "Content-Type: text/html\r\n"   //                                                                                   //&#xD;
                "Connection: close\r\n"         // the connection will be closed after completion of the response                    //&#xD;
                "Refresh: 30\r\n"               // refresh the page automatically every 30 sec                                       //&#xD;
                "\r\n";                         //                                                                                   //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
&#xD;
&#xD;
&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// Home Page Template Init:                                                                                                          //&#xD;
///////////////////////////////////////////////////////////////////////////////////////                                              //&#xD;
const String HomePageTemplate =                                                      //                                              //&#xD;
          "&amp;lt;!DOCTYPE HTML&amp;gt;\r\n"                                                      //                                              //&#xD;
          "&amp;lt;html&amp;gt;\r\n"                                                               //                                              //&#xD;
          "&amp;lt;head&amp;gt;\r\n"                                                               //                                              //&#xD;
          "&amp;lt;style&amp;gt;body "                                                             //                                              //&#xD;
          "{ background-color: linen; } "                                            //                                              //&#xD;
          "h1 "                                                                      //                                              //&#xD;
          "{ color: maroon; margin-left: 40px; }"                                    //                                              //&#xD;
          "p { color: green; margin: 0px; padding-top: 3px; margin-left: 10px; } "   //                                              //&#xD;
          " &amp;lt;/style&amp;gt;\r\n"                                                            //                                              //&#xD;
          "&amp;lt;/head&amp;gt;\r\n"                                                              //                                              //&#xD;
          "&amp;lt;body&amp;gt;\r\n"                                                               //                                              //&#xD;
          "&amp;lt;h1&amp;gt;Our Home Built Incubator!&amp;lt;/h1&amp;gt;\r\n"                                   //                                              //&#xD;
          "&amp;lt;p&amp;gt;Welcome to our home built Incubator's webpage!&amp;lt;/p&amp;gt;\r\n"                //                                              //&#xD;
          "&amp;lt;br&amp;gt;\r\n"                                                                 //                                              //&#xD;
          "&amp;lt;p&amp;gt;Incubator Temperature: "                                               //                                              //&#xD;
          "&amp;lt;b&amp;gt;%Celsius%&amp;lt;/b&amp;gt;"                                                         //                                              //&#xD;
          "&amp;amp;#8451&amp;lt;/p&amp;gt;&amp;lt;br&amp;gt;\r\n"                                                       //                                              //&#xD;
          "&amp;lt;p&amp;gt;Light is: "                                                            //                                              //&#xD;
          "&amp;lt;b&amp;gt;%PinState%&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;"                                                    //                                              //&#xD;
          "&amp;lt;br&amp;gt;\r\n"                                                                 //                                              //&#xD;
          "&amp;lt;/body&amp;gt;\r\n"                                                              //                                              //&#xD;
          "&amp;lt;/html&amp;gt;\r\n";                                                             //                                              //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
&#xD;
&#xD;
&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// Setup the Board:                                                                                                                  //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
void setup() {&#xD;
&#xD;
  // Sets the digital pin 10 as output&#xD;
  // pinMode(SensorPin, OUTPUT);&#xD;
&#xD;
  // Sets the digital pin 12 as output&#xD;
  pinMode(RelayPin, OUTPUT);&#xD;
&#xD;
  // Initialize Debugging Serial:&#xD;
  Serial.begin(115200);&#xD;
&#xD;
  // Initialize serial for ESP module: COM3 = Srial3&#xD;
  Serial3.begin(115200);&#xD;
&#xD;
  // Initialize ESP8266 Module:&#xD;
  WiFi.init(&amp;amp;Serial3);&#xD;
&#xD;
  // Initialize DS18B20 DallasTemperature Sensor:&#xD;
  DS18B20.begin();&#xD;
&#xD;
  // Check ESP8266 Status:&#xD;
  if (WiFi.status() == WL_NO_SHIELD) {&#xD;
&#xD;
    Serial.println("[Mega 2560] WiFi shield not present");&#xD;
&#xD;
    // don't continue&#xD;
    while (true);&#xD;
  }&#xD;
&#xD;
  // Attempt to connect to WiFi network:&#xD;
  while (status != WL_CONNECTED) {&#xD;
&#xD;
    Serial.print("[Mega 2560] Attempting to connect to WPA SSID: ");&#xD;
    Serial.println(ssid);&#xD;
&#xD;
    // Connect to WPA/WPA2 Network:&#xD;
    status = WiFi.begin(ssid, pass);&#xD;
  }&#xD;
&#xD;
  // Start the Web Server on Port: 80&#xD;
  server.begin();&#xD;
&#xD;
  // You're connected:&#xD;
  Serial.println("[Mega 2560] You're connected to the network");&#xD;
&#xD;
  // Print the SSID of the Network:&#xD;
  Serial.print("[Mega 2560] SSID: ");&#xD;
  Serial.println(WiFi.SSID());&#xD;
&#xD;
  // Print your ESP8266 WiFi IP Address:&#xD;
  IPAddress ip = WiFi.localIP();&#xD;
  Serial.print("[Mega 2560] IP Address: ");&#xD;
  Serial.println(ip);&#xD;
&#xD;
  // Print Signal Strength:&#xD;
  long rssi = WiFi.RSSI();&#xD;
  Serial.print("[Mega 2560] Signal strength (RSSI):");&#xD;
  Serial.print(rssi);&#xD;
  Serial.println(" dBm");&#xD;
}&#xD;
&#xD;
&#xD;
&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// Board Main Loop:                                                                                                                  //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
void loop() {&#xD;
&#xD;
  // Listen for incoming Clients:&#xD;
  client = server.available();&#xD;
&#xD;
  // If we have a Client:&#xD;
  if (client) {&#xD;
&#xD;
    // A http request ends with a blank line:&#xD;
    boolean currentLineIsBlank = true;&#xD;
&#xD;
    // While Connected:&#xD;
    while (client.connected()) {&#xD;
&#xD;
      // If Client Avaliable:&#xD;
      if (client.available()) {&#xD;
&#xD;
        // Read Client Request:&#xD;
        char ClientRequest = client.read();&#xD;
&#xD;
        // Write to the Serial Port:&#xD;
        Serial3.write(ClientRequest);&#xD;
&#xD;
        // Delay to let ESP8266 Read and process the Data:&#xD;
        delay(70);&#xD;
&#xD;
        // If you've gotten to the end of the line (received a newline&#xD;
        // character) and the line is blank, the http request has ended,&#xD;
        // so you can send a reply&#xD;
        if (ClientRequest == '\n' &amp;amp;&amp;amp; currentLineIsBlank) {&#xD;
&#xD;
          // Init State Variable:&#xD;
          String PinState = "";&#xD;
&#xD;
          // Get the Pin State:&#xD;
          int state = digitalRead(RelayPin);&#xD;
&#xD;
          // Check Pin State:&#xD;
          if (state == 1)&#xD;
            PinState = "On";&#xD;
          else&#xD;
            PinState = "Off";&#xD;
&#xD;
          // Prepare the Html Document, Home Page:&#xD;
          String HomePage = HomePageTemplate;&#xD;
          HomePage.replace("%Celsius%", String(Celsius));&#xD;
          HomePage.replace("%PinState%", PinState);&#xD;
&#xD;
          // Mega 2560 Send Response:&#xD;
          Serial.println("[Mega 2560] Sending Response");&#xD;
&#xD;
          // Send a standard Http Response Header:&#xD;
          client.print(Header);&#xD;
&#xD;
          // Send the Html Document, Home Page:&#xD;
          client.print(HomePage);&#xD;
&#xD;
           // We are done:&#xD;
          break;&#xD;
        }&#xD;
        if (ClientRequest == '\n') {&#xD;
&#xD;
          // You're starting a new line:&#xD;
          currentLineIsBlank = true;&#xD;
        } &#xD;
        else if (ClientRequest != '\r') {&#xD;
&#xD;
          // You've gotten a character on the current line:&#xD;
          currentLineIsBlank = false;&#xD;
        }&#xD;
      }&#xD;
    }&#xD;
&#xD;
    // Give the Web Browser time to Receive and Process the Data:&#xD;
    delay(100);&#xD;
&#xD;
    // Close the connection:&#xD;
    client.stop();&#xD;
  }&#xD;
&#xD;
  // Read DS18B20 Temperature: Incubator&#xD;
  ReadDS18B20Sensor();&#xD;
&#xD;
  // Regulate Temperature:&#xD;
  if (Celsius &amp;lt; TMax)&#xD;
    digitalWrite(RelayPin, HIGH);&#xD;
  else&#xD;
    digitalWrite(RelayPin, LOW);&#xD;
&#xD;
  // Get the Pin State:&#xD;
  int state = digitalRead(RelayPin);&#xD;
&#xD;
  // Secondary Check Pin State:&#xD;
  if (state == 1 &amp;amp;&amp;amp; Celsius &amp;gt; TMax)&#xD;
    digitalWrite(RelayPin, LOW); // Maybe Impliment a Fan to cool down if Over Temp Occurs?&#xD;
}&#xD;
&#xD;
&#xD;
&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
// Read DS18B20 Dallas Temerature Sensor:                                                                                            //&#xD;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////&#xD;
void ReadDS18B20Sensor() {&#xD;
&#xD;
  // Size: 23 x 20mm&#xD;
  // Chip: DS18B20&#xD;
  // Voltage: 3.3V, 5V&#xD;
  // Port: Digital two-way single bus&#xD;
  // Temperature range: -50 ℃ to + 125 ℃&#xD;
  // Applicable sensor: Waterproof DS18B20 temperature sensor&#xD;
  // Port: DAT (18B20 data) VCC (18B20 positive) GND (18B20 negative)&#xD;
  // Suitable platform: and Raspberry Pi&#xD;
&#xD;
&#xD;
  // Get Temperatures:&#xD;
  DS18B20.requestTemperatures();&#xD;
&#xD;
  // Get Celsius:&#xD;
  Celsius = DS18B20.getTempCByIndex(0);&#xD;
&#xD;
  // Get Fahrenheit:&#xD;
  float Fahrenheit = DS18B20.toFahrenheit(Celsius);&#xD;
&#xD;
  // We use the function ByIndex, and as an example get the temperature from the first sensor only:  for the device 1 (index 0) is&#xD;
  //Serial.print("Temperature: ");&#xD;
  //Serial.print(Celsius);&#xD;
  //Serial.println("C");&#xD;
}&lt;/code&gt;&lt;/pre&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Your Arduino IDE Should give you a message in the Serail Monitor:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/9accaa69-b894-4a4b-be6b-afff00162d25_connected-to-wifi.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Of course, your details will be different, your IP Address and SSID will be different! No doubt.&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;h3&gt;Step 3&lt;/h3&gt;&#xD;
&lt;p&gt;After a Reboot, and a little bit of Patience, you will get a Web Page:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/e20f759f-4ea6-4231-8ed5-afff0014870b_our-home-incubator.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;And of course, when I connect the Sensor:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="../../content/uploads/b5d8d256-5657-4ec2-ac7c-a741014a20b4/b02d7ab3-1233-4c1f-b87a-afff001fb29a_our-home-incubator-with-temp.jpg?width=690&amp;amp;upscale=false" alt=""&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Of course, this is a very simple start to our project, and more can be done to make this more stable, and much more exciting to use, setting a Fixed IP Address would be a start, maybe adding a camera to the inside of the Incubator at a later stage, to see any chicks hatch may be fun!&lt;/p&gt;&#xD;
&lt;p&gt;Come Spring, 1st of September, I hope we might have some Baby Chicks.&lt;/p&gt;&#xD;
&lt;p&gt;Best Wishes,&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp; &amp;nbsp;Chris&lt;/p&gt;</description>
      <pubDate>2023-05-11T02:17:39.4600000</pubDate>
      <link>https://www.aboveunity.com/thread/arduino-clone-mega-wemos-wifi-web-server/</link>
    </item>
    <item>
      <title>Product review - Pro Micro ATMEGA32U4 5V 16MHz</title>
      <description>&lt;p&gt;My Friends,&lt;/p&gt;&#xD;
&lt;p&gt;I bought a small Microcontroller the other day. I wanted to do a review on it, because I am so impressed with it:&lt;/p&gt;&#xD;
&lt;p&gt;&lt;span style="background-color: #ffffff;"&gt;https://youtu.be/DHxH1v_La5s&lt;/span&gt;&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&#xD;
&lt;p&gt;Postage took a long time is about the only complaint.&lt;/p&gt;&#xD;
&lt;p&gt;I hope this helps!&lt;/p&gt;&#xD;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Chris&lt;/p&gt;</description>
      <pubDate>2019-08-16T00:24:41.5770000</pubDate>
      <link>https://www.aboveunity.com/thread/product-review-pro-micro-atmega32u4-5v-16mhz/</link>
    </item>
  </channel>
</rss>