RoadTest: Adafruit Feather HUZZAH Dev Bd
Author: redcharly
Creation date:
Evaluation Type: Development Boards & Tools
Did you receive all parts the manufacturer stated would be included in the package?: True
What other parts do you consider comparable to this product?:
What were the biggest problems encountered?: No problems
Detailed Review:
Adafruit Feather HUZZAH is a very well known and widespread card and there are many examples of applications on the Internet.
My roadtesting work will be carried out in the form of a simple lesson for students who are starting to learn about the world of electronics, networks, and IoT.
A board slightly larger than an Arduino Nano allows the creation of an Access Point and connection to WiFi networks.
There are dozens of possible applications but, after a theoretical introduction to the characteristics of the board, I would immediately move on to the laboratory part.
{gallery} Unpacking the board |
---|
the Adafruit Feather HUZZAH is a very widespread card on the net and the main information can be obtained from the site: https://learn.adafruit.com/adafruit-feather-huzzah-esp8266/overview.
I will limit myself to listing the most important characteristics of the Adafruit Feather HUZZAH: those wishing to learn more can obviously do so on the site mentioned above.
The Adafruit Feather HUZZAH board has the following features:
The ESP8266 runs on 3.3V power and logic, and unless otherwise specified, GPIO pins are not 5V safe! The analog pin is also 1.0V max.
Feathers are shipped fully tested but without headers attached - this gives you the most flexibility on choosing how to use and configure your Feather
The site: https://learn.adafruit.com/adafruit-feather-huzzah-esp8266/assembly
describes which headers can be used to connect the card. Different solutions are proposed to choose from according to your needs.
{gallery} Feather Assembly |
---|
The two primary ways for powering a feather are a 3.7/4.2V LiPo battery plugged into the JST port or a USB power cable.
If you need other ways to power the Feather, here's what we recommend:
For permanent installations, a 5V 1A USB wall adapter will let you plug in a USB cable for reliable power
Each Feather HUZZAH ESP8266 comes pre-programmed with NodeMCU's Lua interpreter. The Lua interpreter runs on the ESP8266 and you can type in commands and read out the results over serial. In order to upload code to the ESP8266 and use the serial console, connect any data-capable micro USB cable to the Feather HUZZAH and the other side to your computer's USB port. You can use use a serial console program such as CoolTerm (Mac) or Putty (Windows) or screen (Linux) to communicate to the board.
For users who have already worked on Arduino boards, you can continue to use Arduino IDE. In this way the user will be able to be productive immediately.
The first step is to install the ESP8266 Board Package from the site: http://arduino.esp8266.com/stable/package_esp8266com_index.json
Next, use the Board manager to install the ESP8266 package.
Once the board is installed, after restarting the Arduino IDE, Adafruit Feather HUZZAH ESP8266 can be selected from the Tools-> Board dropdown.
The most important parameters to set are:
{gallery} Arduino IDE configuration |
---|
To see a great similarity between this board and the most used and known Arduino boards, students will be shown the usual code used to make the LED on the board flash.
The code is absolutely the same as that seen for the other cards seen but this time we will use 2 LEDs.
The compilation and execution of the code will confirm the correct functioning of the card.
void setup() { pinMode(0, OUTPUT); //red LED pinMode(2, OUTPUT); //blue LED } void loop() { digitalWrite(0, HIGH); digitalWrite(2, LOW); delay(500); digitalWrite(0, LOW); digitalWrite(2,HIGH); delay(500); }
Another simple way to use the card is to use it to enter a local WiFi network, for example, in order to share data obtained from sensors connected to it on the network.
This simple activity could be particularly interesting for understanding static and dynamic addressing of network devices and for understanding the functionality of DHCP.
The WiFi library (https://www.arduino.cc/en/Reference/WiFi) is used to configure WiFi local networks. It has numerous functions that can be used in managing a WiFi connection.
In the simple example, we see how to configure the device dynamically using DHCP (Dynamic Host Configuration Protocol) and how to see the device MAC address.
#include <ESP8266WiFi.h> char ssid[] = "carlo"; char password[] = "**********"; byte mac[6]; // the MAC address of your ESP8266 void setup() { Serial.begin(115200); delay(1000); // We start by connecting to a WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.print("My MAC Address is: "); PrintMAC(); Serial.println(); Serial.println("The DHCP server assigned me the following configuration: "); Serial.println(); Serial.print("My IP address is: "); Serial.println(WiFi.localIP()); Serial.print("The subnet Mask is: "); Serial.println(WiFi.subnetMask()); Serial.print("My Gateway address is: "); Serial.println(WiFi.gatewayIP()); Serial.print("My DNS address is: "); Serial.println(WiFi.dnsIP()); } void PrintMAC(){ WiFi.macAddress(mac); Serial.print(mac[5],HEX); Serial.print(":"); Serial.print(mac[4],HEX); Serial.print(":"); Serial.print(mac[3],HEX); Serial.print(":"); Serial.print(mac[2],HEX); Serial.print(":"); Serial.print(mac[1],HEX); Serial.print(":"); Serial.println(mac[0],HEX); } void loop() { delay(5000); }
In static mode, the IP addresses of the device, gateway, DNS and subnet mask will be assigned manually.
This is a mode that requires more work on the part of the network administrator but it is useful for knowing at any moment which device has a certain network address and is, therefore, a valid help in managing security. In this example, we will assign a valid network configuration to the card. Obviously, the network administrator will need to know the parameters of the network to which he is connecting.
#include <ESP8266WiFi.h> char ssid[] = "carlo"; char password[] = "***********"; void setup() { Serial.begin(115200); delay(1000); // We start by connecting to a WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println(); // configure static IP IPAddress ip(192, 168, 43, 160); //IP Address IPAddress dns(8,8,8,8); //DNS IP IPAddress gateway(192, 168, 43, 1); // Gateway IP IPAddress subnet(255, 255, 255, 0); // subnet mask WiFi.config(ip, dns, gateway, subnet); // show IP Configuration Serial.print(("Setting static device ip to : ")); Serial.println(WiFi.localIP()); Serial.print(("Setting static gateway ip to : ")); Serial.println(WiFi.gatewayIP()); Serial.print(("Setting static DNS ip to : ")); Serial.println(WiFi.dnsIP()); Serial.print(("Setting Subnet Mask to : ")); Serial.println(WiFi.subnetMask()); } void loop() { delay(5000); }
In this project students can see how to use the Adafruit Feather HUZZAH ESP8266 to publish content on a WEB site.
One of the features that we most frequently ask of our IoT boards is to display data (for example temperatures or pressures, for example view the temperature and transparency of the water in an aquarium, the presence of water and food for our pets, etc.) on web interfaces or to allow us to remotely control a peripheral (for example to activate a solenoid valve when we click on a button or when it occurs a certain condition): in both cases, we will talk about WEB Server.
When we talk about WEB Server we imagine very powerful and expensive servers that manage portals with numerous WEB pages. the Adafruit Feather HUZZAH board obviously cannot have the hardware resources to manage a complex site in the presence of many users. Our board allows us to manage the WEB pages of the site in two ways. You can load HTML pages directly as strings or using inside ".h" files or use Flash File System called (SPIFFS) using SPI protocol. The third method allows you to create a real file system and is, therefore, more versatile but, given the simplicity of our examples, it will not be used.
This application could be used to remotely view data from sensors of any type. For example, you could see if the windows or doors of a room are open using a magnetic sensor, In particular, we will create a simple circuit that, using a very cheap and simple to use DHT11 sensor, will be able to publish the temperature and humidity present in the room where the board is located on a simple WEB site. In addition to the DHT11 sensor, we will only use a 10K resistor.
This project, although very simple in the visualization part, could be of great help when a person wants to know the trend of a certain variable over time.
The code is very simple as is the operation of the circuit.
#include <DHT.h> #include <ESP8266WiFi.h> #include <WiFiClient.h> //ESP Web Server Library to host a web page #include <ESP8266WebServer.h> #define DHTPIN 2 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); float h,t; //--------------------------------------------------------------- //Our HTML webpage contents in program memory const char MAIN_page[] PROGMEM = R"=====( <!DOCTYPE html> <html> <body> <center> <h1>See my room Temperature and Humidity</h1><br><br> <a href="Temp" target="myIframe">Temperature</a><br><br> <a href="Hum" target="myIframe">Humidity</a><br><br> Value:<iframe name="myIframe" width="100" height="25" frameBorder="0"><br><br> <hr> </center> </body> </html> )====="; //--------------------------------------------------------------- //SSID and Password of your WiFi router const char* ssid = "carlo"; const char* password = "***********"; //Declare a global object variable from the ESP8266WebServer class. ESP8266WebServer server(80); //Server on port 80 //=============================================================== void handleRoot() { Serial.println("You called root page"); String s = MAIN_page; //Read HTML contents server.send(200, "text/html", s); //Send web page } void handleTemp() { server.send(200, "text/html", String(t)); //Send ADC value only to client ajax request } void handleHum() { server.send(200, "text/html", String(h)); //Send ADC value only to client ajax request } //============================================================== // SETUP //============================================================== void setup(void){ Serial.begin(115200); WiFi.begin(ssid, password); //Connect to your WiFi router Serial.println(""); // Wait for connection while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } //If connection successful show IP address in serial monitor Serial.println(""); Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); //IP address assigned to your ESP server.on("/", handleRoot); //Which routine to handle at root location. This is display page server.on("/Temp", handleTemp); server.on("/Hum", handleHum); server.begin(); //Start server Serial.println("HTTP server started"); } //============================================================== // LOOP //============================================================== void loop(void){ h = dht.readHumidity(); //read humidity t = dht.readTemperature(); //read temperature Serial.println("Humidity: "); Serial.print(h); Serial.print(" %\t"); Serial.println("Temperature: "); Serial.print(t); Serial.print(" *C "); server.handleClient(); //Handle client requests delay (5000); }
Also, in this case, the code is very simple and the execution happens without any problem.
The home page is very simple, there are, in addition to the title, only two links and a text box, by clicking on the first (Temperature) you will see in the text box the value in degrees centigrade of the temperature of your room, by clicking on the second link ( Humidity), on the other hand, the relative humidity value of the room will be displayed (in percentage)
{gallery} My room temperature and humidity |
---|
An interesting application of the Adafruit Feather HUZZAH board is that of the network analyzer. It is a simple device used to detect the networks present, their emission power, the channel used and the security protocol used.
It is really useful to show a student who is approaching the world of networks for the first time that a small and cheap card is enough to perform very important tests on a network.
This circuit could be used to check for free channels before configuring a new access point or to verify the location of an Access Point with a certain SSID based on the emission intensity.
Any student with a minimum of technical knowledge on networks and a little curious could learn a lot about WiFi networks.
#include "ESP8266WiFi.h" #define SCAN_PERIOD 5000 long lastScanMillis; String Encry; void setup() { Serial.begin(115200); Serial.println(); WiFi.mode(WIFI_STA); WiFi.disconnect(); delay(100); } void loop() { long currentMillis = millis(); // trigger Wi-Fi network scan if (currentMillis - lastScanMillis > SCAN_PERIOD) { WiFi.scanNetworks(true); Serial.print("\nScan start ... "); lastScanMillis = currentMillis; } // print out Wi-Fi network scan result upon completion int n = WiFi.scanComplete(); if(n >= 0) { Serial.printf("%d network(s) found\n", n); for (int i = 0; i < n; i++) { switch (WiFi.encryptionType(i)) { case 2: Encry = "WPA"; break; case 4: Encry = "WPA2"; break; case 5: Encry = "WEP"; break; case 7: Encry = "Open Network"; break; case 8: Encry = "Auto"; break; default: Encry = "Default"; break; } Serial.printf("%d: %s, Ch:%d (%ddBm) %s\n", i+1, WiFi.SSID(i).c_str(), WiFi.channel(i), WiFi.RSSI(i), Encry.c_str()); } WiFi.scanDelete(); } }
A curious experiment can be done using a metal tube of those used for potato chips. The bottom was punctured and Adafruit Feather HUZZAH board was inserted and held in place with compressed paper. By connecting the metal cover of the tube to the mass of the USB port, we have created a system that conveys radio waves and that can be used to "go hunting" for access points. The intensity of the access point emission will be maximum when the pipe is pointed in the direction of the access point. One could think of applying this pointing system to a robot that could thus search for a certain access point.
{gallery} Network Scanner |
---|
You could continue to carry out useful and educational projects with the HUZZAH Adafruit Feather for a very long time. Among the things that intrigue me the most and that I will try in the near future at school are a WEB server with AJAX technology to view the changes in the values obtained by the sensors without having to reload the page and in particular I am very curious to use the Adafruit Feather HUZZAH for applications concerning IT security, for example to generate a large number of Spam Access Points.
In conclusion, this roadtest was a wonderful opportunity to work on a simple and inexpensive board which limits only the user's imagination and which I believe will be very appreciated by the students of my school.
Thanks element14.com!