Home > Projects > Spartan WiFi Pager System

Spartan WiFi Pager System

Summary of Spartan WiFi Pager System


This article describes the first stage of a Spartan WiFi pager system, focusing on assembling a breadboard circuit using an Arduino MKR1000 and an LCD to test WiFi connectivity. The code verifies network connection status and displays the SSID and IP address on the screen, while Azure IoT Hub integration is noted as future work.

Parts used in the Spartan WIFI pager system:

  • Arduino MKR1000
  • Adafruit Standard LCD - 16x2 White on Blue

Simple Wifi pager system.

Things used in this project

Story

Code

#include <WiFi101.h>
#include <WiFiClient.h>
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(0, 1, 2, 3, 4, 5);

char ssid[] = "mkrTestSSID";
char pass[] = "m4rSSIDpa$";

int status = WL_IDLE_STATUS;

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);

  if (WiFi.status() == WL_NO_SHIELD) {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.println("NOT PRESENT");
    return; // don't continue
  }
  
  while ( status != WL_CONNECTED) {
    // Connecting message
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("WiFi network");
    lcd.setCursor(0, 1);
    lcd.print("Connecting ...");

    // Connect to WPA/WPA2 network.
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);
  }

  printWifiStatus(); // Connected status output
}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("SSID: ");
  lcd.print(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  lcd.setCursor(0, 1);
  lcd.print("IP: ");
  lcd.print(ip);
}


void loop() {
  /* Place for Azure connection code */
  //lcd.clear();
}

Quick Solutions to Questions related to Spartan WIFI pager system:

  • What is the primary goal of this project?
    The project serves as the initial stage of the Spartan WIFI pager system to assemble a test circuit.
  • How does the Genuino report connection stages?
    The device reports connection stages by displaying messages on the LCD screen.
  • Can the Genuino connect to a WiFi network?
    Yes, the test code ensures the Genuino can connect to a specified WiFi network.
  • Does the current project include Azure IoT Hub connection?
    No, connection to Azure IoT Hub and message handling are still being developed.
  • What information is displayed after a proper WiFi connection?
    The LCD displays the SSID and the local IP address once connected.
  • What happens if the WiFi shield is not present?
    The LCD clears and prints NOT PRESENT before stopping execution.
  • How long does the code wait for a WiFi connection?
    The code waits up to 10 seconds for the connection attempt.
  • Where is the Azure connection code placed?
    The Azure connection code is intended for the loop function but is currently empty.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top