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.