telehash/telehash-js

telehash and bluetooth

sunilsomarajan opened this issue · 4 comments

I am planning to use telehash to mesh a bunch of devices that uses Bluetooth (not LE) as its physical link and establish links and pass messages between them. Could I get some guidance on what I will need to do for discovering nodes. If I cannot use uriBeacon, what is the alternative?

Thanks,
Sunil

I'm unfortunately not familiar with traditional Bluetooth, I've only worked with the LE protocol so I don't have a quick answer for you.

You should be able to do something similar as BLE though, advertise part of or a derivative of the device's hashname when the service is announced, before-pairing, and then when paired use either a serial/uart profile or if the devices support an IP link you could use traditional TCP/UDP?

I'd be curious to learn more though so happy to see any progress posted here on this issue :)

It appears that LE might after all be an option.

There are 2 network transports I am considering.
Wi-Fi Direct and BLE. telehash-C is what I plan to use as this is an embedded system.

With Wi-Fi Direct I assume that I can use traditional UDP. Is peer discovery built-in to the library? I dont want to rely on Bonjour.

Is there an example available for connecting 2-3 nodes and communicating with each other using UDP? I looked at the tests directory but I am unsure where to start.

For BLE it appears that I need to come up with the advertisement logic, e3x to BLE binding and chunking.

The idea is only one device in the group has internet connectivity (and NAT capabilities) and I need to find the optimal path to that device to route my message to the internet. The prototype is to add 4 devices to the telehash mesh and then have messages from one to be transported to the node that has connectivity (optimal routing).

If you're planning to use telehash-c then I'll close this issue here in telehash-js and you can open new issues on the c repo anytime with specific questions :)

With wifi-direct then traditional UDP and broadcasts for discovery should work great, the c implementation doesn't do much of the UDP discovery yet but it's not complicated to add support for. There's no BLE transports in c yet either as they are often hardware driver-specific, but it also shouldn't be too bad and would look a lot like the UDP transport. There is a BLE pairing draft at https://github.com/getfilament/telehash-ble

The routing you want to do should work well as long as there's some inherent trust between the local nodes, whomever has the internet gateway simply announces it to the local peers in their mesh.

thanks. I will open issues on the C repo when I have more questions.