HC-05 Configuring. IOT project - android

First, I'm new to Arduino and Android programming. I had a college project, an automatic crash detection and notification. I used this link.
I have made all the connections correctly. The first problem I faced was that I couldn't connect my phone to the HC-05. It wasn't even discoverable and the LED didn't work. I thought my HC-05 was faulty and bought a new one. This one flashed the LED when connected. Then without going into AT command mode to change the baud rate I directly paired the HC-05 with my Android phone and tried the app.
The data from my Arduino wasn't being sent to the phone. I tried getting my HC-05 into AT command mode later on, but it wouldn't go into that mode. I tried all the tips from here. Still it wouldn't go into AT command mode. Can anyone help me with this problem please?

Need to do initialization
- the BT pins:
5v to 5v arduino
GND to GND arduino
TX to RX arduino
RX to TX arduino
solder pin 34 of BT with wire and connected to any digital pin of arduino
then, in void setup set digital pin to low, and after delay, 1 sec, set pin to high
this way will let you get in AT command.

Related

HC05 does not connect

I am doing STM32 programming for my summer internship. Currently I am attempting to use an HC05 bluetooth module to send serial data over to the stm32 board. However, my HC05 bluetooth module does not connect to any of my devices. I am using android devices as well. I can find the device over bluetooth and I can pair the device as well, however it never connects. Does anyone know how I may be able to solve this issue. The HC05 is receiving 3.3 volts as well.
The problem turned out to be a hardware problem by the hardware engineers, not a problem with my code. The TX of the board was connected to the Tx of the HC05 and the RX of the Board was connected to the RX of the HC05. It should have been connected the other way around
which app are you using for testing your Bluetooth module? I recommend you use this one: https://play.google.com/store/apps/details?id=com.clarence.bluetoothserial, with which you can customize your frequently used commands as buttons. It’s very convenient.

HM-10 BLE microcontroller connected without PIN

I'm using HM-10 controller to communicate with my Android App. In Arduino console I set pin with command AT+PIN112233 which should be Passkey for BLE device. This PIN was saved to my device but Android phone can connect to this device without any confirmation or PIN request. Is this normal behaviour?
I just find device through scanning in BroadcastReceiver and I get device under action BluetoothDevice.ACTION_FOUND. It will return BluetoothDevice and I just connect to this device with
bleGatt = bleDevice.connectGatt(this, true, bleGattCallback)
I did not get any Dialog window in my Android App asking for PIN. Also tried some other apps for Bluetooth or BLE connection and it was the same. None of them asked for PIN during pairing.
Also my HM-10 BLE controller does not react to some AT commands:
AT+TYPE2 returns +TYPE=0
AT+VERR? not responding
AT+VERS? not responding
AT+RESTART not responding
AT not responding but AT+ responds with OK
I believe this behavior is normal. The same thing happened with my Arduino Nano 33 BLE and Android app that I built. The pin code connection process is for bonding.
I had clone model MLT-BT05 where AT+TYPE2 is not working. That means I cant set pairing method only change PIN which is practically useless.
The AT+TYPE command only works with HM10 version >V515. The default for any module is
no need pincode(TYPE 1)
The command to get version of our module is AT+VERR?.
Data sheet of HM10 https://people.ece.cornell.edu/land/courses/ece4760/PIC32/uart/HM10/DSD%20TECH%20HM-10%20datasheet.pdf

Hc-06 can't connect to a pc, but it can pair to a phone.(keep flashing)

