I along with three other students from our university were working on a smart ring for Pulse-oximetry based healthcare solutions. Our team consists of four members, two of them are working on the hardware and I along with my friend are working on developing the software interface to interact with the device over BLE(Bluetooth Low-energy), which is a wireless personal area network technology helping devices to communicate wirelessly.
We had to develop the application from scratch. We just had a device and somehow we had to extract live data from it and show its visualisation on our interface.
We started with a node.js server which could speak to our ring’s hardware over BLE using a node.js library,
noble and get data from it whenever required. after BLE connection, we had to do some data calculations and then push it for visualisation. Upon successful communication, we had to decide on how can we push this data continuously to the front-end. We had some options like polling, sockets and sockets looked like the right way to go as we had to ensure packet delivery so that no information gets lost.
So we chose AngularJS along with socket.io for connecting to our node server and formed a pool of pre-allocated memory and used it as a queue so that newly pushed data works in the FIFO manner and our browser doesn’t get out of memory as the amount of data will get accumulated due to data pushed by the server continuously.
I read somewhere that sockets can also introduce memory leaks into your application when disconnected sockets are not handled carefully. So we also introduced a simple code for monitoring sockets continuously on both server and browser.
We examined some open sourced data visualisation libraries like
d3.js, etc. for plotting our data and we finally used a subset of d3.js,
angular-charts for data visualisation. As we had a live feed of data, we needed a fast replotting tool and this tool fits perfectly in this need.
Finally, our application worked pretty well with the device and live feed was plotting on the front-end without any memory leaks.
This project was different from other projects I did, as we did not have any idea about how this idea was going to be implemented. We had to think through the architecture and finally the product turned out to be pretty well. It was an awesome experience!