Friday, March 6, 2015

Securing Your Ibeacons

Hi tech hackers are constantly looking for vulnerabilities and definitely ibeacons are not exempted from being the target in fact because its new, it is often become the primary target. Securing the ibeacon is perhaps the number 1 goal of every business just like any other IT implementation projects.

Ibeacons constantly advertise their signatures, this mainly composed of UUID, MAC Address, Minor and Major. If the app you design is dependent only on these parameters, then the ibeacon security implementation is very weak and is very vulnerable to all sorts of hacking methods. So an additional security layer is needed. There can be a number of ways to do this. The following are my ideas of securing the ibeacon implementation:


  1. Most Ibeacons can be configured over the air(OTA), it would be wise to always enable the password protection features of the ibeacon so that it can only be accessed by qualified and authorised administrators. 
  2. With Ibeacons' signatures publicly advertised, without having an additional security layer, hackers and competitors can easily device new ways to either clone the ibeacon's signature and create push messages that will show up their own advertisements.  To prevent this from happening, a security layer must be implemnented. A good example is by letting your customers register before they can use the mobile app. Another good example is adding additional validations such as how did your client came in to your store, there must be a pattern, they could have passed through McDonald before they came in and it's just so happen that McDonalds have implemented ibeacons and was detected by your customer's smart phone and was logged by your mobile app. The creation of additional security layer depends on your creativity.
  3. The APK must also be secured to prevent hackers from reverse engineering the app. If hackers have access to the source code of your app, the security layer implemented will be exposed. 
Always remember that as the technology becomes more sophisticated, hackers can be one step ahead, but you still can beat them if you know how to stop them.

Sunday, March 1, 2015

How Ibeacons Will Change the Rules in Retailing

The retailing business is extremely competitive. Not many people succeeds in this kind of business. A carefully crafted marketing strategy and with the help of the latest gears and gadgets can help improve the business' chance of survival.

Studies shows that a more personalized service, the introduction of new ways to attract foot traffic, analyzing people's movement inside the store and getting to know more about each one of your customers personal preference can help in the creation of strategies to get these customers to spend at the right time.

Just like for example a teen-age girl happens to pass by a Starbucks, and she really liked to try a newly introduced strawberry flavored coffee but she is short of $1, and all of a sudden, a popup screen on her phone informed her that she has a $2.50 discount coupon and she can even get another $2.50 discount if she invites a friend. So immediately, she invited her best friend who happens to live just a block away to join her. The popup screen appeared because her phone detected the presence of ibeacon.

The sale could have never happened if the discount coupon was just advertized on a magazine.

Another case study is integrating the Beacon Hands Free payment system by Paypal aimed at targetting busy urban professionals. One scenario is that a busy working mom who loves to take with her a coffee with Belgian waffles which is available at Grandpa's Coffee Dine that is always full of people like her. She had to spend 30 minutes every morning just to get her favorite food but now, with the help of Paypal's Beacon Hands Free Payment system, she can put her order and pay online and when her smart phone detects the ibeacon of the store, the store keeper will be notified and will just take her already prepared order outside just a minute before she passes by and and when she's in front of the store, the store keeper will just hand over the coffee and the waffle to her. She may do this only once and each time she passes by the store every morning, the store keeper will always be there to give her favorite coffee and waffle.



Update: With the upcoming release of Apple's Iwatch which is capable of receiving ibeacon signals, receiving discount coupons and other promotional campaigns to improve brand recognition and gathering data of customers' buying habits will now even be so much easier.

Friday, February 27, 2015

Configuring HM-10 to Support Over-the-Air(OTA) Update

One of the key features of Ibeacons is the ability of apps to manage them remotely or via over-the-air update. This is true especially when maybe hundreds of ibeacons are deployed, there is just got a way to manage them remotely. HM-10 is surprisingly has this feature as well. Other advantage of OTA is that it will allow HM-10 to toggle between an Ibeacon and a regular Bluetooth module which can enable it to gather information on its surroundings and transmit it to a server without the need for an external microcontroller.

My previous post(The proper way of turning the HM-10 into Ibeacon) only dealt with(obviously from its title)how to configure HM-10 into ibeacon. But it did not mentioned about how to configure it to support Over-The-Air update which I still do not know during that time of writing. So now, I am willing to share with my readers and visitors how to really turn HM-10 into a real ibeacon.

Actually, it is very simple to do it, HM-10 should be connectable and be able to receive incoming data while broadcasting the ibeacon signal. By turning these off, we are sacrificing the few milliAmps of power consumption, but trade-off is really worth it. Here is the procedure:



I have proven this to work by modifying the source code of the android app that I used in my previous post(More Fun with HM-10). To describe in more detail the modification I made, I just replaced the following line(in bold letters)) in DeviceControlActivity.java:
private void makeChange()
{
string str=RGB[0] + "," + RGBFrame[1] + "," + RGBFrame[2] + "\n";
......
}
with this new code(in italics)to turn off the ibeacon:
private void makeChange()
{
string str="AT+IBEA0";
......
}