I have a Problem with my HC-06s.
edit:
after some more testing on a different pc(where it works) it seams to be system related.
I am trying to connect one to my Laptop so that I can receive data. I have 2 HC-06 and a additional Bluetooth dongle to my built-in Bluetooth.
One of the Modules has worked in the past with the same laptop( it is a lenovo t420) but I had to reinstall windows and now I run Win7 while it was Win10 before. therefore it is possible that it is a partially a driver problem. But they seam to be up to date.
So far I can "connect" both HC-06 to my laptop but they don't stop flashing the led.
When I then try to use TeraTerm( or arduino Serial port) to connect to the com ports I can only connect to the Inbound com with the other it gives a error("acces denied" or " port busy") But I don't recieve anything, even though the arduino should be sending non-stop.(code below). And the modules keeps flashing. I also connected the RX fo the module to the Serial tx to try to get the date from there just in case the Softwareserial wasn't working.
If I use the Bluetooth dongle, a generic chinese csr4.0 dongle, I "connect" as well but the modules don't have there own com ports. and I can't connect to the ports of the dongle.
I also tried to connect it to my phone. I used the "bluetooth Serial Terminal" (by Kai morich) and it could successfully connect to one of them and I was even able to receive some data but it was only a unidentified character but at least it works.
but If I sent some data from my phone I don't recieve any on the arduino.(yes I checked the wires and changed it over several time just in case)
void setup()
{
Serial.begin(9600);
Serial.println("Enter AT commands:");
// HC-06 default serial speed is 9600
BTserial.begin(9600);
}
void loop()
{
if (BTserial.available())
{
Serial.write(BTserial.read());
}
BTserial.print("1001");// used also .write or .write(Serial.read) with no effect
Serial.print("1001");
delay(500);
}
I hope someone has some Ideas what could be wrong here.
regards
Walter
ps:
I also have a work-around option: I also have a AT-09 Bluetooth 4.2LE module which works succesfully with the same wirering with my phone. So if I could send the data live from the phone to the pc (preferable via USB) so that I can use it in Processing that would work aswell. but I have no experience with android programms therefore it would have to be a finished app.

AT commands do not work on BLE HM 10 through Arduino

I've tried to send AT commands to my Ble 4.0 HM-10 module by connecting it to an Arduino Board and sending command through Arduino IDE's Serial Monitor but I don't get any response.
Can someone tell me how to do this?
Also when I'm near the Bluetooth module my Android phone can connect and send data to the module. But when I'm close and there is a small obstacle between my phone and the module, the module doesn't receive the data but remains connected.
Can someone tell me the reason?
Thank You
set your line ending to no line ending

How to discover XBee from Android and send data between the two

There are a number of threads regarding this topic, but I haven't been able to troubleshoot my issue yet and haven't seen much talk of using XBee-4 Nano. I am working on a Arduino/Android project where I need to have a remote XBee monitoring a button, once the button is pressed an notification is sent to my Android phone and I receive a message in the task bar saying the button was pressed.
I've been working on this for weeks... I've read many home automation book, walked through the XBee Lab manual, searched many forums, and installed the tools for Amarino. and the issue I'm having is not understanding how to get the XBee and Arduino to work enough to be discovered by . The Android portion I will be able to take care of.
The tools I have are
http://www.makershed.com/Xbee_Series_1_Starter_Kit_p/mkpx19.htm
(2) XBee 802.15.4 (Series 1) embedded-antenna modules.
(1) XBee USB Adapter for easy PC connection.
(1) XBee 5V/3.3V Adapter for microcontroller connection.
http://www.gravitech.us/xbadforarna.html
(2) XBee-4 Nano (shield for XBee and Arduino Nano)
(3) Arduino Nano
(1) Arduino Uno
X-CTU
Putty
Arduino IDE with Amarino
Android Phone
My ideal setup is connect configure XBee and Arduino Nano on the XBee-4 Nano shield to monitor a button, connect XBee/Arduino to Android phone, then on button press, phone receives a notification.
I am able to monitor the button and turn on LED on button press using the Adruino Nano. How do I sent this data from the Arduino to the XBee using XBee-4 Nano? Are the TX->RX and RX->TX already connected and the XBee will just broadcast the data, or do I need to manually set up jumpers to do this?
Next question is how do I discover the XBee module from my Android phone? I have successfully completed the Bluetooth chat project between my 2 XBee's. I have installed the Amarino on my phone, but when I have the XBee hooked up to either of the adaptors or XBee-4 Nano, I am unable to discover the xbee. Why is this? Is there something with the baud rate or other setting I need to update to be able to do the discovery? Is the issue with the adaptor I am using? There is power to the XBee since I can light up an LED using D05 = 1 and ground.
If you can point me in the right direction on how to use the XBee-4 Nano and how to discover the XBee from an Android phone (using Amarino), it would be much appreciated.
Thanks
Are the TX->RX and RX->TX already connected
yes, just look at the schematics: http://site.gravitech.us/Arduino/XBEE-4NANO/Schematic.pdf
how do I discover the XBee module from my Android phone?
What do you mean for "discover"?
if you mean when the xbee is plugged, you cant easily. xbee is transparent, they are like connecting cable directly. but they respond to come AT command, if i'm right, so you can try to use them (but probabily the BLUETOOTH card will respond), unless the request is done on the mini side, and only a specific signal is sent back to amarino.

Categories

Resources