Is there a way to relay bluetooth between phones? - bluetooth

I have a device that can only be controlled by bluetooth on a specific phone. Would it be possible to use a second phone to act as a relay or proxy close enough to connect via bluetooth to the device, but kind of feign the connection with the first phone over the network?

You'd want to make a mesh network.
https://www.bluetooth.com/blog/introducing-bluetooth-mesh-networking/

Related

Bluetooth mesh gateway architectures and implementations

Could anyone clarify a bit about Bluetooth mesh gateways' implementations. I wonder to know possible ways of Bluetooth mesh gateway implementations. How is it possible right now?
If I have a SoM (for simplification it could be a Raspberry Pi board) with Linux, which uses BlueZ stack underhood, and I want to control Bluetooth mesh network from it. Is it possible to directly control Bluetooth mesh nodes, sending packets to them and receiving packets from them throught Bluetooth mesh? Should be the gateway a part of Bluetooth mesh network as a separate node? It seems that nRF Mesh mobile app from Nordic employes a specific opportunity to control devices via PB-GATT packet, connecting to a Bluetooth mesh node with Proxy feature. A mobile device connects to the node using Bluetooth LE and encapsulates Bluetooth mesh packets, sending through this node, and not directrly, using Bluetooth mesh advertising packets. So, could anyone clarify, is it possible to control Bluetooth mesh networks from such kind of device with Linux? And if yes, where could I look to understand, how it's possible? And if no, which options do we have to control Bluetooth mesh network from the gateway? Do we need to connect a microcontroller (like nRF52840 or ESP32) via UART/SPI to our host MCU and write a custom firmware for it to control Bluetooth mesh network, using this microcontroller as a proxy between gateway and Bluetooth mesh network? Or could we control the Bluetooth mesh network, connecting to a arbitrary Bluetooth mesh node with Proxy feature through Bluetooth LE and control the the network, encapsulating packets, as it nRF Mesh mobile app does?
How do companies realize their Bluetooth mesh gateways? How do they control the mesh network from them if BlueZ doesn't support a native Bluetooth mesh controlling (only provisioning)?
Thank you in advance for any assistance with understanding such the details and any recommendations. It would great to hear others' thoughts about this problem.

How to allow only 1 connection to BlueZ GATT server at any given moment?

I'm working on Bluetooth on the embedded Linux. I'm using BlueZ and D-Bus. I have a server taken from the example https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-gatt-server.
I have the app such as nRF installed in 2 iPhones. I'm able to connect to my Linux Bluetooth server at the same time. I'm able to modify the characteristic from either of the iPhone app. But this is a problem because we don't want it. We'd like to have only 1 phone connected to the Linux device. That way, the same characteristic won't be modified by more than 1 phone app at the same time.
Is there a way to allow only 1 connection to the Linux Bluetooth GATT server at any given time?
Thanks.
Yes, the way to do this is to disable/stop advertisements on your Linux device as soon as a connection is established. This way, upon a connection, your Linux device will no longer be advertising and remote devices will no longer be able to connect to it.

How to communicate with an Arduino circuit using a web app?

I have recently made a Arduino circuit as shown in the link below:
http://www.instructables.com/id/DC-Motor-Control-With-Bluetooth/
As you can see, the person in the video of the above link used a bluetooth controller app to control and send signals to the Arduino board via HC-05 bluetooth board.
Here's the question. How can I use a web app/ web instead of a native app(like the video) to control and send signals to the Arduino board?
It would require the use of additional hardware. It is for connection to the network or broadly web.
Once we consider this we have several options infront of us :
We can use a gsm module. In this hardware we would insert a sim and use its network for connecting to web. But when you buy a GSM module be sure that it got http services as some modules support only message services. ( I would suggest GSM sim 900A module).
We can use a wifi hardware. This would act just same way as wifi on our mobile or laptop. But it requires some hotspot in its range thus restricts portability.
We can connect an ethernet cable to the arduino module and use the network. But thus restricts portability more than wifi. But you can go for that to if that satisfies your need.
Once you get the network for connecting to the web, now comes the point where your device must listen on the web for the requests that come to the device and must act as the inputs. We call it creating a server. The server listens on web and respond to them. As for a beginning you can follow this article.

App Specific Bluetooth Pairing

I was wondering if there's any way that I can control BLE device pairing specific to my app running on mobile device?
I do not want to write my own bluetooth profile so that only my app can talk to the BLE device instead i want to standard profiles available in BLE device but when it's paired to my phone, only my app should be able to communicate to it and none of the other apps should be able to communicate.
No don't do that.
If you MUST then you should encrypt your data with a key only your app knows.
Bluetooth Low Energy is supposed to be open and free for all.
What is the purpose for you to block others? Preventing them to block your service?
Then use some pre-shared key to verify that it's your app in both sides and close the connection if it's not.

Is it right to send data in J2ME through cable by mean of DatagramConnection?

I want to send data by using J2ME between a mobile phone and a computer. The two machines are connected by the phone's cable : there is no Wi-Fi , no http connection , no Internet. So is it wrong or correct to use the J2ME DatagramConnection to send data to the computer when the mobile's cable is inserted to the USB port of the computer ?
When you talk about interaction between two systems, first you will need to address the connectivity. In the situation described, the connectivity between the phones is via USB, which is a serial port. So the communication can be done over serial port only.
Datagram can be used over IP networks and other specialized networks.
If for some reason you are unable to communicate via USB, check if you could connect both of them using Bluetooth. If your phone has Bluetooth and the computer doesn't, then you could purchase an USB Bluetooth Dongle for very cheap.
If you are trying to get logs of your application, you can check out Bluetooth loggers for J2ME. There are quite a lot of them. One such library is microlog
Hope this helps.
It depends, if you require high speed of data transfer while can bear some data loss then DatagramConnection is ok, and if you can't bear loss of data packets, then you should use TCPConnection.

Resources