(credit to 

The effect of my change is that each time the value of any of the led dimmer slider control changes, the android app will send the command "AT+IBEA0".  

For security reasons, just enable password protection so that accessibility can controlled and restricted.


Wednesday, February 18, 2015

A Simple Ibeacon Scanner App in Android

I have written several articles about the possible uses of Ibeacons but I have never tried to develop a demo software to show how Ibeacons really work so I decided to develop my own app. This app will run at least on Android devices with Android Jelly Bean 4.3 operating system and equipped with Bluetooth 4.0 hardware.

I have never developed an Android App before so this is my first attempt to develop an app. I will be relying heavily from the search results that google will return and my prior experiences as a developer will not help me.

As a noob in this domain, I have to have a strategy to get this task running in 24 hours so I have identified the following steps:
  1. I will get the latest version of Android Studio, the official Android Development Environment.
  2. Watch some youtube tutorials how to properly setup this IDE.
  3. Complete at least 1 full basic tutorial Android Developer's Portal.
  4. I will use the source code of the Android app I used from my previous article More Fun with HM-10 and read something more about BlueTooth Low Energy API that is already inlcuded within the Android Studio.
  5. If all else fail, then it is a failure.
After 12 hours, I came up with a simple app capable of detecting Ibeacons and display them on screen. Here is a screenshot of the app:

The original app does not check whether the device it detected is an ibeacon so I did some research how to check if the device is an Ibeacon.

This is how ibeacons work:
Ibeacons continously transmit their identity(device name, mac address, uuid, minor, major, etc) which includes the pattern that makes it an ibeacon.

The ibeacon signal or the advertisement packet that we need to check is on the 6th byte of the transmitted signal ignoring the first few bytes which corresponds to the company or manufacturer identifier, the value should be equal to 0x02 and we need to confirm the length of the transmitted signal and it should be 0x15 which is located on the 7th byte.

The received bytes each time a bluetooth device is found is stored and can be processed within the callback component.

This app that I just developed provides a basic solution and can be further developed to meet almost every requirement for specific ibeacon application. Developing an full android app is not my expertise but I will continue to keep on developing this app until I become an expert. 

Update: If you are interested to check the app I created you may download it here: https://t.co/8XxjA8NGmh
And the source code can downloaded here : https://t.co/ryV9qT5QTW

The app frequently crashes because the code I inserted is still incomplete, it still needs further enhancement, error-catching routines to prevent it from crashing.

Saturday, February 14, 2015

How to connect Ibeacon V2.0 to a PC with CP2104 USB 2.0 to TTL Converter

I have just came up with a new version of Ibeacon to replace the old ibeacon. Some improvements I made are the following:
  1. It is now thinner at 12mm external thickness down from 18mm thick and is shorter by 10mm. 
  2. The battery I used is the expensive Ipod Nano replacement battery because this battery is very durable, it will not be damaged even if I connect the CP2104 Usb 2.0 to TTL Converter. 
  3.  I have added a new on/off switch to avoid damaging the HM10 module while charging the battery.
  4. I have also rearranged the the position of the four pins used for charging the battery and configuring the Ibeacon.
Here is the new Ibeacon:

 


I am not done yet with the design of the casing but I will be updating this blog when I am done with it.

To connect the new ibeacon to CP2104 USB 2.0 to TTL Converter, you may do the following connection:

Tera Term is the software I am using to configure the Ibeacon and this is an excellent article about how to use the software Tera Term Guide from Sparkfun. 

Update: I have just finished my casing design and here it is:

The design is very basic bit looks nice when 3d printed. I nwill still; have to add some design to make look nicer. I was inspired by this very basic design:

Credit to the Owner

Here's the actual 3d printed casing:


The charger or docking station will be finished soon and here is the draft design:

The four holes will be for the slots for pogo pins and the final connector is a standard female(full size) usb.

Thursday, February 5, 2015

Vision Impaired Guiding Device with Text-to-Speech, Distance Sensing, Object Detection and Face Recognition

Persons with disabalities are often labeled as unproductive since they could no longer live on their own without the proper care and guidance of normal people. They either lack one or more of the six senses or some of their body parts are mutilated or not functioning properly. But nowadays, with the advancement in electronics and robotics, some of these people are now able perform those tasks that they can't perform because of their disabilities.

I too got an idea of helping those people who have problems in seeing the world which prevents them from crossing the street or seeing objects that they encounter and not able to see the shape, colors or even the name of the person that goes near them.

Object recognition, distance sensing, electronic compass, gps receivers, face detection and recognition, text-to-speech are already common technologies and when put together in one device that will be managed and controlled by coin sized but very powerful computer for the purpose of helping these people can be so easy.

With such device, blind people can now move independently and become a less burden if not a highly productive individual that can already compete with normal people.

Friday, January 30, 2015

Hacking the 1.44" TFT LCD for my Smart Watch Project

I have several stocks of these cute lcd's and for months they've been there neglected. And then one day, I came up with an idea of why not make my own smartwatch by using this lcd, it rung a bell on my head and yeah, why not, it is quite an exciting project. There are so many uses of small lcd aside from making them as watches or pendants. This one cool project at the Discovery Wall at Weill Cornell Medical College is just one of them.

(Credits to the owner)

So I begun to dig into it to find more information about this tft lcd. And here is what I have found out:
1. The tiny lcd is being driven by ILI9163 chip and several arduino users have created libraries so that it will be a lot easier for others to use this lcd. I am not very good at creating my own library so this is an advantage of being an arduino fan, things can be so easy. And yep it is really easy, here is my first round of testing:

So now that I was able to make it work, I need to dig deeper to get more information, My project is a smartwatch so I need to keep it as thin as possible and the red pcb where the lcd was attached is quite thick so I will have to remove the lcd from it without harming it. The lcd has very few external components so getting rid of the pcb will not be a big problem. Here's the progress of my work:




And like I said, the circuitry is very simple so all I have to do is copy the schematic diagram in KiCAD so that I can integrate it easily with other modules. Here's the schematic diagram:

As I was checking further, I realized that the Arduino running at 16Mhz can really be very slow so I thought of using the teensy 3.1 which runs at 72Mhz. And another user has published his code that runs the adafruit library on the teensy 3.1. This did not only copy the adafruit library, he optimized it and the result is a super fast graphics library.

Here is the video of the optimized library in action: