One successful implementation of iBeacon: 200 beacons for RIF + CIB 2014

    According to the original idea, the article was supposed to be entitled “Easy way to leave you to sleep,” but who will surprise you now? So, under the cut you will find a short story about how our team introduced indoor navigation on iBeacon in the territory of RIF + KIB 2014, as well as about all the fakaps and other adventures we met along the way.


    In a nutshell, it's worth talking about technology. iBeacon is a small bluetooth beacon that can transmit information about its identifiers (UUID, major, minor) to other devices. A person with the application installed approaches the beacon, the smartphone receives data about it and sends it to us on the server. We find this beacon in our database and send the user coordinates on the ground. Naturally, if the user is in the range of two or three beacons, we can determine his location more accurately.

    All of the above is very convenient indoors - where GPS cannot provide high enough accuracy for navigation.
    Of course, this technology opens up a lot of amazing opportunities, and our team with great enthusiasm took up the development of a platform and a mobile SDK for working with beacons.

    Part 1. Preparation

    Having played enough with a few trial samples of beacons, having prepared the first versions of the configuration service and iOS SDK, we felt the strength in ourselves to do something more. It was the end of February, the RIF + CIB conference looked like an excellent option for the first major launch: two months remained before it, and this is wow, anything can be done in such and such a period, right?

    It was necessary to have time:
    • understand how many beacons you need, buy and get them;
    • find or prepare some kind of tool that will allow you to batch configure the whole bunch of beacons (give them the correct identifiers, indicate the power and frequency);
    • develop an iOS application for conference participants;
    • significantly finish the web platform;
    • and a real trifle - to come to the place and install the right beacons at the right points.

    The trial copies of the beacons that were at our disposal were far from being as good as those about which so much is written on the net now: they hit a distance of 5-10 meters, but not at all 50, while everything worked a little differently and not very stable. But their low cost and our optimism became decisive factors - it was decided to order them for the conference.

    Having received from the organizers a rough map of the exhibition, as well as a small piece of the architectural plan with the indicated dimensions, we began to think over the optimal location of the beacons.

    The problems started when it was discovered that the architectural plan, the drawn map of the event and the view of the same place in google maps are similar to each other only in separate places. The contours, proportions and sizes of the buildings were obviously different.
    It was not possible to get a more accurate map.

    Of course, the best solution would be to go there about a month before the conference and figure out the scale yourself, manually correct the map, and think about the optimal points for placing the beacons. But at that moment we decided to calculate the required number of beacons approximately and throw some from above “in reserve”.

    Another major difficulty was setting up the beacons. The fact is that for the devices we selected there was an iOS application that allowed you to see all the available beacons and set each option by entering them manually from the on-screen keyboard in the form of hexadecimal values. To categorize two hundred beacons, this categorically did not fit. In this regard, one of our developers took up the creation of a tool that allows you to get the entire list of visible beacons, indicate the necessary settings and relax, watching how the beacons receive these settings and have a fun wink with a blue diode. It was March and everything went according to plan.

    The preparation of the most mobile application and web interface for managing navigation on the RIF progressed ideally until the last moment.

    Part 2. RIF + CIB

    After our arrival in Moscow 2 days before the event, events developed rapidly, every few hours revealing new unforeseen circumstances.

    Circumstance 1

    It turned out that collecting beacons from parts is difficult, and when there are 200 of them, it is even more difficult. The body parts do not fit well with each other, the printed circuit boards in shape do not quite correspond to the cover into which they need to be inserted.

    In general, for a couple of hours we looked like inexperienced employees of an underground Chinese factory. But the thing was done: the batteries were inserted, the printed circuit boards were firmly driven into the cases, the front and back covers were connected as much as possible. Victory.

    Circumstance 2

    Contrary to our expectations, it turned out that the program for batch configuration of a heap of beacons only works stably if the heap size is <= 10 pcs. But we were not going to give up.

    All that was needed was to come up with a way to somehow get rid of the signal of the extra 190 beacons when setting up the next batch: everything went wrong if the program detected more bicones than was required.

    Remembering that the range of the beacons is not so great, we just took the bag with them to the next room and ... were shocked to find that the current batch worked much better than the one we had a month ago. The signal remained excellent anywhere in the apartment.

    I did not want to remove the batteries: too much irreplaceable effort was put into the assembly. One absolutely reliable shielding method was experimentally developed: a bag of beacons was placed in a thick-walled cauldron and closed with a lid, and the cauldron was placed at the bottom of a cast-iron bathtub.

    Having run all night with heaps of beacons to the bathroom and back, by 5 a.m. we finished the setup.

    Circumference 3, the climax

    Despite minor technical difficulties, the installation of beacons in the territory of the future exhibition was very cheerful. We arranged them according to a pre-prepared plan, and practically did not have to move away from it.

    Having installed about 100 pieces, we decided to check the navigation. While a person with a bag of beacons ran back a few tens of meters from the hull (we did not have a cauldron and a bathtub for shielding), another had to walk through the hull with the phone and monitor the navigation in the application.

    The result was terrifying. The application showed that the user is constantly marking time somewhere in the northern part of the building. This corresponded to a 5-10 meter error and this was unacceptable.

    A couple more experiments - the same result.

    Such a panic is experienced by a student who pulled out an unfamiliar ticket on an important exam. So they feel in the face of an almost imminent failure. We settled in some empty room and began to think. One of the developers ( grohman ) twisted circles around the room, occasionally looking at the application, until he noticed a simple thing that for some reason did not immediately come to our mind. The location coordinates were calculated correctly, but the map itself was shifted south of the real coordinates, which gave such a distortion in the location display.

    With the good old-eye method, we selected a correction for all coordinates transferred to the application. Everything fell into place.

    Circumstance 4

    Soon we were replaced by another part of the team ( itruf , suprum ). Having sent us to rest, they were going to place the remaining beacons and finally test everything. After an hour and a half, they called with bad news: the location does not work again, and this time the distortions appear and disappear suddenly, the error is up to several tens of meters. Being on our feet for almost two days, we looked stunned at the monitor, watching the fantastic throwing of the "pin" location on the map.

    Parsing tons of logs, we managed to discover an amazing thing: from the list of beacons visible to the device from time to time there was beacon # 68, which should not be visible in that place. Soon the correct suspicion crept in, and we asked the guys to go to the place where that beacon should be installed and see what was wrong with it. Naturally, he was not in place.

    Someone unfastened # 68 from the wall and walked with it in his pocket, from time to time creating a kind of “presence effect” for the system.

    Having disconnected the data processing from this beacon, we again received decent data about the location, but we were faced with the question of how to deal with such situations quickly next time.

    The following solution was introduced: each beacon has “neighbors” - other beacons located at a distance <= N. When the user sends us data about visible beacons and signal strength (rssi), we select the beacons with the highest rssi and check if the remaining beacons are their neighbors. If we find a beacon that obviously should not be a neighbor here, we exclude it from the location calculation. The location worked well again.


    Then there were a few urgent bug fixes, three days of the conference, a lot of interesting people and events. Despite all the passions in the last days of preparation, we were able to start indoor navigation with the help of BLE beacons, we demonstrated (yes, there we were convinced ourselves) that it works. For ourselves, we were able to draw several conclusions:

    • testing in miniature will never replace testing in combat. Checking the navigation on several beacons even in a spacious room is not enough to be sure that the navigation will work with two hundred beacons per 1000 sq.m
    • saving time and energy on planning is a very bad saving option. If we paid more attention to map accuracy issues from the very beginning, we would not have to manually adjust the coordinates on the last night.
    • fasten beacons on double-sided tape - not reliable enough
    • several sleepless nights - not such a big fee for the opportunity to implement the country's first so large-scale navigation project on BLE beacons. We have gained an interesting and unusual experience and hope that we will soon talk about new projects for the implementation of indoor navigation and not only.

    In the comments, we will be happy to answer questions about implementation details.

    Also popular now: