<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anuj Dev on Medium]]></title>
        <description><![CDATA[Stories by Anuj Dev on Medium]]></description>
        <link>https://medium.com/@anujdev11?source=rss-bfa5759b3d42------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aTG8NT4tzXqma_V1mRD7wQ.png</url>
            <title>Stories by Anuj Dev on Medium</title>
            <link>https://medium.com/@anujdev11?source=rss-bfa5759b3d42------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 05:01:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anujdev11/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Design Challenge Reflection on End Hunger and Promote Sustainable Agriculture.]]></title>
            <link>https://medium.com/@anujdev11/design-challenge-reflection-on-end-hunger-and-promote-sustainable-agriculture-392cde385ec1?source=rss-bfa5759b3d42------2</link>
            <guid isPermaLink="false">https://medium.com/p/392cde385ec1</guid>
            <category><![CDATA[agriculture]]></category>
            <category><![CDATA[end-hunger]]></category>
            <category><![CDATA[food-security]]></category>
            <category><![CDATA[design-challenge]]></category>
            <category><![CDATA[sustainable-development]]></category>
            <dc:creator><![CDATA[Anuj Dev]]></dc:creator>
            <pubDate>Sat, 19 Mar 2022 22:38:51 GMT</pubDate>
            <atom:updated>2022-03-19T22:42:49.751Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*KdMlf3zGeXpNXzvWfov3iQ.png" /></figure><h3>Articulation:</h3><p>Extreme hunger and malnutrition continue to be an obstacle to long-term development. People who are hungry or malnourished are less productive, more susceptible to disease, and hence unable to earn more money or better their living conditions [1]. There are More than 800 million people worldwide who are undernourished, while more than a billion tons of food never make it to the table. In Canada itself, approximately 4.8 million or 13% of the population, do not have consistent access to safe, high-quality, nutritious foods. Additionally, we all wish for enough healthy and safe food for our families. Moreover, A world without hunger will eventually benefit our economy, health, education, equality, and social progress [1]. It’s crucial for ensuring a brighter future for everyone. Solving the Zero Hunger challenge will solve many other sustainable goals such as Education and Health. Therefore, this challenge is an essential key to future development.</p><h3>Objectives and Constraints:</h3><p>The Zero Hunger challenge aims to eliminate hunger and ensure that all people — especially children and the more vulnerable — have access to enough nutritious food by 2030. This entails encouraging sustainable agriculture practices, such as strengthening small-scale farmers’ livelihoods and capacities by providing equal access to land, technology, and markets. Moreover, the food and agriculture industries are crucial in the fight against hunger and poverty.</p><p>There are two biggest challenges involved while achieving the objectives of the challenge.</p><p>1. Climate Change</p><p>2. Poverty</p><p>Climate change has influenced agricultural activities worldwide, generating unfavorable conditions for food production. Changing temperatures, irregular rainfall, and an increase in the frequency of extreme events have all had an impact on agricultural activities. For example, growing populations will raise demand for water and food, but long-term extreme events like droughts will put further strain on already precious water supplies and lower crop output. Additionally, Global hunger is primarily caused by poverty. Millions of individuals in developing nations cannot afford the land or farming materials they need to grow or else obtain nutritious food due to unequal income distribution and a lack of resources. Moreover, Food waste is also becoming more of a problem, jeopardizing efforts to combat hunger and malnutrition. Food waste is expected to amount to 1.6 billion tones of primary product equivalents globally, according to the FAO [2]. Such practices obstruct the achievement of the zero-hunger goal.</p><h3>Resources Available to Develop a Solution:</h3><p>Governments, non-governmental organizations, and global leaders from all sectors must collaborate to identify solutions to world hunger to successfully combat chronic food insecurity.</p><p><strong>1.</strong> <strong>Sustainable Agriculture</strong></p><p>It’s past time to reconsider how we grow, distribute, and consume food. Agriculture, forestry, and fisheries, when properly managed, can produce enough healthy food for everyone on the earth while simultaneously creating sustainable income and safeguarding the environment.</p><p><strong>2.</strong> <strong>Climate Resilience</strong></p><p>Our seas, freshwater supplies, forests, soil, and biodiversity are all eroding at an alarming rate. Climate change is putting more strain on these vital resources while also increasing the dangers of catastrophic disasters. We must discover strategies to enhance farming systems and livelihoods throughout the world as these extremes and variabilities are projected to prevail in the future.</p><h3>Initial Survey of Existing or Related Solutions:</h3><p>The most variable solution here would be sustainable agriculture so farmers will be able to produce an ample food supply to feed their families and earn from the markets. To achieve sustainable agriculture, developing an IoT-based remote sensing system that collects data from sensors installed along with farms, such as weather stations, and sends it to an analytical tool for examination. Farmers can keep an eye on their crops using an analytical dashboard and act depending on what they learn.</p><p><strong>1.</strong> <strong>Crop Monitoring</strong></p><p>Sensors installed along the fields track changes in light, humidity, temperature, shape, and growth of the crops. Sensors identify any anomalies, which are examined, and the farmer is alerted. As a result, remote sensing can aid in disease prevention and crop growth monitoring.</p><p><strong>2.</strong> <strong>Weather conditions</strong></p><p>Sensor data on humidity, temperature, moisture precipitation, and dew detection helps farmers determine weather patterns so that the right crops may be grown.</p><p><strong>3.</strong> <strong>Soil quality</strong></p><p>The examination of soil quality aids in evaluating the nutritional value and drier parts of farms, as well as soil drainage capacity and acidity, allowing for the adjustment of irrigation water requirements and the selection of the most advantageous form of cultivation.</p><h3>5 obstacles that are anticipated will exist in the further conceptualization and technical development of a solution:</h3><ol><li>The integration of the sensors, as well as the connection of sensor data to the analytics system.</li></ol><p>2. How the use of data analytics, when combined, may lower the overall cost of agriculture, and contribute to increased production from the same amount of land by controlling water, fertilizer, and light more precisely.</p><p>3. Establishing a communications network capable of integrating a huge number of sensors over a broad region of the countryside.</p><p>4. Land topography, wind, and rain can all have an impact on point-to-point communications.</p><p>5. Most farms are in rural areas where internet access may be insufficient to support high transmission speeds.</p><h3>References:</h3><p>[1]<em> </em>“ZERO HUNGER: WHY IT MATTERS,” <em>Un.org</em>, 2018. [Online]. Available: <a href="https://www.un.org/sustainabledevelopment/wp-content/uploads/2018/09/Goal-2.pdf">https://www.un.org/sustainabledevelopment/wp-content/uploads/2018/09/Goal-2.pdf</a>. [Accessed: 05- Feb- 2022].</p><p>[2] L. Adhikari,<em> </em>“Achieving zero hunger by 2030: difficult, not impossible,” <em>ICIMOD</em>, 2018. [Online]. Available: <a href="https://www.icimod.org/article/achieving-zero-hunger-by-2030-difficult-not-impossible/#:~:text=%E2%80%9CIt%20always%20seems%20impossible%20until,World%20is%20possible%20by%202030">https://www.icimod.org/article/achieving-zero-hunger-by-2030-difficult-not-impossible/#:~:text=%E2%80%9CIt%20always%20seems%20impossible%20until,World%20is%20possible%20by%202030</a>. [Accessed: 07- Feb- 2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=392cde385ec1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[COMMUNICATION BETWEEN ARDUINO AND RASPBERRY PI USING NRF24L01]]></title>
            <link>https://medium.com/@anujdev11/communication-between-arduino-and-raspberry-pi-using-nrf24l01-818687f7f363?source=rss-bfa5759b3d42------2</link>
            <guid isPermaLink="false">https://medium.com/p/818687f7f363</guid>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[nrf24l01]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[ultrasonic-sensor]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Anuj Dev]]></dc:creator>
            <pubDate>Fri, 29 May 2020 12:45:51 GMT</pubDate>
            <atom:updated>2020-05-29T12:45:51.357Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*Gj4PqjnT2TO3KcXi3K8UmQ.png" /></figure><p><strong>1.</strong> <strong>Summary:</strong></p><ul><li>This blog walks you through the process of how to communicate an Arduino and a Raspberry Pi with nRF24L01 module. To Start off We will be learning Some basics of Raspberry Pi then we will have a look at Headless Raspberry Pi setup. For the Implementation firstly, we will understand the simple communication of Arduino to Arduino then we will learn Arduino to the raspberry pi.</li><li>I found many guides to accomplish this around the Internet, but none of them was complete or fully worked for me. Here we will understand step by step guide of this process. And at the end will be showing a working example for the same</li></ul><p><strong>2.</strong> <strong>Required Components:</strong></p><ul><li>Ultrasonic Sensor</li><li>2 Arduino Uno</li><li>Raspberry Pi 3</li><li>2 nRF24l01 transmitter and receiver</li><li>Jump wires</li><li>Arduino cable</li><li>MINI USB 2.0 for Pi</li><li>Breadboard</li></ul><p><strong>3.</strong> <strong>Required Software:</strong></p><ul><li>Raspbian for pi</li><li>Arduino IDE or Visual Studio</li><li>Putty on a remote computer for SSH</li><li>VNC viewer on a remote computer</li></ul><p><strong>4.</strong> <strong>Introduction to Raspberry Pi 3:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*dAWXeYMf3c-YB-QV_iCfOw.png" /></figure><p><strong>4.1.</strong> <strong>Components Specifications:</strong></p><ul><li>1.4 GHz 64-bit quad-core ARM Cortex-A53, 1GB RAM</li><li>2.4/5Ghz dual-band 802.11ac Wireless LAN, 10/100/1000Mbps Ethernet Bluetooth 4.2</li><li>4 USB ports, Full HDMI port, Combined 3.5mm audio jack and composite video port, 40 GPIO pins</li><li>Micro SD card slot, Video Core IV 3D graphics core, Camera interface (CSI), Display interface (DSI)</li></ul><p><strong>4.2 Raspberry Pi Pinout:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*iVsxvq4lLjYCeeDYMwJuyA.png" /></figure><p><strong>4.3.</strong> <strong>Headless Raspberry Pi Setup:</strong></p><ul><li>Say, I just bought a raspberry pi and wish to check out how it works. But all I have is my Laptop, the Pi, a micro SD card, and my Wi-Fi network. How do I connect and control the Pi?</li></ul><p>1) Download Raspbian:</p><ul><li>Your Pi needs an OS. Download Raspbian from Raspberrypi.org ‘s download section:</li><li><a href="https://www.raspberrypi.org/downloads/raspbian/">https://www.raspberrypi.org/downloads/raspbian/</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*4QuS_J25mK86h1TM7oWppg.png" /></figure><p>2) Download SD Memory Card Formatter:</p><ul><li>It is used to format the SD card as it is needed that the SD card should be empty before the flashing image you downloaded. You can download it from <a href="https://www.sdcard.org/downloads/formatter/eula_windows/">https://www.sdcard.org/downloads/formatter/eula_windows/</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*EIq8QCDpn2IiJE_a_OrZ-Q.png" /></figure><p>3) Flash it onto an SD card:</p><ul><li>You need to flash this downloaded image to the micro SD card. Assuming your laptop has an SD card slot or a micro Sd card reader, you need a flashing software like etcher. Go ahead and download from <a href="https://etcher.io/">https://etcher.io/</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*lssBEMIKCGBwUSQ1d_diCQ.png" /></figure><p>4) Configure Wi-Fi:</p><ul><li>It’s easier to make two devices talk to each other if they are in the same network. An ethernet cable can easily make your laptop’s network available to the Pi. But we don’t have one. So, we are going to add a file to the SD card so that the Pi boots with a wifi pre-configured.</li><li>The SD card mounts as two volumes boot and rootfs . Open the boot volume and create a file named wpa_supplicant.conf on booting the RPi, this file will be copied to /etc/wpa_supplicant directory in /rootfs partition. The copied file tells the Pi the WIFI setup information. This would overwrite any existing WIFI configuration, so if you had already configured WIFI on the pi, then that will be overwritten.</li><li>A typical wpa_supplicant.conf file is as follows:</li></ul><pre>ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev</pre><pre>update_config=1</pre><pre>country=US</pre><pre>                                                                                                                                                         network={</pre><pre>    ssid=&quot;«your_SSID»&quot;</pre><pre>    psk=&quot;«your_PSK»&quot;</pre><pre>    key_mgmt=WPA-PSK</pre><pre>}</pre><p>NOTE: Your SSID is your WIFI’s name. And psk is the password of the WI-FI.</p><p>5) Enable SSH</p><ul><li>We will later access the Pi using a secured shell (SSH), SSH is disabled by default in Raspbian. To enable SSH, create a file named ssh in the boot partition. If you are on Linux, use the touch command to do that.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*33ZPgasLF3nkknPhuPxJTg.png" /></figure><p>6) Find Pi’s Ip address:</p><ul><li>Before switching on your raspberry pi, we need to find out the existing devices connected to the network. Make sure your laptop is connected to the same WIFI network as the one you configured on pi above.</li><li>Download the Advanced IP Scanner to scan the IP of our raspberry pi. You can download it from here <a href="https://www.advanced-ip-scanner.com/">https://www.advanced-ip-scanner.com/</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*Nj_Xf-STiAaHudT99JShdA.png" /></figure><p>7) SSH into your Pi:</p><ul><li>To create a secured shell connection in Linux we can use the ssh command. If you are on windows, try downloading Putty from <a href="https://www.putty.org/">https://www.putty.org/</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*N_iJ7LUO6hHOVefOWpNLpQ.png" /></figure><p>Default credentials are:</p><pre>username: pi</pre><pre>password: raspberry</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*ZuhCGti_vryI1Nbi3V7gkQ.png" /></figure><p>8) Access Pi remotely:</p><ul><li>Sometimes it doesn’t feel right if we can’t use the mouse. For that, we need to look into the Raspbian desktop.</li><li>We need to setup VNC (Virtual Network Connection) to see and control Pi graphically. Let’s do that.</li><li>To access the remote desktop, you need VNC-viewer (client) for your laptop. Fortunately, RealVNC is available for a lot of OSes, pick one for your OS from <a href="https://www.realvnc.com/en/connect/download/viewer/">https://www.realvnc.com/en/connect/download/viewer/</a></li></ul><p>9) Commands for vncserver:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*vbpTsGcorI33aJAtXNwCyg.png" /></figure><p>10) Now open VNC Viewer on your remote computer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*MqcxuuR-GTrtuoCyc2WOSg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*fWvLEJvT2uWpFpio--gmrw.png" /></figure><p><strong>5. Implementation and Working:</strong></p><p><strong>5.1. Wireless communication of Arduino to Arduino with nRF24L01:</strong></p><ul><li>In this, we will learn how to make wireless communication between two Arduino boards using the NRF24L01. And measure distance with ultrasonic sensor and transmit it to another Arduino with transceiver module.</li></ul><p><strong>Wiring Instructions:</strong></p><p>To wire your NRF24L01+ wireless Sender to your Arduino, connect the following pins:</p><ul><li>Connect the VCC pin to 3.3 Volts</li><li>Connect the GND pin to ground (GND)</li><li>Connect the CE pin to Arduino 9</li><li>Connect the CSN pin to Arduino 10</li><li>Connect the SCK pin to Arduino 13</li><li>Connect the MOSI pin to Arduino 11</li><li>Connect the MISO pin to Arduino 12</li></ul><p>To wire your ultrasonic sensor to your Arduino, connect the following pins:</p><ul><li>Connect the VCC pin to Arduino 5Volts</li><li>Connect the GND pin to ground (GND)</li><li>Connect the Trig pin to Arduino 4</li><li>Connect the Echo pin to Arduino 3</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*Ulfpt1xa2oOqC71qDRFaBA.png" /><figcaption>Schematic Diagram for wiring of Arduino Uno with ultrasonic sensor and NRF24L01</figcaption></figure><p>To wire your NRF24L01+ wireless sender to your Arduino, connect the following pins:</p><ul><li>Connect the VCC pin to 3.3 Volts</li><li>Connect the GND pin to ground (GND)</li><li>Connect the CE pin to Arduino 9</li><li>Connect the CSN pin to Arduino 10</li><li>Connect the SCK pin to Arduino 13</li><li>Connect the MOSI pin to Arduino 11</li><li>Connect the MISO pin to Arduino 12</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*_krTONSBIYCG4CrhCpGJXw.png" /><figcaption>Schematic Diagram for wiring of Arduino Uno NRF24L01</figcaption></figure><p>NOTE: RF24 module is mandatory for the code to run so you can add the library accordingly</p><ul><li>Start Arduino IDE then add the Downloaded Library from Here :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*5U_d7pSUhREQYqBLODKElQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*TwKFZhTAIfHE0KrJ_7WeLw.png" /></figure><p><strong>5.2. Code:</strong></p><p><strong>Sender Side code:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b2ec25d9f53f5673b4f2ac0b42c89855/href">https://medium.com/media/b2ec25d9f53f5673b4f2ac0b42c89855/href</a></iframe><p><strong>Receiver Side code:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69434a6acbb9062437daeba46a711ce2/href">https://medium.com/media/69434a6acbb9062437daeba46a711ce2/href</a></iframe><p><strong>Sending the Data</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*_0_oKYVD_SaQOGsX1c1vyA.png" /></figure><p><strong>Receiving the data:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*9WZ9Zucl-SKZ_nfNCFUqNQ.png" /></figure><p><strong>6</strong>. <strong>Wireless communication of Arduino to Raspberry Pi with nRF24L01:</strong></p><p><strong>6.1: Installation of RF24 Module on Raspberry Pi:</strong></p><ul><li>It is the most important and foremost step for any Communication to work between Arduino and Raspberry Pi as we have used RF24 library in Arduino for communication so the same Library is needed on Pi.</li><li>Further are the steps to which involve the installation of the Library. It took me almost one week to install it as no clear idea about it is present.</li></ul><p>=&gt; <strong>Way to go:</strong></p><p>1. Login to Raspberry Pi using Putty.</p><p>2. Go to the VNC server for GUI.</p><p>3. In the terminal type:</p><pre>sudo raspi-config</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Q66n-57_zkO7FJ4Vv0GbZg.png" /></figure><p>Turn on SPI from Interfacing options in config</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*MY8-MZ_3S1hC-QcsB28E7w.png" /></figure><p>4. Reboot the Pi. In the terminal, type:</p><pre>sudo reboot</pre><p>5. In the terminal type:</p><pre>sudo apt-get update</pre><p>6. Download the install.sh file from <a href="http://tmrh20.github.io/RF24Installer/RPi/install.sh">http://tmrh20.github.io/RF24Installer/RPi/install.sh</a> or Run this on terminal:</p><pre>wget <a href="http://tmrh20.github.io/RF24Installer/RPi/install.sh">http://tmrh20.github.io/RF24Installer/RPi/install.sh</a></pre><p>7. Make it executable:</p><pre>chmod +x install.sh</pre><p>8. Run it and choose your options:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*4TK6UBNNIPl0Ygy-7LVX6g.png" /></figure><p>9. Run an example from one of the libraries:</p><pre>cd rf24libs/RF24/examples_linux                                                                                                           make                                                                                                                                                                     sudo ./gettingstarted</pre><p>Run Following Commands to run the program.</p><p>10. Further, if we want to run Python Programs for the same purpose, we can do this:</p><p>Running the Example Edit the pingpair_dyn.py example to configure the appropriate pins per the above documentation:</p><pre>nano pingpair_dyn.py</pre><ul><li>Configure another device, Arduino or RPi with the pingpair_dyn example</li><li>Run the example</li></ul><pre>sudo python pingpair_dyn.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*lRgdOCgUlQwxZcILrj_Acw.png" /></figure><p><strong>6.2. Wireless communication of Arduino to Arduino with nRF24L01:</strong></p><ul><li>In this, we will learn how to make wireless communication between Arduino and Raspberry Pi using the NRF24L01. And measure distance with an ultrasonic sensor with the help of Arduino Uno and transmit it to Raspberry Pi and Data is received.</li></ul><p><strong>Wiring Instructions:</strong></p><p>To wire your NRF24L01+ wireless Sender to your Arduino, connect the following pins:</p><ul><li>Connect the VCC pin to 3.3 Volts</li><li>Connect the GND pin to ground (GND)</li><li>Connect the CSN pin to Arduino 10</li><li>Connect the CE pin to Arduino 9</li><li>Connect the SCK pin to Arduino 13</li><li>Connect the MISO pin to Arduino 12</li><li>Connect the MOSI pin to Arduino 11</li></ul><p>To wire your ultrasonic sensor to your Arduino, connect the following pins:</p><ul><li>Connect the VCC pin to Arduino 5Volts</li><li>Connect the GND pin to ground (GND)</li><li>Connect the Trig pin to Arduino 4</li><li>Connect the Echo pin to Arduino 3</li></ul><p><strong>Schematic Diagram:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*Xa1IkRpMM8tbygaPjj7CmQ.png" /><figcaption>Schematic Diagram for wiring of Arduino Uno with ultrasonic sensor and NRF24L01</figcaption></figure><p>To wire your NRF24L01+ Wireless Receiver to your Raspberry Pi, connect the following pins:</p><ul><li>Connect the VCC pin to 3.3 Volts (Pin 1)</li><li>Connect the GND pin to ground (GND) (Pin 6)</li><li>Connect the CE pin to Raspberry GPIO 22</li><li>Connect the CSN pin to Raspberry GPIO 8</li><li>Connect the SCK pin to Raspberry GPIO 11</li><li>Connect the MOSI pin to Raspberry GPIO 10</li><li>Connect the MISO pin to Raspberry GPIO 09</li></ul><p><strong>Schematic Diagram:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*ji9WlbpKkdmaijujLpjnNg.png" /><figcaption>Schematic Diagram for wiring of Raspberry Pi and NRF24L01</figcaption></figure><p><strong>6.3. Code:</strong></p><p><strong>Sender Side Code:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7deae0b2db9e68230607ad9df3bbd394/href">https://medium.com/media/7deae0b2db9e68230607ad9df3bbd394/href</a></iframe><p><strong>Receiver Side Code:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/da8ad4af9cf87b0609986ae4d0ba08cc/href">https://medium.com/media/da8ad4af9cf87b0609986ae4d0ba08cc/href</a></iframe><ul><li>It&#39;s not mandatory to use this code as it is tweaked by me as per my requirement.</li></ul><p>To check the proper functioning of your connection and code you can run the examples present in the library like pingpair_dyn.ino on your Arduino and pingpair_dyn.py on Raspberry Pi</p><ul><li>The snippet of my running communication:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*DPKfncY29GZJH_u_D4W5-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*IH5-1kaiYFyRGgVVp7kc1w.png" /></figure><p><strong>Conclusion:</strong> It will be always fun experimenting and playing with the IoT Devices such as learning about Headless Raspberry Pi set-up, Arduino, and Raspberry pi by making them communicating with each other and sending data and to overcome the errors and challenges like one I faced while installing RF24 module. The purpose of this tutorial is to serve you with a step-by-step process and hope that it was easy to follow and learn as well. Thank you for reading! Suggestions and Corrections are always welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=818687f7f363" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Greengrass with DynamoDB]]></title>
            <link>https://medium.com/@anujdev11/aws-greengrass-with-dynamodb-9bc098dabd9f?source=rss-bfa5759b3d42------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bc098dabd9f</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-dynamodb]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws-greengrass]]></category>
            <dc:creator><![CDATA[Anuj Dev]]></dc:creator>
            <pubDate>Thu, 28 May 2020 07:12:10 GMT</pubDate>
            <atom:updated>2020-06-02T06:18:08.559Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*y8Kod5rOLhCywjcjYslPYQ.png" /></figure><p><strong>1.</strong> <strong>Introduction: </strong>AWS IoT Greengrass is software that extends cloud capabilities to local devices. This enables devices to collect and analyze data closer to the source of information, react autonomously to local events, and communicate securely with each other on local networks. AWS IoT Greengrass developers can use AWS Lambda functions and store data on DynamoDB. So, for this blog, we will store the local data to DynamoDB using Greengrass on local device.</p><ul><li>As shown in the figure we will follow the further flow in the following manner we have discussed flow before the block in previous blogs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*ei38PL6u6s5GUg7A1YMa6A.png" /></figure><p><strong>2.</strong> <strong>Setup Raspberry pi:</strong></p><ul><li>You can refer our earlier blog <a href="https://medium.com/@anujdev11/communication-between-arduino-and-raspberry-pi-using-nrf24l01-818687f7f363">WIRELESS COMMUNICATION BETWEEN ARDUINO AND RASPBERRY PI USING NRF24L01 Part 2</a> for setting up of the Raspberry Pi or visit the AWS documentation for Setting up of the Raspberry Pi <a href="https://docs.aws.amazon.com/greengrass/latest/developerguide/setup-filter.rpi.html">https://docs.aws.amazon.com/greengrass/latest/developerguide/setup-filter.rpi.html</a></li></ul><p>1)You are now ready to set up the Raspberry Pi for AWS IoT Greengrass. First, run the following commands from a local Raspberry Pi terminal window or an SSH terminal window:</p><pre>sudo adduser --system ggc_user</pre><pre>sudo addgroup --system ggc_group</pre><p>2) To improve security on the Pi device, enable hard link and soft link protection on the operating system at startup.</p><pre>cd /etc/sysctl.d</pre><pre>ls</pre><p>a)Navigate to the 98-rpi.conf file</p><p><strong>Note:</strong> <strong>If you don’t see the 98-rpi.conf file, follow the instructions in the README.sysctl file.</strong></p><p>b)Use a text editor (such as Leafpad, GNU nano, or vi) to add the following two lines to the end of the file. You might need to use the Sudo command to edit as root (for example, sudo nano 98-rpi.conf).</p><pre>fs.protected_hardlinks = 1</pre><pre>fs.protected_symlinks = 1</pre><p>3) Reboot the Pi.</p><p>4)After about a minute, connect to the Pi using SSH and then run the following command to confirm the change:</p><pre>sudo sysctl -a 2&gt; /dev/null | grep fs.protected</pre><p>You should see fs.protected_hardlinks = 1 and fs.protected_symlinks = 1.</p><p>5) Edit your command line boot file to enable and mount memory cgroups. This allows AWS IoT Greengrass to set the memory limit for Lambda functions.</p><p>a)Navigate to your boot directory.</p><pre>cd /boot/</pre><p>b)Use a text editor to open cmdline.txt. Append the following to the end of the existing line, not as a new line.</p><pre>cgroup_enable=memory cgroup_memory=1</pre><p>c) Now reboot the Pi.</p><p>6) Your Raspberry Pi should now be ready for AWS IoT Greengrass.</p><p>7) To make sure that you have all required dependencies, download and run the Greengrass dependency checker from the <a href="https://github.com/aws-samples/aws-greengrass-samples">AWS IoT Greengrass Samples</a> repository on GitHub. These commands unzip and run the dependency checker script in the Downloads directory.</p><pre>cd /home/pi/Downloads</pre><pre>mkdir greengrass-dependency-checker-GGCv1.9.x</pre><pre>cd greengrass-dependency-checker-GGCv1.9.x</pre><pre>wget <a href="https://github.com/aws-samples/aws-greengrass-samples/raw/master/greengrass-dependency-checker-GGCv1.9.x.zip">https://github.com/aws-samples/aws-greengrass-samples/raw/master/greengrass-dependency-checker-GGCv1.9.x.zip</a></pre><pre>unzip greengrass-dependency-checker-GGCv1.9.x.zip</pre><pre>sudo modprobe configs</pre><pre>sudo ./check_ggc_dependencies | more</pre><p>Where more appears, press the Spacebar key to display another screen of text.</p><p><strong>3.</strong> <strong>Installing the AWS IoT Greengrass Core Software:</strong></p><ul><li>This shows you how to install the AWS IoT Greengrass Core software on your device. This tutorial provides instructions for setting up a Raspberry Pi, but you can use any supported device.</li><li>Below is a step by step link provided by AWS Greengrass documentation to install its software on core device</li></ul><p><a href="https://docs.aws.amazon.com/greengrass/latest/developerguide/module2.html">https://docs.aws.amazon.com/greengrass/latest/developerguide/module2.html</a></p><ul><li>You will be following the whole module until the Greengrass is successfully running on the core device.</li><li>The end result should look like this.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*tspCgnJlqELzuOhmQwRYXQ.png" /></figure><p><strong>4.</strong> <strong>Lambda Functions on AWS IoT Greengrass with DynamoDB:</strong></p><p><strong>Step1: Configure IAM Roles:</strong></p><ul><li>When you create Lambda functions that access AWS services, you must grant sufficient permissions in the Greengrass group role to allow the functions to access those services. The group role is an IAM role that you attach to your group.</li><li>In this module, you create a role that allows a Greengrass Lambda function to access DynamoDB. For more information about IAM, see the <a href="https://aws.amazon.com/documentation/iam/">AWS Identity and Access Management documentation</a>.</li></ul><p>1. In the IAM console, in the navigation pane, choose <strong>Roles</strong>, and then choose <strong>Create Role</strong>.</p><p>2. <strong>Select type of trusted entity</strong>, choose <strong>AWS service</strong>.</p><p>3. Under <strong>Choose the service that will use this role</strong>, choose <strong>Greengrass</strong>, and then choose <strong>Next: Permissions</strong>.</p><p>4. On the <strong>Attach permissions policies</strong> page, select the following policies, and then choose Next: <strong>Tags</strong>.</p><ul><li><strong>AWSGreengrassResourceAccessRolePolicy</strong></li><li><strong>AWSGreengrassFullAccess</strong></li><li><strong>AmazonDynamoDBFullAccess</strong></li></ul><p>5. Choose <strong>Next: Review</strong>. You don’t need to create tags for this tutorial.</p><p>6. Enter the following values, and then choose <strong>Create role.</strong></p><ul><li><strong>For Role name, enter Greengrass_DynamoDB_Role.</strong></li><li><strong>For Role description, enter Greengrass group role.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*LKyq-L9EJFGVvrh1tcuvUA.png" /></figure><p>7. Repeat the previous step to create the role for the <strong>AWS Lambda service</strong>. Select the same policies (<strong>AWSGreengrassResourceAccessRolePolicy, AWSGreengrassFullAccess, andAmazonDynamoDBFullAccess</strong>). For <strong>Role name</strong>, enter <strong>Lambda_DynamoDB_Role.</strong></p><p>8. In the AWS IoT Core console, under <strong>Greengrass</strong>, choose <strong>Groups</strong>, and then choose your AWS IoT Greengrass group.</p><p>9. Choose <strong>Settings</strong>, and then choose <strong>Add Role.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*uEugNpZr5kTSJe1ngtDuTA.png" /></figure><p>10. Choose <strong>Greengrass_DynamoDB_Role</strong> from the list of roles, and then choose <strong>Save.</strong></p><p><strong>Step2: Create and Configure the Lambda Function:</strong></p><p>1. In this step, you create a Lambda function that sends the water level to send by Arduino to Raspberry Pi, the Lambda function is created in such a way that the table is created and the data which is useful that is stored in DynamoDB table.</p><p>2. On your computer, create a folder named <strong>AWS-Greengrass-With-DynamoDB</strong></p><p>3. From the <a href="https://github.com/anujdev11/AWS-Greengrass-With-DynamoDB"><strong>AWS-Greengrass-With-DynamoDB</strong></a><strong> </strong>repository on GitHub, download the greengrassHelloWorld.py function to the <strong>AWS-Greengrass-With-DynamoDB</strong> folder.</p><p>4. To run on an AWS IoT Greengrass core, a Python Lambda function requires the AWS IoT Greengrass Core SDK for Python. For this tutorial, you include the greengrasssdk folder in the Lambda function deployment package.</p><p>5. Download the AWS IoT Greengrass Core SDK for Python from the <a href="https://github.com/aws/aws-greengrass-core-sdk-python">AWS IoT Greengrass Core SDK downloads page</a>. In the Python section, choose v1.4.0 — Current version (on GitHub) and then download the SDK.</p><p>6. Unzip the downloaded package to get the SDK.</p><ul><li>The greengrasssdk folder. This is the SDK.</li></ul><p>7. Copy <strong>greengrasssdk</strong> to <strong>AWS-Greengrass-With-DynamoDB</strong> the folder that contains greengrassHelloWorld.py.</p><p>8. Run the following command in a command-line window to install the boto3 (AWS SDK for Python) package and its dependencies in the AWS-Greengrass-With-DynamoDB folder.</p><pre>pip install boto3 -t <strong>path-to- AWS-Greengrass-With-DynamoDB -folder</strong></pre><p>This results in a directory listing similar to the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*oszQYYeTkUoFNo8HVffQLQ.png" /></figure><p>Greengrass Lambda functions use the AWS SDK to access other AWS services. For more information, see <a href="https://github.com/boto/boto3/blob/develop/README.rst">Boto 3 — The AWS SDK for Python</a>.</p><p>9. Compress the contents of the AWS-Greengrass-With-DynamoDB folder into a .zip file named <strong>hello_world_python_lambda.zip</strong>. (Compress the folder’s contents, not the folder.) This is your Lambda function deployment package.</p><p>10. Open the Lambda console and choose Create function.</p><p>11. Choose Author from scratch.</p><p>12. Name your function <strong>Greengrass_HelloWorld</strong>, and set the remaining fields as follows:</p><ul><li>Open the Lambda console and choose <strong>Create function</strong>.</li><li>Choose <strong>Author from scratch.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*DVRD5dip4qBMhh62ZFetcA.png" /></figure><p>13. Choose <strong>Create function.</strong></p><p>14. Upload your Lambda function deployment package:</p><p>a) On the <strong>Configuration</strong> tab, under <strong>Function code</strong>, set the following fields:</p><p>i. For Code entry type, choose Upload a .zip file.</p><p>ii. For Runtime, choose Python 2.7.</p><p>iii. For Handler, enter <strong>greengrassHelloWorld.function_handler</strong></p><p>b) Choose <strong>Upload</strong>, and then choose hello_world_python_lambda.zip. (The size of your hello_world_python_lambda.zip file might be different from what’s shown here.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*In6VXC1yNfw77Ynq3Gdovg.png" /></figure><p>c) Choose <strong>Save.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*fO-VGejTzBbskemiM417FA.png" /></figure><p><strong>Note</strong></p><p>The Test button on the <strong>AWS Lambda</strong> console doesn’t work with this function. The AWS IoT Greengrass Core SDK doesn’t contain modules that are required to run your <strong>Greengrass </strong>Lambda functions independently in the AWS Lambda console.</p><p><strong>Tip</strong></p><p>To see your uploaded code, from <strong>Code entry type</strong>, choose Edit code <strong>inline</strong>.</p><p>15. <strong>Publish</strong> the Lambda function:</p><p>a) From <strong>Actions,</strong> choose <strong>Publish new version</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*hQ_z1-q2Pu3OUhyJkXH9CQ.png" /></figure><p>b) For <strong>Version description</strong>, enter First version, and then choose <strong>Publish</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*usocTptxy53AiFC2o7tS5w.png" /></figure><p>16. Create an <strong>alias </strong>for the Lambda function version</p><p><strong>Note</strong></p><p>Greengrass groups can reference a Lambda function by alias (recommended) or by version. Using an alias makes it easier to manage code updates because you don’t have to change your subscription table or group definition when the function code is updated. Instead, you just point the alias to the new function version.</p><p>a) From <strong>Actions</strong>, choose <strong>Create alias</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*yMYuHK40ptgTjkb1XtB6Xg.png" /></figure><p>b) Name the alias <strong>GG_HelloWorld</strong>, set the version to<strong> 1</strong> (which corresponds to the version that you just published), and then choose <strong>Create.</strong></p><p><strong>Note</strong></p><p>AWS IoT Greengrass doesn’t support Lambda aliases for <strong>$LATEST</strong> versions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*SmQtCQRf-v6THVluyWkffw.png" /></figure><p>17. In the AWS IoT Core console, add the Lambda function that you just created to your AWS IoT Greengrass group:</p><p><strong>a)</strong> On the group configuration page, choose<strong> Lambdas</strong>, and then choose <strong>Add Lambda.</strong></p><p>b) Choose <strong>Use existing Lambda.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*fYldIYgMRNBIHSfsxggR1g.png" /></figure><p>18. Choose <strong>Greengrass_HelloWorld</strong>, and then choose<strong> Next.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*ptSHthiQX7QhCtaVXUkbLA.png" /></figure><p>19. For the version, choose Alias: <strong>GG_HelloWorld</strong>, and then choose Finish. You should see the <strong>Greengrass_HelloWorld</strong> Lambda function in your group, using the <strong>GG_HelloWorld</strong> alias.</p><p>20. Choose the ellipsis (…), and then choose Edit <strong>Configuration</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*3n15KY6cvhd0O5uCFpIIUw.png" /></figure><p>21. On the <strong>Group-specific Lambda configuration</strong> page, make the following changes:</p><ul><li>Set <strong>Timeout</strong> to 25 seconds. This Lambda function sleeps for 20 seconds before each invocation</li><li>For <strong>Lambda lifecycle</strong>, choose Make this function <strong>long-lived and keep it running indefinitely</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*UQB_PWGB_XjAt99Jy2yCLA.png" /></figure><p><strong>Note</strong></p><p>A <strong>long-lived</strong> Lambda function starts automatically after AWS IoT Greengrass starts and keeps running in its <strong>own container</strong> (or sandbox). This is in contrast to an <strong>on-demand</strong> Lambda function, which starts when <strong>invoked</strong> and stops when there are no tasks left to execute. For more information, see <a href="https://docs.aws.amazon.com/greengrass/latest/developerguide/lambda-functions.html#lambda-lifecycle">Lifecycle Configuration for Greengrass Lambda Functions</a>.</p><p>22. Keep the default values for all other fields, such as <strong>Run as, Containerization</strong>, and Input <strong>payload data type</strong>, and choose Update to save your changes</p><p>23. Next, create a subscription that allows the Lambda to send <strong>MQTT</strong> messages to AWS IoT.</p><p>A Greengrass Lambda function can exchange MQTT messages with:</p><p><strong>24.</strong> On the group configuration page, choose <strong>Subscriptions</strong>, and then choose <strong>Add your first Subscription.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*slVdMyJtm3UBFo3dzh2yFw.png" /></figure><p>25. In <strong>Select a source</strong>, choose Select. Then, on the<strong> Lambdas</strong> tab, choose <strong>Greengrass_HelloWorld</strong> as the source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*E_6KG18ueEVX-FDp5MyK2w.png" /></figure><p>26. For <strong>Select a target</strong>, choose Select. Then, on the <strong>Service</strong> tab, choose <strong>IoT Cloud</strong>, and then choose <strong>Next.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*aPX6dhMoHyYaIz2kt74VZQ.png" /></figure><p>27. For <strong>Topic filter</strong>, enter <strong>hello/world4</strong>, and then choose <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*CjL55AplU4kvm4V9le9awQ.png" /></figure><p>28. Choose <strong>Finish</strong></p><p><strong>5.</strong> <strong>Deploy Cloud Configurations to an AWS IoT Greengrass Core Device</strong></p><p>To deploy this lambda function on core device refer this link <a href="https://docs.aws.amazon.com/greengrass/latest/developerguide/configs-core.html">https://docs.aws.amazon.com/greengrass/latest/developerguide/configs-core.html</a></p><p><strong>6.</strong> <strong>Verify the Lambda Function Is Running on the Device</strong></p><p>To verify whether everything is running you can refer this link</p><p><a href="https://docs.aws.amazon.com/greengrass/latest/developerguide/lambda-check.html">https://docs.aws.amazon.com/greengrass/latest/developerguide/lambda-check.html</a></p><p><em>Check out my Github to get access to full code: </em><a href="https://github.com/anujdev11/AWS-Greengrass-With-DynamoDB"><em>Github</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bc098dabd9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Static Registration and Login Page with AWS S3]]></title>
            <link>https://medium.com/@anujdev11/static-registration-and-login-page-with-aws-s3-36e487d7856c?source=rss-bfa5759b3d42------2</link>
            <guid isPermaLink="false">https://medium.com/p/36e487d7856c</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[s3-bucket]]></category>
            <dc:creator><![CDATA[Anuj Dev]]></dc:creator>
            <pubDate>Thu, 28 May 2020 05:51:06 GMT</pubDate>
            <atom:updated>2020-05-28T06:21:37.725Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*RxQp8AHsFCXcGgXWF0lN4Q.png" /></figure><p><strong>1. Introduction:</strong></p><p>In this blog, you’ll configure Amazon Simple Storage Service (S3) to host the static resources for your web application. In subsequent modules, you’ll add dynamic functionality to these pages using JavaScript to call remote RESTful APIs built with AWS Lambda and Amazon API Gateway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*iYxnSlw9W6w5djnU.png" /></figure><p><strong>2. Create S3 Bucket:</strong></p><ul><li>Open S3 from Storage Service.</li><li>Create S3 Bucket.</li><li>All of your static web content including HTML, CSS, JavaScript, images, and other files will be stored in Amazon S3.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*AHZ05n50WhhyDHzk.png" /></figure><ul><li>Enter a <strong>unique</strong> name for your Bucket name.</li><li>If the entered name already exists than enter another name.</li><li>We can give the name by adding meaning to it by putting “– “.</li><li>Example: registration-login.</li><li>Now, Click on Create Button located on the left side.</li><li>Then Upload intended files in the bucket.</li><li>Now, Click on Upload located on the left side.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hfrlinJiNrZnx7y_.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/0*PNq2ylv-nfafUng-.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*gRksNPZZJgpHnd7X.JPG" /></figure><p><strong>3. Additional settings:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/0*Btp4FXrTdCBXwDqj.png" /></figure><ul><li>Uncheck to Add Public full access to the webpage, as here we are not taking any confidential details from them. But usually as per requirement check and uncheck it.</li><li>Now, In <strong>Permissions tag:</strong> Go in Bucket Policy to add below code.</li><li>In the confirmation modal that appears, type ‘confirm’, and then click Confirm.</li><li>Then Save the Bucket Policy by Clicking on the Save button located on the right side at the top.</li><li>Now in <strong>Properties tag </strong>Host Static Website Hosting.</li><li>In resource, add your bucket name instead of what I mention here.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/0*aweIH-H4yI6DzVr_.png" /></figure><p><strong>4. Static website hosting:</strong></p><ul><li>From the bucket detail page in the S3 console, choose the <strong>Properties tab</strong>.</li><li>Choose the Static website hosting card. Select Use this bucket to host a website and enter 1-register.html for the Index document.</li><li>Leave the other fields blank. Note the Endpoint URL at the top of the dialog before choosing Save.</li><li>You will use this URL throughout the rest of the workshop to view your web application.</li><li>From here on this URL will be referred to as your website’s base URL.</li><li>Click <strong>Save</strong> to save your changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/0*W1xPi5eElckAT43T.png" /></figure><ul><li>Now, Copy the Endpoint URL.</li><li>Paste it on your Browser to open Registration Page.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ton69d0qBpuMCr-P.png" /></figure><ul><li>This is Registration Page what we have uploaded on the S3 bucket.</li><li>After filling details successfully SIGNUP.</li><li>That will direct you towards Login Page.</li><li>The data entered here will be stored in Dynamo DB which is the database of AWS cloud.</li><li>Using cookie in HTML file, if the user is already registered then by clicking on Login Here, the user will directly have redirected to the login page.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CX5qchIjF2-yyS38.png" /></figure><ul><li>The main use of the registration page is; Particular user can see only their data.</li><li>Using Ajax, API is called, Email Id and password are matched with the data registered in Dynamo DB.</li><li>After Successfully Logged in, the user will see the Raspberry Pi ID and the water Level of Tank.</li><li>The data which is Displayed are fetched from Database and at reload time, the data might be updated as the database update.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QwypqNnTpZ2bEafQ.png" /></figure><p><strong>5. Flow Diagram:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/199/0*Abzvor5Q2c-l1bcB.png" /></figure><p><strong>6. Conclusion:</strong></p><ul><li>After completing these implementation steps you should be able to access your static website by visiting the website endpoint URL for your S3 bucket.</li><li>Usually, people are getting stuck where they have to host their webpage or say website. Whereas AWS service S3 under Storage is useful to host a static website.</li><li>But you might think that how all the entered data are stored in DynamoDB through Lambda Function, then you need to direct to the next blog for further.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36e487d7856c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>