A IoT device programmed with Arduino need connect to WiFi at start of device to use internet for data transfer etc. First of all we need to include header file “WiFiClient” to our sketch. # include <WiFiClient.h> With code below we will let user enter WiFi credentials over serial communication. we should add this code to our setup() part of our Arduino sketch. Serial . write ( "Please enter name of your wifi network\n" ); while ( Serial . available () == 0 ){}; String Uid= Serial . readStringUntil ( '\n' ); Serial . write ( "Please enter password of your wifi network\n" ); while ( Serial . available () == 0 ){}; String pass= Serial . readStringUntil ( '\n' ); If you want give user a tool to setup WiFi over serial you can download a free serial communication tool “Vengito Serial Tool”. With this tool user can connect IoT device easily and enter WiFi credentials. Download "Vengito Serial Tool" For more software tools Af...
Comments
Post a Comment