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.
Related
I am currently working on a project in MIT App Inventor, where I am connecting an Android device to an Arduino via Bluetooth.
Is it possible to connect multiple Android phones to this Arduino, and is there a procedure by which an Arduino could distinguish between them?
I assume, that you are using a serial bluetooth device, such as HC-06 or HC-05. As I know, even the master module HC-05 can only connect to one client at a time (which makes sense, since the serial connection on the other side is the same)(despite the fact, that bluetooth in principle allows handling multiple clients at a time, though it's a rather complex task). This means, that you would have to use one serial bluetooth module for each phone, you want to connect at the same time.
When using more than one bluetooth module, you have to connect them to the Arduino over serial, but only one device can use the serial connection at a time. Depending on the number of phones, you want to connect, you can use either the SoftwareSerial library to emulate more than one serial connection (so every connection can be identified by its own SoftwareSerial object), or you have to multiplex your data lines between the different serial bluetooth devices (so that you control the serial connection to the devices with for example setting digital pins). For the last mentioned possibilities, I'm not sure about the property limits in the serial connection. Maybe you can multiplex just only with a few transistors.
If you want not only distinguish between the different connections but directly between different phones (for example to remember special settings for only your phone, not the others) you would have to send an identification over bluetooth to the Arduino (for example the MAC adress of the phone).
For more help, you should state you question in a better way and telling more details
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.
I cannot figure out how to send a UDP packet over a 4G LTE network from an Android app (no WiFi). Does anyone have any ideas or know where I can find some documentation? I need to write two android apps, one client and one server, so that I can send UDP packets with timestamps from one device to the other. This is to test 4G LTE network latency from device to device.
Please help!
Thanks!
You can use the DatagramSocket class:
http://developer.android.com/reference/java/net/DatagramSocket.html
This should work regardless of WiFi or mobile connection type, although you may find some mobile operators have some restrictions on UDP connections.
There are many existing Android Iperf apps that can be used for exactly what you are trying to do. I use Magic Iperf to do this type of testing myself.
I have an Android app that I had working a few months ago which I could use to connect my Droid X2 to an ASUS Transformer tablet over Bluetooth. That connection worked fine.
I just finished coding client/server pairs using PyBlueZ on a couple Ubuntu machines, and an analogous client/server pair using BlueCove on a Windows machine.
I thought it would be a breeze to take these three working, tested systems and connect them. Unfortunately, I am currently unable to connect my Droid X2 to my other machines, nor can I connect my other machines to my Droid X2 (I no longer have the ASUS Transformer). I can, however, connect my PyBlueZ client/server pair to my BlueCove client/server pair without issue.
Are there any known intricacies when connecting Android devices to desktops/laptops? Any additional information that must be provided, or differing formats in communication? I'm trying to connect using an insecure rfcomm channel to a service listing. I am using the same UUID on both sides. And, again, I had this exact insecure rfcomm service connection working between my Droid X2 and an ASUS Transfomer.
One interesting aspect is that even though all systems use the UUID, my PyBlueZ and BlueCove implementations also have a service name, but Android does not ask for a service name to connect to a service, only the UUID. Could that be an issue?
Thanks.
The error I was getting was Connection Refused when trying to connect over a bluetooth socket to my other devices. After much pain and research, I found that I could manually unpair my computers from my phone and then the bluetooth socket connects fine.
The strange thing is that I never even paired those devices, so I don't know how they got that way. But if you are getting Connection Refused, see if your Android device is paired to the machine you're connecting to, then manually unpair it, then try connecting with a bluetooth socket again.
Hope this saves someone a few hundred hours...
I am trying to use Bluetooth SPP to communicate over it. In some Android phones, SPP profile is not activated. I faced the problem in the application that SPP was not activated and so the connection could not be established over bluetooth and when I started another app that is 3g hotspot which I think activates SPP and I was able to connect over bluetooth in my app.
So, how can we actually activate SPP profile of bluetooth in Android devices? And does all the android devices has SPP profile?
In developer.android.com BluetoothSocket:
The most common type of Bluetooth
socket is RFCOMM, which is the type
supported by the Android APIs. RFCOMM
is a connection-oriented, streaming
transport over Bluetooth. It is also
known as the Serial Port Profile
(SPP).
This might answer your question ..
https://source.android.com/devices/bluetooth/services
SPP (or ability to use Java API's to establish RFCOMM channels) is available from Android (2.0/2.1) release (Eclair) onwards
On the Android phone you will probably need to run an application that initiates the service over SPP.
**
public BluetoothServerSocket
listenUsingRfcommWithServiceRecord
(String name, UUID uuid)
** API can be used to create a service with specified UUID to listen,
Doing this should make this service visible to other devices which can then connect to it.
I just called Samsung help regarding bluetooth SPP on an S8+ phone. They tell me wait for Android Oreo as it isn't available till then. My previous Sony Xperia used Ntrip Client to talk to an external Geneq GPS to receive corrected coordinates and worked really well. Seems we went backwards somewhere?
Ntrip client on the phone collects an internet data stream of GPS corrections every five seconds and sends these to the GPS. The GPS uses the corrections and sends back adjusted coordinates to the phone to use in any application.
I would appreciate someone brighter than me pointing out a quick fix I just load and run to bring back this functionality.