Free AI web copilot to create summaries, insights and extended knowledge, download it at here
3952
Abstract
SON).</p><p id="4cb7">Let’s quickly review the code.</p><p id="1704">Guided by a fellow programmer and partner of Jungletronics Ishida (<a href="https://github.com/alexishida?tab=repositories">https://github.com/alexishida?tab=repositories</a>) who could point us in the right direction, we modified the output code to JSON. The idea is to connect the Arduino with sensors and to make it serving restful web service.</p><p id="2a04">We will use JSON and HTTP REST as communication protocols. We are very close to this dream !!</p><p id="88e9"><b>Code (<a href="http://goo.gl/9gw6Aw"></a></b><a href="http://goo.gl/9gw6Aw">GitHub </a>REPO<b>):</b></p>
<figure id="8156">
<div>
<div>
<iframe class="gist-iframe" src="/gist/giljr/a82e5defca0bceafd3719ca08d65ba28.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
</div>
</div>
</figure></iframe></div></div></figure><p id="e0b7">We carry the necessary libs. There are two variables of our wifi network and set the server on port 80. Standard right?!</p><p id="54d8">We keep a variable for the led but t in the module. We declare the method that handleroot().</p><p id="06af">The setup is used to configure the LED as output, put the serial in 115200, firmware standard began our wifi, and print a blank line, according to HTTP protocol.</p><p id="99fa">While the connection is not established, a point is printed on the serial.</p><p id="fb02">MDNS is a simple implementation of multicast DNS query support for an Arduino running on the ESP8266 chip. Only support for resolving address queries is currently implemented.</p><p id="6320">The (This) line <i>server.on</i>: inside this part, we can put how many links we want.</p><p id="88ca">The loop to manage the client session.</p><p id="dfb9">keep watching this video series because we will present the assembly of a board to help you with prototyping this chip. We use little solder. See our result:</p><figure id="3d76"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*EO5sg5RdATtrO7MPAerCzg.jpeg"><figcaption>CADDY — For ESP8266 Module to sit into!!! To program use this <a href="https://www.amazon.com/ESP-01S-ESP8266-Wireless-Adapter-4-5-5-5V/dp/B07KF119YB">USB adapter</a>; To run it use this <a href="https://www.amazon.com/DIYmall-ESP8266-Breakout-Breadboard-Transceiver/dp/B01G6H46UK">one</a>. Or follow <a href="https://readmedium.com/mit-app-inventor-2-meets-esp8266-03-kidserie-fa92cc8ae8a2">this</a> post.</figcaption></figure><p id="f0aa">Collision Condition & Route to Nowhere:</p><figure id="7926"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*5BogWgIQUJvJr6HqJcCFOA.gif"><figcaption>Collision Condition & Route to Nowhere</figcaption></figure><p id="cd73">Let’s assume we want to connect all together: Arduino, ESP8266 via USB cable from your laptop.</p><p id="7277">In this scenario, the Arduino sends to your computer while the</p><p id="04ee">ESP8266 tries to transmit too in the same way.</p><p id="3c4c">Ops!</p><p id="5059">Certainly, data will collide !!!</p><p id="5062">Garbled data cannot be properly interpreted by ESP8266 — You cannot program Arduino or talk to it from your computer while ESP8266 is connected to a computer serial.</p><p id="86d8">Now in another scenario (green on the graph).</p><p id="e489">The computer sends a message to the Arduino.</p><p id="b93b">Oops again!</p><p id="a888">Which route to follow? There are two options!</p><p id="ae93">Who does not know where to go, go nowhere!</p><p id="e8e4">This is a collision condition and route do nowhere scenario!</p><p id="1643">Both try to transmit to the computer at the same time.</p><p id="5f78">ESP8266 will most likely RESET!!!</p><p id="21c7">Now let’s separate the components.</p><p id="1738">First, remove the Atmega chip from Arduino and program ESP8266, or, better, bypass
Options
it!! (see video below)</p><p id="5fe2">Then plug back the ATmega and program the Arduino</p><p id="a342">Simple isn't it?</p><p id="d432">Use module ESP8266 in WiFi and Arduino in standalone mode!!!</p>
<figure id="87ff">
<div>
<div>
<img class="ratio" src="http://placehold.it/16x9">
<iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FhH8t4iPAVJI%3Ffeature%3Doembed&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DhH8t4iPAVJI&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FhH8t4iPAVJI%2Fhqdefault.jpg&key=d04bfffea46d4aeda930ec88cc64b87c&type=text%2Fhtml&schema=youtube" allowfullscreen="" frameborder="0" height="480" width="854">
</div>
</div>
</figure></iframe></div></div></figure><p id="129e">Thanks for watching the video (read this article) !!!</p><p id="8f19">Bye!!!</p><p id="c7e8"><a href="https://drive.google.com/drive/folders/0B8iMbc-iQqlULXhNYWpUUUoteGM?usp=sharing">Download all Project Files</a></p><h2 id="8007">Troubleshooting:</h2><p id="801c">When initiating the upload process in the Arduino IDE, press the Upload Button and simultaneously hold the White Wire connected to RST through 10k Ohms, providing a pulse on the GND. This action should be performed a few seconds before the Arduino indicates the uploading phase, typically during the compilation process. Ensure that the Orange Wire (GPIO0) is grounded during this time.</p><p id="3540">Once the upload is complete, detach the Orange Wire from the GND, allowing it to float momentarily. Subsequently, while opening the Serial Terminal, provide another pulse on the GND using the White Wire. Verify that the Serial Monitor acknowledges the:</p><div id="2f87"><pre>Connecting to <your_wifi_ssid>
……
<span class="hljs-built_in">WiFi</span> connected
<span class="hljs-built_in">Server</span> started
<your_port_number></pre></div><p id="e4f8">Do not forget to edit the code according to your WiFi network;) <your_wifi_ssid> and <your_port_number></your_port_number></your_wifi_ssid></p><p id="5094">Based on: Renato Aloi’s <a href="http://renatoaloi.blogspot.com.br/2016/01/esp8266-no-arduino-ide.html">Tutorial</a> (Thanks a lot for your hard work Aloi!!!)</p><p id="d531">Migrate from: <a href="http://jungletronics.blogspot.com.br/">http://jungletronics.blogspot.com.br/</a></p><h1 id="acf7">Related Posts</h1><p id="54d1">Meet IoT Boards: ESP8266 & ESP32 —<a href="https://readmedium.com/meet-iot-boards-esp8266-esp32-ba12e41c1a3b"> <b>Which are the best? ESPs or RPis or Arduino Boards?</b> </a>IoT — Episode #01</p><p id="dc72"><a href="https://readmedium.com/arduino-headless-setup-esp-8266-wifi-cheap-chip-16-arduserie-ffaecf77729a"><b>Arduino Headless Setup & ESP8266</b></a> (WIFI cheap chip!) — Rather Stunning MCU!!! — #arduSerie 16</p><p id="3892"><a href="https://readmedium.com/flashing-the-official-espressif-firmware-in-esp8266-arduserie-17-2234fc088076"><b>Flashing The Official ESPRESSIF Firmware in ESP8266 !!! — Easy ESP8266 Flashing!!!</b></a> — #arduSerie 17</p><p id="1753"><a href="https://readmedium.com/get-started-using-at-commands-w-esp8266-arduserie-19-a09f20571b08"><b>Get Started Using AT Commands w/ ESP8266 — Multiple Connection as TCP Server </b></a>— #arduSerie 19</p><p id="e2da"><a href="https://readmedium.com/your-first-nodemcu-lua-script-flash-on-esp8266-e614b33a6de1"><b>Your First NodeMCU/Lua Script Flash on ESP8266!!!</b> </a>— Let’s get our feet wet with NodeMCU/Lua and see what happens !!- #arduSerie 20</p><p id="b017"><i>— Edited in Nov 2018 — Grammar corrections w/ <a href="http://www.grammarly.com/">Grammarly </a>— Send code to gist —</i>Troubleshooting<i> —</i></p><p id="8c1a"><i>— Edited on Jan 2024 — Grammar corrections w/ <a href="http://www.grammarly.com/">Grammarly</a> and some links to adapter —</i></p></article></body>