Symb-IoT

written in full-stack, tech lead, iot, sensor management, python

Position: Full-Stack Tech Lead Duration: June 2018 - June 2019 Clients: - Bloc - Samsung

block logo

Description: After returning from Australia I took a part-time / mostly remote role involving Python, JavaScript, and Android Java at a company I'd worked for indirectly several years earlier. It involved building software for deploying and managing various unipis, sensors and Android devices. The role did included some travel and overnight stays at Gatwick and Birmingham. The role also involved teaching software engineering to one junior developer who had an electrical engineering background.

unipi The Gatwick hotel is situated inside the airport with views of the runway.

Roles and Responsibilities:

• Advise on technical direction

When I arrived there had been a turbulent few years for bloc as they had been through several vendors who had failed to deliver. They then created a startup called Symb-iot to solve the technology for the rooms themselves. The Hotel owner was keen on guests controlling the room from their own devices or a supplied tablet. There was a partially custom built room controller installed in several rooms. But no plan for the remaining 1000 rooms across both estates. The people who had developed the hardware had since left and I was suddenly in-charge of lots half built prototypes. The project was stalling. I'm no hardware engineer so instead took something off the shelf and got a proof of concept working on the demo room with a unipi which impressed. So we ditched the perpetual hardware RnD and bought one of these for every room. This was perfect as it was like a cross between a Raspberry PI and an Arduino. We then spent weeks installing them across all the floors and removing the now old Crestron systems which we'd used 5 years earlier.

unipi

• Fix the existing broken system and solve bugs

The original system used Android devices to talk direclty to the Crestron controllers over TCP. This was good and efficient. One Crestron box per between 8 and 30 rooms.

Then another vendor had come along and made a web UI rather than a native app. The web UI relayed messages to the server room which then sent messages to each of the crestron controllers. That vendor was long gone.

A third vendor had come along and copied the architecture of the 2nd vendor with a web UI and centralised server. Only they used PHP instead of Node and no sockets. So were polling the main server which in turn was polling all the Crestron boxes.

None of the newer systems were completely rollled out so 3 systems existed in different parts of the hotel.

75% of rooms were served by the PHP web app running in the server room that served pages to all the apps which were just a wrapper around a browser. There was no socket so they were polling 120x per second causing a very chatty network and slowing down the internet in the entire hotel. Can you imagine 1000 devices all pinging 120x per second to one server downstairs to see if the guest is checked in and if the lights were on?!?!. I traced the traffic on the network and resolved these issues. And explained we needed to go back to a socket model were the native Android app could be updated over TCP when changes occur by talking directly with the Crestron device.

unipi The old Crestron boxes run on a programming language called SIMPLE.

• Develop a new system

There was a requirement to develop a new system however utilising the old tablet harddware (Galaxy Tabs). It was agreed to instead updgrade and add new features to the original succesful system. However the Crestron boxes needed replacing as were end of life, so we rolled out the new unipis and installed 'Neurons' for all the hotel rooms.

unipi unipi

• Develop a Cloud based UI to monitor all services

I developed a cloud based system codenamed 'Nebula' (I know, corny right). To monior all the rooms. It provided a UI so you could see each room and stats like the last time the PIR was triggered, or how many lights were on, or the current room temperature, if the guest was checkin/out etc.

I often stayed at the hotel to test code in the live environment and had a great view of the runway.

• Installation of hardware and software

Walking around 1000 rooms was tiring. So I hired a temporary worker to go to each room with a screwdriver and put a sim card into either the unipi or Android device controlling the room and update the software. This was prior to setting up remote device management. Training was provided as well as a flow chart for what to do in each room. This only had to be done once as a method for remote updates was in place with the new software where updates or new modules could be pulled from 'Nebula'.

• Connect to the aircon

I wrote a HTTP interace to the aircon units. The aircons could be controlled over a REST API. mention hacking the controllers by mimicking the signal

• Control rooms via internet

We created a token system in AWS to control the rooms via the internet.

• Hook up door locks

The Salto locks could be controlled via a REST API. I managed to get this working and have a video of the night I sat and got it working from my room. Allowing a guest to use their phone to unlock the doors was a key part of the user experience. To send the guest an email after check-in online so they could go stright to their room bypassing reception.

• Connect to Bluetooth lightbulbs

Some of the rooms had bluetooth lighting. I managed to first do this on the boss's office. Then we added a lighting module that also worked via bluetooth rather than the wired in ones.

• TV controls

We hid a infrared light in the ceiling and drew the wire back to the unipi device. Then installed some libraries for infra-red on the unipi and made it appear that the tablets could control the TV.

Another solution was to have a pi zero plugged in the back of each tv. But the IR lib on linux worked fine.

pizero We almost put a pi zero in every TV. But infra-red ended up being a better solution

• Connect to PMS / Checkout

When a guest checked out we automated informing the cleaners. They were able to use their ipads to mark the rooms as clean and list them back on the market.

• Automate rooms shutdown

A certain time after the guest checked out we automatically turned of the AC and lights and TV in the rooms.

• Custom Android OS

To have more controls in the Android app we compiled our own version of the OS which was a fork of paranoid android. This allowed us to add more permission to our app than the standard application is usually allowed. i.e. for access to camera

• RnD

CAN-bus

Tools: Git, JavaScript, AWS, Python, Bash, Networking, Java (Android), IoT, Lambda, API Gateway, Flask.