Unable to connect to Bluetooth service from chrome - bluetooth

I am trying to write a web app to control the target power of my Kickr Core turbo trainer.
I spent far too long trying to connect to the fitness_machine profile before realising that my trainer does not support this. Instead it uses a custom kickr profile and I managed to find some docs on it here.
The uuids listed (A026EE07-0A7D-4AB3-97FAF1500F9FEB8B for Wahoo Fitness Equipment Service) do match what I see when I look at chrome://bluetooth-internals after a bit of formatting: a026ee07-0a7d-4ab3-97fa-f1500f9feb8b.
I am not able to connect to this service though. If I use this uuid to requestDevice({filters: [uuid]}) then no devices are listed in the connection dialog. If I acceptAllDevices: requestDevice({ acceptAllDevices: true, optionalServices: [uuid] }) then I see my trainer listed but when I select it I am not able to connect to the service, I am told that the service does not exist.
What else can I try to get connected to my trainer? (I am really regretting not getting a trainer that supports the standard Bluetooth profile now but nothing can be done about that now!)

Related

HM-10 BLE Module - connect to other Devices

first of all: What i am trying to do is only for private interest.
I'd like to connect a AT-09/HM-10 BLE-Module with Firmware 6.01 to another device which provides also a BLE Module, which it is not based on the CC254X-Chip,
I am able to communicate with this Device using my Laptop with integrated Bluetooth, Linux and the bluepy-helper. I am also able to make a connection using the HM10 through a USB-RS232-Module and "Hterm", but after that quite Stuck in my progress.
By "reverse-engineering" the Android-Application for controlling this particular device i found a set of Commands, stored as Strings in Hex-Format. The Java-Application itself sends out the particular Command combined with a CRC16-Modbus-Value in addition with a Request (whatever it is), to a particular Service and Characteristic UUID.
I also have a Wireshark-Protocol pulled from my Android-Phone while the application was connected to the particular device, but i am unable to find the commands extracted from the .apk in this protocol.
This is where i get stuck. After making a connection and sending out the Command+CRC16-Value i get no response at all, so i am thinking that my intentions are wrong. I am also not quite sure how the HM-10-Firmware handles / maps the Service and Char-UUIDs from the destination device.
Are there probably any special AT-Commands which would fit my need?
I am absolutely not into the technical depths of Bluetooth and its communication layer at all. The only thing i know is that the HM-10 connects to a selected BLE-Device and after that it provides a Serial I/O and data flows between the endpoints.
I have no clue how and if it can handle Data flow to certain Service/Char UUIDs from the destination endpoint, althrough it seems to have built-in the GATT , l2cap-Services and so on. Surely it handles all the neccessary communication by itself, but i don´t know where i get access to the "front-end" at all.
Best regards !

Can I reach a device from any unit using Azure Service SignalR?

