Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Tinyb #1

Merged
merged 4 commits into from
Sep 30, 2017
Merged

Add Tinyb #1

merged 4 commits into from
Sep 30, 2017

Conversation

twgraham
Copy link
Contributor

This PR adds TinyB (https://github.com/intel-iot-devkit/tinyb) to the server as a dependency. It will allow the server to interact further with IoT sensors for monitoring e.g. TI Sensor Tag

@twgraham twgraham self-assigned this Sep 29, 2017
@twgraham twgraham requested a review from kutluo September 29, 2017 04:19
@twgraham
Copy link
Contributor Author

I just realised we're missing the native api libraries here. I'll see if I can add them to the project too before we merge this.

@twgraham
Copy link
Contributor Author

So I added the native libraries, and did some manual testing to make sure tinyb could run. It seems like the library is loading fine now, but I was having trouble getting full results (scanning for bluetooth devices) because Docker for Mac can't expose tty devices (usb/bluetooth etc) to containers. This is due to a lack of functionality in underlying xyhve (hypervisor) layer.

As a workaround we can run in linux VM's. I'm not sure whether Docker for Windows will have the same issues. I think the old docker toolbox would be fine because it uses linux VM's.

@kutluo
Copy link
Contributor

kutluo commented Sep 30, 2017

I will check this today on docker for windows to see if it has the same problem.

@twgraham
Copy link
Contributor Author

Can verify that it works on Linux VM. I wrote a quick trial:

BluetoothManager manager = BluetoothManager.getBluetoothManager();
boolean started = manager.startDiscovery();

log.info("Bluetooth started: " + started);

manager.find(BluetoothType.NONE, null, null, null);

log.info("Devices discovered:");

for (BluetoothDevice device : manager.getDevices()) {
    log.info(device.getName() + " - " + device.getAddress());
}

manager.stopDiscovery();

And when I ran it, I got this result 😃

image

I'm not concerned about the exception thrown when attempting to stop discovery - I didn't protect against this.

@kutluo
Copy link
Contributor

kutluo commented Sep 30, 2017

I couldn't get this working either, I was stuck at an earlier step couldn't even get the bluetooth manager, however passing the review because it works in linux.
Exception in thread "main" java.lang.RuntimeException: Error getting object manager client: Error calling StartServiceBy Name for org.bluez: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return c ode 1

Copy link
Contributor

@kutluo kutluo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approveddd

@twgraham
Copy link
Contributor Author

Yeah this is similar to the error i saw on docker for mac. Atleast its consistent

@twgraham twgraham merged commit d1e3ee2 into develop Sep 30, 2017
@twgraham twgraham deleted the add-tinyb branch September 30, 2017 06:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants