https://web.hosting.nyu.edu/wp-content/uploads/ble/

Source code:

sketch.js

// Copyright (c) 2018 p5ble
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

// The serviceUuid must match the serviceUuid of the device you would like to connect
const serviceUuid = "";
let myCharacteristic;
let myValue = 0;
let myBLE;

function setup() {

  createCanvas(200, 200);
  textSize(20);
  textAlign(CENTER, CENTER);
  // Create a p5ble class
  myBLE = new p5ble();

  myBLE.connect(serviceUuid, gotCharacteristics);
  // Create a 'Connect and Start Notifications' button
  const connectButton = createButton('Connect and Start Notifications')
  connectButton.mousePressed(connectAndStartNotify);

}

function connectAndStartNotify() {
  // Connect to a device by passing the service UUID
  myBLE.connect(serviceUuid, gotCharacteristics);
}

// A function that will be called once got characteristics
function gotCharacteristics(error, characteristics) {
  if (error) console.log('error: ', error);
  console.log('characteristics: ', characteristics);
  myCharacteristic = characteristics[0];
  // Start notifications on the first characteristic by passing the characteristic
  // And a callback function to handle notifications
  myBLE.startNotifications(myCharacteristic, handleNotifications);
  // You can also pass in the dataType
  // Options: 'unit8', 'uint16', 'uint32', 'int8', 'int16', 'int32', 'float32', 'float64', 'string'
  // myBLE.startNotifications(myCharacteristic, handleNotifications, 'string');
}

// A function that will be called once got characteristics
function handleNotifications(data) {
  console.log('data: ', data);
  myValue = data;
  window.location.replace("https://itp.nyu.edu/qrcode/rooms/?room=r"+data);
}

// A function to stop notifications
function stopNotifications() {
  myBLE.stopNotifications(myCharacteristic);
}

function draw() {
  background(250);
  // Write value on the canvas
  if(myValue!=0){
  text("Room "+myValue, 100, 100);
}
}

room.php

<?php

// Yen

?>

 <!DOCTYPE html>
<html>
<head>
<title>Rooms</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-deep-purple.css">
<meta http-equiv="refresh" content="300">
</head>
<body>
<div id="title_roomname" class="w3-container w3-center w3-mobile">
  <h5 class="w3-jumbo w3-text-theme" style="text-align:center;">Rooms</h5></div>
<div class="container">
  <h1 class="summary"></h1>
  <div class="time"></div>
  <div class="desc"></div>
</div>
<?php 
date_default_timezone_set('America/New_York');

$current_time = "\"".urlencode(date(DATE_RFC3339))."\"";
$max_time = "\"".urlencode(date(DATE_RFC3339,strtotime('tomorrow midnight')))."\"";

$Rname = $_GET['room'];

$classRooms = array(

  'r15' => "\"".urlencode("ebennb237npmmst678vihpeg0c@group.calendar.google.com")."\"",
  'r20' => "\"".urlencode("ntr39769a6qv2muku8r6jo3tks@group.calendar.google.com")."\"",
  'r50' => "\"".urlencode("uvuipvdeg16fs109gckarnr2l4@group.calendar.google.com")."\"",
  'rmt' => "\"".urlencode("j6hack5ssa92audri0dkd18424@group.calendar.google.com")."\"",
  'rcf' => "\"".urlencode("2mgc9msdltegi6ngg07p716lf4@group.calendar.google.com")."\"" 
  );

$cal_id = ($classRooms[$Rname]) ? $classRooms[$Rname]: '""';

 ?>
<script>


var current_time = <?=$current_time ?>;
var max_time = <?=$max_time ?>;
var cal_id = <?=$cal_id ?>;
var apiKey = "";

var url = "https://www.googleapis.com/calendar/v3/calendars/"+cal_id+"/events?singleEvents=true&orderBy=startTime&timeMax="+max_time+"&timeMin="+current_time+"&key="+apiKey;

var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; 

var yyyy = today.getFullYear();

if(dd<10){
    dd='0'+dd;
} 
if(mm<10){
    mm='0'+mm;
} 

var today = mm+'/'+dd+'/'+yyyy;

function makeRequest() {
  xhr = new XMLHttpRequest();

  xhr.onload = function() {
    var response = JSON.parse(this.responseText);
    var title = document.getElementById("title_roomname");
            
            var roomname = document.createElement("h1");

            roomname.style="text-align:center;"

            roomname.innerHTML = response.summary;
title.appendChild(roomname);

    if(response.items.length != 0){

    for (var i=0 ;i<response.items.length;i++){

    
      var title = response.items[i].summary;

      var div = document.createElement("div");
      div.className = "w3-panel w3-card";
      //div.style="width:50%";

      var h1 = document.createElement("h1");
      h1.className = "title w3-theme w3-center";

      var div_time = document.createElement("div");
      div_time.className = "time w3-center w3-xxlarge w3-text-theme";

      h1.innerHTML = title;

      var com_now = Date.now();
      var com_start = Date.parse(response.items[i].start.dateTime);
      var com_end = Date.parse(response.items[i].end.dateTime);
      
      var class_time = (new Date(com_start)).toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}) +" - "+ (new Date(com_end)).toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'});

      if(com_now < com_end && com_now >= com_start) { 
        class_time += "</br> (Current) </br> ";
        h1.className = "title w3-center";
        div.className = "w3-panel w3-card w3-yellow";
        div_time.className = "time w3-center w3-xxlarge";


      }

      div_time.innerHTML = class_time;


      div.appendChild(h1);
      div.appendChild(div_time);

      document.body.appendChild(div);



    }

  }else {

    var div = document.createElement("div");
      div.className = "w3-panel w3-red w3-center";

      var h1 = document.createElement("h1");
      h1.className = "title";

      h1.innerHTML = "No meeting is currently scheduled.";

      //div.appendChild(roomname);
      div.appendChild(h1);

      document.body.appendChild(div);


  }

  document.getElementById("date").innerHTML = today;

  };
  xhr.open(
    "GET",
   url,
    true
  );
  xhr.send();
}

if (cal_id) {

 

  makeRequest();

}else {

  var div = document.createElement("div");
      div.className = "w3-panel w3-red w3-center";

      var h1 = document.createElement("h1");
      h1.className = "title";

      h1.innerHTML = "There is no this room.";

      div.appendChild(h1);

      document.body.appendChild(div);

}


</script>


</body>

</html> 

roomNotification.ino


#include <ArduinoBLE.h>

BLEService roomService(""); // create service

BLEIntCharacteristic roomCharacteristic("", BLERead | BLENotify);

int roomValue = 15;

void setup() {
  Serial.begin(9600);
  
  //while (!Serial);

  // begin initialization
  if (!BLE.begin()) {
    Serial.println("starting BLE failed!");

    while (1);
  }

  // set the local name peripheral advertises
  BLE.setLocalName("SETROOM");
  // set the UUID for the service this peripheral advertises:
  BLE.setAdvertisedService(roomService);

  // add the characteristics to the service
  //ledService.addCharacteristic(ledCharacteristic);
  roomService.addCharacteristic(roomCharacteristic);

  // add the service
  BLE.addService(roomService);

  //ledCharacteristic.writeValue(0);
  roomCharacteristic.writeValue(0);

  // start advertising
  BLE.advertise();

  Serial.println("Bluetooth device active, waiting for connections...");
}

void loop() {
  // poll for BLE events
  BLE.poll();

    Serial.println(roomValue);
    roomCharacteristic.writeValue(roomValue);


}