I am trying to write an application for google glass to read the RSSI value of a stickNFind Beacon on regular intervals (800 milli seconds) for which I need to connect to gatt server.
When I try to connect to the gatt server in BluetothLE mode, it disconnects immediately.
When I am connecting to gatt server using this:
mConnectedGatt = btDevice.connectGatt(this, false, mGattCallback);
I get this in the call back:
onClientConnectionState() - status=0 clientIf=4 device=E1:FC:AF:DB:E3:FC
and then immidietly I get this in the call back:
onClientConnectionState() - status=62 clientIf=4 device=E1:FC:AF:DB:E3:FC
The same code is working fine on my nexus 7.
Does anyone has any idea if Google Glass's support is good enough to connect to gatt server?
I don't understand the status 62 code...please help
Related
First post! Full disclosure, I have a very limited programming / pi background.
I'm working on a project to communicate with a Chroma Bi-Directional power supply (Model #: 62180D-1200) using LXI / SCPI communication. There's more I hope to do in the future, but for the time being I'm simply trying to establish a working communication channel using the "*IDN?" identify command. I have a raspberry pi connected to the same network as the power supply, which I am using to communicate to the 62180D.
Before beginning any of this testing, I have been able to establish that I can communicate with the device via http (web browser). The web page for the device even includes an scpi query tool -- which works!
Successful HTTP communication
To query the device from the pi I have used PuTty to log in to my pi and issue the following command:
lxi scpi -a <device ip address> "*IDN?"
I am expecting to see the same result as shown in the image above (Model No. , Serial No., Firmware Version), but instead I'm receiving the following:
Error: Read error (timeout)
Error: Failed to receive message
I was under the impression that this protocol is fairly plug and play. I have other LXI enabled devices on the same network that I am able to communicate with them using this same approach. Is there some obvious thing I'm missing here?
I'm trying to connect a bluetooth device (ESP32, peripheral) with Web Bluetooth (central). I send an addvertising packet and I can see the device on the web page, but I fail to connect to it. My code for the ESP32 looks like this: (MicroPython)
ble.gap_advertise(interval_us=100, adv_data=bytearray(b'\x02\x01\x06\x06\x08\x45\x53\x50\x33\x32\x11\x07\x26\x6c\x34\x7f\xb2\x38\x61\x82\xbe\x4d\x1d\x64\xf1\xf7\x93\x16\x02\x19\x80'),resp_data=None, connectable=True)
In Web Bluetooth (JavaScript) I just request a device and try to connect to the gatt.
Can anyone help me out?
Thanks in advance!
The JavaScript does work with another bluetooth peripheral. (RN4678)
And in JavaScript I can find the peripheral (ESP32) after filtering, but I can't connect to it.
JavaScirpt:
server = await device.gatt.connect()
The code stops at that point.
MicroPython:
The GATT is defined using:
ble.gatts.register.services()
I'm trying to use my own service, not a SIG defined one. So I advertise b'(x...') which contains the flags, the service and the device name. And it works with the nRF Connect App. I can send and recive data. But it doesn't work with the bluetooth enabled web browser.
Thanks for your help!
I'm trying to connect to a BTLE device from Linux from C++ with BlueZ.
Connecting to most devices works fine, but there is a special device which times out with 90% probability. From a standard Android smartphone the connection to this particular device works as intended.
For #Emil's advice in my other question (thanks!) I've setup a Link Layer sniffer tool for further investigation.
During the sniff period I tried connecting to the device(Destination) from both device(Good) and device(Bad).
Device(Good) is working perfectly - it connected
Device(Bad) is not working - timed out
Now I have a Link Layer data of both device connection trials and there is one significant difference between their trials:
Device(Good)'s LL Data for its CONNECT_REQ uses 500 for Timeout value (which is 625ms) while Device(Bad)'s LL Data in CONNECT_REQ uses 42 (which is 52.5ms).
I think Device(Destination)'s response is normally (mostly) arriving between those two, ie after 52.5ms and below 625ms, but sometimes it arrives in less than 52.5ms, and then also BlueZ can connect to it finally.
Is there any possibility to change this Timeout property for CONNECT_REQ in BlueZ? Maybe with setsockopt by any chance?
Or this is something hardcoded into kernel, even for bluetooth adapters attached to USB?
We have a fully-working java programme which can connect to another computer and can send messages from this(both sides run java and we used ObexPutClient and ObexServer), however when trying to connect to the NXT Brick and send a message via bluetooth we are able to pair with the brick and we can send a message but we have no idea if the NXT receives it.
When we tried to use Java ObexPutClient on computer(we provide the ServerURL of NXT to java programme) to send the message to NXT Brick running the RobotC, it does't work. On java side, the error is given:
"Failed to connect; [10064] A socket operation failed because the destination host was down."
Is the error we receive on Java.
Using robotc the brick is waiting for a message to be sent and it is awaiting 3 integers to help the robot move.
How have people sucessfully done this, we have ensured the port number is the same.
The NXT does not provide the OBEX Bluetooth service. It uses the Serial Port Profile (SPP - also sometimes called RFCOMM). When you pair your NXT with your host computer, it will create a serial port (e.g. COM4) on your host computer. In your Java program, you need to open this serial port and send data that way.
Also, leJOS has a PC Library (Java) that includes communication and remote control features. You could probably use this so you don't have to write your own.
I am curently looking to find out wheter it is possible to Bluetooth connect an arduino or similar micro controller to the pebble watch using the RN-42 Sparkfun RN-42 adapter
I currently am having difficulty connecting to the pebble, as the board just times out.
Thanks
The RN-42 can, using bluetooth. The following will get you paired, and the watch MAY accept a ping:
SF,1 //factory reset
SP,9999 //takes care of the pairing code
SM,6 //pairing
SA,4
SY,0000 //power
SW,0640 //sniff mode
R,1 //reset so settings are saved/active and pebble should ask to connect
To pass app messages you need to pass some information to the watch, see http://dexwatch.blogspot.com/2015/12/more-on-pebble.html for the full details.