Would it be great to make your android device do something even when you are away from it? Or may be let it ring to let you find it with the use of another phone? This process is somewhat or maybe it is a full machine-to-machine communication application which is widely used in so many industrial applications today.
Just recently, a lot of parents are very much concern with the whereabouts of their kids so they are forced to buy another security device to let them achieve this but these devices are often expensive and requires extra contract with the telcos to ensure reliability.
Nowadays, a lot of inexpensive android smartphones equipped with the latest OS and hardware but the only thing missing is a reliable app that would make these smartphones high tech device. So I thought I should create a simple app that screens incoming sms messages. If this app is able to receive a certain code which in this case is "Hello", it will automatically launch the camera app to take picture and display the thumb nail on the screen. This is just a demo program just to test whether my idea of making the android device do something even when you are away from it.
And I would suggest that this app can be enhanced further by adding Bluetooth communication with HM10 to control other devices in the house with so much ease. You may check my previous post here: More Fun with HM 10
You may download the source of the app here: https://drive.google.com/open?id=0B1tuk2j-arZSNVZfdEcwVUZha0U
If I will have the time, I may combine the 2 apps.
Showing posts with label hm10. Show all posts
Showing posts with label hm10. Show all posts
Sunday, January 3, 2016
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:
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()with this new code(in italics)to turn off the ibeacon:
{
string str=RGB[0] + "," + RGBFrame[1] + "," + RGBFrame[2] + "\n";
......
}
private void makeChange()
{
string str="AT+IBEA0";
......
}
(credit to danasf of Instructables.com)
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:
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.
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:
- I will get the latest version of Android Studio, the official Android Development Environment.
- Watch some youtube tutorials how to properly setup this IDE.
- Complete at least 1 full basic tutorial Android Developer's Portal.
- 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.
- 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:
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.
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:
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:
Here's the actual 3d printed casing:
- It is now thinner at 12mm external thickness down from 18mm thick and is shorter by 10mm.
- 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.
- I have added a new on/off switch to avoid damaging the HM10 module while charging the battery.
- 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.
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:
Friday, October 24, 2014
More Fun with HM 10
I got more curious about how to use the HM 10 BLE(Bluetooth low energy) module and asked myself if it will really be able to pair with arduino and instruct the arduino to do some tasks via an android phone. So did some research if anyone from the internet has posted similar project and I was so lucky that I found one that I thought is easy and would simply answer my question.
The original post can be found through this link: Control RGB lights from Android with Arduino & Bluetooth LE (BLE)
Aside from following the processes exactly as described in the article, I also did some twist to adapt it to what is available in my chest. The first thing I did is to deactivate the ibeacon function by issuing the following AT command:
Ibeacon is activated if it returns 1 and deactivated when it returns 0.
Here are the materials and components I used:
1. HM10 BLE module
2. Arduino Pro Mini 8Mhz and 3.3V
3. Dupont wires
4. The RS232-TTL Adaptor that I used to upload sketch on the Pro Mini
5. Li-Poly Battery
6. BreadBoard
I will still be using the same connection just like what I did in my previous testing of HM-10 and was described in detail in my previous post. If you haven't read it yet, you may click on this link: HM10 BLE Module with Ibeacon .
With that set-up, all I need is to upload the sketch as described in the reference article but since I don't have an RGB LED, I could just use the LED in the arduino pro mini which is connected to digital pin 13. Digital pin 13 is not a PWM pin so I can only turn it on or off and not able to dim it.
I also downloaded the android app in the reference article and installed on my android phone.
Test Result:
It was awesome!!!
Here's the video of my testing:
This is the sketch that I used:
I am still using the software serial library because that was my previous setup and I wanted to use the original serial port to communicate with the pc when ever it is needed or necessary.
The original post can be found through this link: Control RGB lights from Android with Arduino & Bluetooth LE (BLE)
Aside from following the processes exactly as described in the article, I also did some twist to adapt it to what is available in my chest. The first thing I did is to deactivate the ibeacon function by issuing the following AT command:
AT+IBEA0To check whether ibeacon function is activated or not, this AT command is used:
AT+IBEA?HM-10 will respond: OK Get 1|0
Ibeacon is activated if it returns 1 and deactivated when it returns 0.
Here are the materials and components I used:
1. HM10 BLE module
2. Arduino Pro Mini 8Mhz and 3.3V
3. Dupont wires
4. The RS232-TTL Adaptor that I used to upload sketch on the Pro Mini
5. Li-Poly Battery
6. BreadBoard
I will still be using the same connection just like what I did in my previous testing of HM-10 and was described in detail in my previous post. If you haven't read it yet, you may click on this link: HM10 BLE Module with Ibeacon .
With that set-up, all I need is to upload the sketch as described in the reference article but since I don't have an RGB LED, I could just use the LED in the arduino pro mini which is connected to digital pin 13. Digital pin 13 is not a PWM pin so I can only turn it on or off and not able to dim it.
I also downloaded the android app in the reference article and installed on my android phone.
Test Result:
It was awesome!!!
Here's the video of my testing:
This is the sketch that I used:
#include <SoftwareSerial.h>
int bluetoothTx = 3; // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 2; // RX-I pin of bluetooth mate, Arduino D3
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
const int redPin = 13;
const int greenPin = 5;
const int bluePin = 6;
void setup() {
// initialize serial:
Serial.begin(9600);
// make the pins outputs:
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
bluetooth.begin(115200); // The Bluetooth Mate defaults to 115200bps
delay(100); // Short delay, wait for the Mate to send back CMD
bluetooth.println("U,9600,N"); // Temporarily Change the baudrate to 9600, no parity
// 115200 can be too fast at times for NewSoftSerial to relay the data reliably
bluetooth.begin(9600);
}
void loop() {
// if there's any serial available, read it:
if(bluetooth.available()) // If the bluetooth sent any characters
{
while (bluetooth.available() > 0) {
// look for the next valid integer in the incoming serial stream:
int red = bluetooth.parseInt();
// do it again:
int green = bluetooth.parseInt();
// do it again:
int blue = bluetooth.parseInt();
// look for the newline. That's the end of your
// sentence:
if (bluetooth.read() == '\n') {
// constrain the values to 0 - 255 and invert
// if you're using a common-cathode LED, just use "constrain(color, 0, 255);"
red = 255 - constrain(red, 0, 255);
green = 255 - constrain(green, 0, 255);
blue = 255 - constrain(blue, 0, 255);
// fade the red, green, and blue legs of the LED:
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}
}
}
}
I am still using the software serial library because that was my previous setup and I wanted to use the original serial port to communicate with the pc when ever it is needed or necessary.
Subscribe to:
Posts (Atom)







