Links: https://hackupc.com/

Vueling challege: Watch out, Blackout!

Develop a super minimal application for travellers about to take a flight that allows for the sharing of critical flight information in case of a blackout.

  • Ad hoc communication network between users;
  • Prioritise critical and flight information;
  • Super minimal app, low battery consumption;
  • Objective: keep information flowing and spirits up;
  • Bonus points on gamification and creating a memorable experience from the disaster

Solution: VuelingConnect

A simple Flutter app that makes use of Bluetooth Low Energy for creating a mesh like network of phones that can communicate flight and alert information in a a UDP like manner.

Links: https://github.com/migueldeoleiros/vuelingconnect

Information transmited

We transmitted two kinds of messages, alerts and flights, flights would be obtained by a base server and then sent through the network, while alerts could be sent by anyone in the network.

Flight information

  • Flight number
  • Status of the flight (canceled, delayed etc.)
  • Timestamp of when the message was first sent
  • ETA for the status that need it
  • Destination of the flight
  • Number of times this message has been relayed

Alert information

  • Alert message type
  • Timestamp of when the message was first sent
  • Number of times this message has been relayed

Encoding of message

The information of each message would be encoded in binary and then set as the manufacturer specific data in the bluetooth peripheral broadcast:

Advertisement(
  name: 'VuelingConnect',
  manufacturerSpecificData: [
    ManufacturerSpecificData(id: 0xFFFF, data: message),
  ],
);

Message format

Binary Format:
[1 byte] msg_type:
         - FlightStatus (0)
         - Alert (1)
[1 byte] hopCount: Number of times this message has been relayed
 
If msgType == FlightStatus:
  [8 bytes] flightNumber: ASCII encoded, padded with zeros
  [1 byte]  status:
            - Scheduled (0)
            - Departed (1)
            - Arrived (2)
            - Delayed (3)
            - Cancelled (4)
  [4 bytes] eta: Estimated Time of Arrival in epoch seconds, big-endian (0 if not available)
  [3 bytes] destination: IATA airport code, ASCII encoded, padded with zeros
  [4 bytes] timestamp: Epoch seconds, big-endian
 
If msgType == Alert:
  [1 byte]  alertType:
            - Evacuation (0)
            - Fire (1)
            - Medical (2)
            - Aliens (3)
  [4 bytes] timestamp: Epoch seconds, big-endian

Relaying of messages in the network

Each device in the network would be both looking at bluetooth devices as BLE central, and emitting message information as BLE peripheral.
Using this method we avoided connections and more resource intensive protocols like WIFI direct.

Each device will be emitting it’s queue of messages by changing it’s BLE data with a small interval.

When a device reads a the information from another ‘VuelingConnect’ device, it will check for the flight number/alert in its queue, and replace the information if the new one has a more recent timestamp.