Through my app, 2 devices can connect by a normal socket connection.
It is working on every device that i have tested, but on devices that have Android 7 it doesn't work, it gives me Network unreachable on the creation of the socket. I did some research and I could not find the solution or even behavourial changes on the devices with Nougat.
Does any of you know a possible solution ?
Related
Phone Model: Google Pixel 4
Os version : Android 12
We have tried to connect Open wifi of IOT device from System but it showing obtaining IP address and never changed state of that one.
Before Android 12 it connects successfully.
Things tried to sort out
1.Forgot Device and reconnect devices.
2 Reboot device.
3.Factory Reset device.
4 Reset Network Settings.
Is there any specific reason or any problem in Android 12?
Yes, on Android 12 they introduced Concurrent Peer-to-Peer + Internet Connection.
https://developer.android.com/about/versions/12/behavior-changes-12#concurrent-connections
You can use their new APIs to get the IoT device's connection.
However I'm having a problem in my app when I try to serve a firmware upgrade using a local HTTP server on Android. NanoHTTPd seems to be using the primary Wi-Fi connection, even though the app's process is bonded to the secondary Wi-Fi.
If you find anything on that, please let me know too haha
We are using Android BLE code for connection to a custom hardware and with most mobile devices, this works perfectly. However, when it comes to Samsung with the Android OS Version 6.0.1, attempt for connection is not successful in most cases.
The problem is happening after trying to connect to a device with bluetoothDevice.connectGatt(context, false, gattCallback);
In onConnectionStateChange callback gatt status code 133 is received and in that case what the app does is to close the current instance of the BluetoothGatt and connect again to the device for a new BluetoothGatt instance. This workaround helps to get a connection after a couple of retries but this is definitely not the way how it should work.
After doing some BLE sniffing, it is clear that the device is not even trying to connect to the peripheral and just gives out the general gatt error (133). What is interesting that this has been a major problem only for the Marshmallow update, more specifically on the Android 6.0.1.
So my question is whether anybody experienced similar connectivity issues with only selected devices, where the mobile device tries to connect to the device and instead receives 133 gatt status code?
I'm stuck with implementing connection between Android Lollipop smartphone and BLE device (TI experimenter board with BLE module). I use following call to connect:
device.connectGatt(context, true, mGattCallback);
I've managed to establish connection for Android 4.3 and 4.4, but when I use this same code for Android 5, I get following error on BluetoothGattCallback::onConnectionStateChange:
onClientConnectionState() - status=133 clientIf=5 device=D0:36:12:CD:73:49
Error code 133 means GATT_ERROR.
I tried to use my own app, google sample and BLE scanner app from play market, but none of them were able to connect to device. I also tried several Android 5 smartphones with no luck.
However, I have another device (TI wireless connectivity development kit), and I can establish connection between it and Android 5 smartphone. So the issue is related to Android 5 and my particular device. I wonder how it can be solved or at least how can I debug this kind of error to find out the root cause.
P.S.
I also tried the approach proposed by #nayoso here, but it didn't helped either.
You may have hit the maximum connection number, see this:
https://www.youtube.com/watch?feature=player_detailpage&v=qx55Sa8UZAQ#t=1712
Is it possible to connect a android mobile bluetooth with multiple bluetooth devices. And I need all the connection active at the same time and can transfer data at same time too.
Yes. You can connect the phone with up to 7 devices (in theory). They form a 'piconet' with the phone as the master.
If the phone initiates the connection to the first two devices then it will likely be the master (as necessary).
If you find that you are having problems connecting more then one or two devices then you should root your phone, and run 'hcitool' to determine which are slave and which is master.
Come to think of it, Nexus devices just got a new Bluetooth stack in 4.2 and I don't know if it supports hcitool. If not, hopefully they have created an alternative.
Iam connecting 3G phone for my Android device for internet connection and another Socket(SPP) for CAN signal receiving.Whenever I manually connect to the Bluetooth tethering via 3G phone, i can browse internet perfectly and speed is good.Whenever programmatically connect to the 3G connection, i couldn't browse internet.i checked in shell and observing that in my mobile 'device is connected' message displayed and E symbol appears.No problem for me to connect Socket.But I got problem to use 3G phone.For this iam using APN/DUN mode.I checked both but no use.Is there any performance issue here or anything wrong to connect different devices by using Bluetooth API in android.Why this happends while connecting Mobile programmatically.Please give me guidance.
Regards,
Rajendar
Yes, you can have several open connections at a time.
In fact, I've used my hands-free bluetooth on my phone, as it is connected to my ELM327 SPP device streaming at full speed. I didn't notice any hiccups.
As for losing connectivity when you are connected to multiple devices, it's most likely an issue with the DUN provider you're using.
Also it's worth stating that, on Verizon/3g phones, when you use the phone as a phone, it suspends all 3g data services until the call is terminated.
The way L2CAP defines the LT_ADDR allows connecting devices up to 7. Your connection problems is something else.