Questions about gateway functions and dev

Hi guys!
First post here, I have a few questions that I hope it’s ok to ask.
I am currently working on a College project in which I have to build a gateway that is compatible with different kinds of sensors (many of them “dumb” sensors, like temperature bluetooth data loggers etc). While looking for different options I stumbled upon Mozilla WebThings. Having read “Building the Web of Things” I instantly thought that this might be just what i was looking for, looks like a great project that I hope it will be successful. But right now I feel that i am not finding the documentation that I need, so I’ll ask some questions here.

  1. Is there any developer guide? Or any kind of introduction to develop our own solutions (gateway side, like new adapters etc)

  2. What would be the best way to connect Bluetooth sensors? Is there a good adapter already? I noticed that before there was an option to scan for Bluetooth devices, what happened to it? Is there any adapter that would be a good starting point?

  3. If I can manage to create what I want, is it possible to port the solution for a device other than a RP ? Has anyone tried to do it before? How hardware agnostic is Mozilla WebThings gateway?

  4. Is there any out of the box solution to connect the gateway to the cloud? Or to a private server? Like if I am logging temperatures and need to upload them to somewhere what is the current way to do it?

I hope my questions are reasonable and not too confuse. Many thanks in advance!

Edit:

  1. Found https://hacks.mozilla.org/2018/02/creating-an-add-on-for-the-project-things-gateway/ ! Why not add this and other relevant links to https://iot.mozilla.org/docs/ ?

Welcome to the project! I’ve responded to your different questions below.

It’s a work in progress. If there are certain things you’re looking for, I can point out some good resources.

Since Bluetooth devices all tend to use different protocols, they all typically require separate adapters. I’d recommend looking through the various adapters here, as he has created several simple Bluetooth adapters.

Yes, of course! The gateway has been tested on Linux, macOS, and (less frequently) Windows. We have resources set up to allow you to cross-compile add-ons for different architectures and such.

Not out of the box, but again, you can build an add-on for that. Here is an example.

1 Like

Thank you so much @mstegeman ! It’s a great help for starting. I’ll take a look at the resources you shared.

Got another question. I am trying to write a new adapter for a BT sensor that I have. If the provided library is in a .jar format what is the best approach? Is there any adapter API in Java? Or I am thinking this wrong and missing something?

Currently, all of the add-ons are either written in Python or Javascript (Node.js). However, there’s nothing preventing you from doing it in Java. You’d have to write the full IPC layer, though. Essentially, you’d want to translate either this library or this library into Java.

What sensor is it? It might be easier to just reimplement the API in Python or JS.

1 Like

Thanks for the help @mstegeman. And sorry for the late reply!
That’s what I was thinking. I went with the second option. Right now I am working with some Chinese sensors, BT05 from tzonedigital (I have the bt protocol guide, the android apk and java sdk, but I am making a JS api from that now). I also had another device that I wish to implement but I don’t have access to any protocol documentation and it’s being difficult to reverse engineer the protocol, so I think I’ll try to make my own version of the device (it’s a food thermometer).
If you have any other tip for me I am more than grateful!

Sounds like a good plan. Once you get it working, you should open a PR on the addon-list repo so other people can use it, too!

1 Like