I have a websocket server which handles connection to some devices (from third parties so I don't control their implementation).
My system was working fine with .NET framework on an app service until I figured out that app services have a max outbound IPs of 8000 connections in my case.
I need to move towards a more scalable server which brings me some questions.
My constraints : I need to keep a constant websocket open with the devices and be able to reach them at any time to send them messages (one by one).
I started looking into Azure app service Signal R (or the Web Pub Sub which seems very similar). The code and the pricing seems to fit my needs. Using the upstream feature I could also send custom messages to my devices.
However I don't understand the scaling part, it says each unit can contain 1000 devices.
Following this question : What is a Unit in terms of Azure Signal R Service?
All my devices are going to connect to myapp.com, 5000 of them so divided in 5 units. They are going to send me messages sent to Azure functions for analysis.
But if I decide to send a message to device n° 4300 do I need to know on which Unit it is? Can I reach it if I have several units?
I couldn't find the answer on azure's docs or signalr.

Thingsboard; Data about same sensor, but from a different (multiple) gateway

I have just started using Thingsboard and made some good progress in understanding how some of the basic stuff works ( mainly sending sensor data using mqtt ). But I have come to a complete halt at one point. Here is an explanation of the problem. Thingsboard version is 1.3.1
My setup:
4x RPi (Raspberry Pi) used as gateways to gather data from bluetooth
beacons
A set of bluetooth beacons
Here's what the system is supposed to do:
Send periodic data from the gateways ( RPi ) to inform thingsboard that the gateway is alive
The above part is working fine. I have set up the gateways to connect to thingsboard using access token, and post the data ( both the attributes and telemetry ). For sending attributes I use "v1/devices/me/attributes" and for telemetry data I use "v1/devices/me/telemetry", as mentioned in the documentation.
A typical string from the gateway indicating that it is alive is
{"gwA.macid": "00:00:00:00:00:00", "gwA.timestamp": "2018-02-16T19:20+01:00"}
The above part is working well. This is just for an indication that the gateway is well and able to communicate with the Thingsboard server. All the gateways connect to thingsboard using it's own respective access token and posts the above data.
Now the problem part ( or where I got halted )
The gateways gather the data about the nearby bluetooth beacons and post it too.
The data format in which the gateways posts the beacon data is
{"bcn000001.mac": "00:00:00:00:00:00", "bcn000001.timeepoch": 1518939044}
The gateway ensures that each beacon data will have the correct prefix. For example
{"bcn000001.mac": "50:80:25:AA:BB:CC", "bcn000001.timeepoch": 1518939044}
{"bcn000002.mac": "50:80:25:RR:AA:DD", "bcn000002.timeepoch": 1518939039}
{"bcn000003.mac": "50:80:25:GG:33:EE", "bcn000003.timeepoch": 1518939020}
But the data about the same sensor can also come from another gateway. How do I show it on a single widget irrespective of which gateway the data comes from. If I choose "entity list" then either it does not work, or shows up all the 4 RPi gateways on the widget. This is not what I want. I have attached an image. I am not sure if I am able to explain this well but pls do let me know if there is any other information that I can furnish. I am adding an image to point to some things that I just mentioned. I have even separated the data out by using a prefix ( as mentioned in one of the earlier SO posts ). I have spent close to couple of days on this. This was not supposed to be difficult. At least that's what I thought when I got started.
Note: As I explore, I just learnt (realized) one more thing. I think this part was a little confusing so I thought I should inform others. When one adds a device in Thingsboard, there is an option to specify if the device "Is a Gateway". What it is trying to tell(ask?) is that whether thingsboard gateway service is installed on that device. In my case I made the mistake(?) of thinking that a device that gathers data from sensors and posts it to the server is a gateway device. I guess I'll try to install thingsboard gateway service on the raspberry pi, then see how it goes. I'll post an update once I am done but in the meantime any useful comments or suggestions - please keep em coming.
I have seen others ask very similar question on SO. Something fundamental like this shouldn't be so difficult. No point in have a hundred pages of documentation without a clear explanation of most basic steps towards setting up an IoT backend/dashboard. All I wanted to do is to display the same sensor data ( say Sensor A ) coming from "any one of the devices", to show on the same widget. If I choose single entity, the widget won't update if the data comes from other device. If I choose entity list, and turn on "Resolve as multiple entities", then I end up with the widget showing all the devices
you are using wrong API. The API you are looking for is gateway API which allows to push telemetry and other messages on behalf of other devices. Please use this API https://thingsboard.io/docs/reference/gateway-mqtt-api/ on the Raspberry Pi gateways. You can also use our Gateway project and modify it for your needs.

How to check GPRS Availability before sending Data through HttpConnection

I am making one Java ME Application. Here I am using HttpConnection for making Connection with webservices. I send/Receive data using HttpConnection, DataInputStream & DataOutputStream. But My Problem is that How can I check that currently GPRS connection is available or not ?
I got, System.getProperty("com.nokia.mid.networkavailability"); API to check the Network's Availability. But I want to know how to check if GPRS is available or not ? Help Me Regarding this. ( I am using Nokia's E5 Phone for Development work ).
Based on this article, You can use the following property for getting the network access type of used active connection or a set default access point.
String value = System.getProperty("com.nokia.network.access");
Also you can read this article, IAP Info API in Java™ ME. It will helps you.

how to check internet availability in j2me

How to check internet availability on mobile application.... in j2me....
Use this property for detect the available GPRS connection on s40 series mobiles.
com.nokia.network.access
Its returns the networking access point type. the possible values for this property are:
* pd — Packet data, for example GPRS
* csd — Circuit-switched data, for example GSM CSD/HSCSD data call
* bt_pan — Bluetooth PAN network
* na — Not applicable, the implementation cannot determine the type r
For more info see this wiki link.
Also you try to access url to verify that. If you got timeout or any connection related exception means the type of network is not available.
There is no standard way in JavaME of doing this. You might want to check custom vendor libraries, e.g. Symbian JavaME libraries.
You can try to ping a server or try to make a connection and catch the exception. But this doesn't give any indication whether the phone is generally capable of connecting to the internet or not. It just tells you, that you can't connect at that moment.
Try just making a connection and see if it throws an exception.

Resources