Skip to content

ubilab-ws21/puzzle-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Team 2: Time will guide you!

Contents

Story Overview

A Solar strom themed Escape Room where players have to solve puzzles to get out of it. In the year 2032, the world revolving around automation and high-end technology. One fine day, a Solar Storm hits the city and all the servers and digital systems starts to fail there is a power breakdown. The players are stuck inside a server room having limited emergency backup. The goal is to upload the software to the server in order to get things back in place.

The Puzzle

We are building a puzzle for the server room of the Solar Storm themed Escape Room in the Ubiquitous Laboratory Area-079 Escape Room. The puzzle is designed in regard to access the power delivery system which will be powering the automated door to open the server room and power up the server which contains the corrupted software. The emergency power backup can power up only a single server and if wrong switches are turned on the backup will drain out.

The power switches are protected by a tap-tap pattern for which the players have to be aware and take the hints from the previous puzzle. Once you get the pattern right you get access to the power switches. But, there are lots of switches and you need to turn on few of them. One wrong switch can drain out the emergency backup. The order of the switches which needs to be turned on will be given by the puzzle displayed in the OLED Display. You get the right sequence of switches, the server room door opens and the server turns on.

Use Case Scenario

System Overview

Project Workflow

  • Figuring the puzzle according to the story
  • Creating a Bill of Materials (BOM)
  • Starting with ESP32 Programming and Basics of MQTT
  • First tour of Escape Room
  • Testing all components
  • Preparing the circuit
  • Program the ESP Board
  • Prepare 3D Model
  • Print 3D Model
  • Design the outer casing
  • Assemble the outer casing
  • Solder the circuit in PCB
  • Assembling all components
  • Testing and Bug Fixing
  • Prototype Presentation
  • Final Tweaking and Testing
  • Final run and presentation

Hardware Overview

Electronic Components
  • ESP-32 Microcontroller
  • Servo Motor
  • Piezo Buzzer
  • OLED Display
  • Toggle Switches
  • 8x5050 RGB LED Strip
  • Printed Circuit Board
  • Connecting Wires

For more details, check Bill of Materials.

The Box

The outer casing and the servo hinge was designed using 3D Modelling. The model files can be found here.

Software Overview

Testing Individual Modules

Firstly, we tested all the components and modules individually for better integration of our project. Each modules were tested with Arduino for understanding the basic functionality and then tested with ESP32 to check the compatibility. The codes for testing can be found here.

Building the Main Program

Then, we integrated all the modules and modified in a single program to be fired up in the ESP32. The program manages the worflow of the puzzle and maintains proper communication with the MQTT server. It is also programmed in such a way that the ESP32 can receives updates Over-the-air. The main code can be found here.

Configuring OTA

In order to receive updates Over-the-air, the below function has been called inside the setup loop. The function sets up the host name and password for the ESP32 in the newtork and updates the ESP32 if there is any update request. Also, remember to include the appropriate header file.

#include <ArduinoOTA.h>

void setup(){
  ....
  ....
  setupOTA();
}
void loop(){
  ...
  ...
  ArduinoOTA.handle();
}
Establishing MQTT Communication

The puzzle workflow totally depends on successful interaction between the operator and the arcape. The operator controls whether the puzzle is to be turned on or off depending on the progess of the other puzzles. The programs subscribes from the topic 2/esp and checks whether the trigger is on/off and works accordingly. Once the puzzle is on, the program publishes that the puzzle is active in the topics, 2/esp and game/puzzle2 for the operator and arcape resp. to understand that the puzzle is active. Otherwise the state is retained to inactive state.

Communication Format

All messages exchanged between the server and the client is JSON schema:

{
  "method": "<method>",
  "state": "<state>",
  "data": "<data>"
}

where,

Method State Description
status inactive, active, solved Describes the current state of the puzzle
trigger on, off Contols the behaviour of the puzzle

More information regarding MQTT server and the communication protocols can be found here.
The JSON messages received by the server was parsed inside the function decodeMessage() and the messages sent to the server was created by the function createJson().

References

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •  

Languages