PostsWifi

Code used to connect to WIFI with Esp32 (Referenced as WifiCode)

In this post, im just going to show you the WifiCode that is used and referenced in other Wifi posts.
We did it this way to minimize the times we needed to write the WifiCode directly and easier access for you guys.

To use this Wifi Code you need to include Nornir_ESP32.h which can be found :
Else you can also include Wifi.h instead

#include <Nornir_ESP32.h>
//OR #inlude<Wifi.h>

void setup() {
//Start serial monitor on beaurate 115200
  Serial.begin(115200);
//Trying to connect to wifi with name and password below
  WiFi.begin("WifiName","WifiPassword");
//This if connection is not successfull
  while(WiFi.status() != WL_CONNECTED) {
  delay(500);
  Serial.print(".");
  }
//This if wifi is connected
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
 }

Related posts
IntegrationPostsThe Things Network

How we integrated an external service to RTW using Webhooks and PhP

PostsWifi

Automatic trash can opener based on distance

PostsWifi

Automatic adjust brightness according to how bright the environment is

PostsWifi

Doorlock using Keypad with RTW

Legg igjen en kommentar

Din e-postadresse vil ikke bli publisert. Obligatoriske felt er merket med *