mbientlab / warble Goto Github PK
View Code? Open in Web Editor NEWMetaWear Python SDK - Linux / Windows - C wrapper around BluetoothLE
Home Page: https://mbientlab.com
License: Other
MetaWear Python SDK - Linux / Windows - C wrapper around BluetoothLE
Home Page: https://mbientlab.com
License: Other
Cloned 1.1.5, on windows 10, Visual Studio 2017, SDK 10.0.17763.0, output is like this for all devices found in the example-scanner.
mac: 51:70:61:5A:61:B2
name:
rssi: -66 dBm
metawear service? 0
mbientlab manufacturer data? false
I added the connect example to my code to try and test out the Warble library, when I ran it I ran into this error:
unresolved external symbol _warble_gatt_create referenced in function _main unresolved external symbol _warble_gatt_connect_async referenced in function _main unresolved external symbol _warble_gatt_disconnect referenced in function _main unresolved external symbol _warble_gatt_on_disconnect referenced in function _main unresolved external symbol _warble_gatt_is_connected referenced in function "public: void __thiscall <lambda_482e9b2f9ff0ab3140f2e29f203c3bd0>::operator()(void *,struct WarbleGatt *,char const *)const " (??R<lambda_482e9b2f9ff0ab3140f2e29f203c3bd0>@@QBEXPAXPAUWarbleGatt@@PBD@Z)
Here is main.cpp:
`
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
#include
#include
#include
#include
#include
#include
#include
#include
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <SOIL2/SOIL2.h>
#include <json-c/json.h>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtx/quaternion.hpp>
#include <glm/gtx/string_cast.hpp>
#include "Model.h"
#include "camera.h"
#include "Shader.h"
#include "stdafx.h"
#include "Warble/warble.h"
#include "Warble/scanner.h"
#pragma comment(lib, "opengl32.lib")
#define _CRT_SECURE_NO_WARNINGS
#pragma warning (disable : 4996)
// Properties
const GLuint WIDTH = 1000, HEIGHT = 1000;
int SCREEN_WIDTH, SCREEN_HEIGHT;
// Function prototypes
void KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mode);
void MouseCallback(GLFWwindow* window, double xPos, double yPos);
void DoMovement();
// Camera
Camera camera(glm::vec3(0.0f, 0.0f, 15.3f));
bool keys[1024];
GLfloat lastX = 400, lastY = 300;
bool firstMouse = true;
GLfloat deltaTime = 0.0f;
GLfloat lastFrame = 0.0f;
bool allowCamera = true;
bool animationStart = false;
int counter = 0;
int main()
{
string deviceAddress;
cout << "What is the MAC Address of the Device?\n";
getline(cin, deviceAddress);
auto gatt = warble_gatt_create(deviceAddress.c_str());
for (int i = 0; i < 3; i++) {
promise connect_task;
cout << "Connecting to " << deviceAddress << endl;
warble_gatt_connect_async(gatt, &connect_task, [](void* context, WarbleGatt* caller, const char* value) {
auto task = (promise*) context;
if (value != nullptr) {
cout << "Connection failed" << endl;
task->set_exception(make_exception_ptr(runtime_error(value)));
}
else {
cout << "Am I connected? " << warble_gatt_is_connected(caller) << endl;
this_thread::sleep_for(5s);
task->set_value();
}
});
connect_task.get_future().get();
promise<int32_t> dc_task;
cout << "Disconnecting..." << endl;
warble_gatt_on_disconnect(gatt, &dc_task, [](void* context, WarbleGatt* caller, int32_t status) {
((promise<int32_t>*) context)->set_value(status);
});
warble_gatt_disconnect(gatt);
cout << "disconnected, status = " << dc_task.get_future().get() << endl;
cout << "Am I connected? " << warble_gatt_is_connected(gatt) << endl;
}
return 0;
}
`
I've been trying to get the demos to work. I know something works because the scan demo picks up my bluetooth LE Arduino. But it can't seem to find any device info and pauses after the first try. Am I doing anything wrong?
For more info, I'm using a cheap "Panda BT 4.0" USB dongle on the PC side (Windows 10) and using Visual Studio 2019. The Arduino is a Keywishbot Bluetooth Nano BLE module. I don't have any other BLE modules to test with except a second, identical Arduino. I've also tried a few Windows BLE scanner apps that seem to pick up the characteristics alright, so it should be working. Any tips would be appreciated, thanks.
I'm attempting to build Warble on Windows 10 but receive the following error:
warble\cpp\lib.cpp(6,10): fatal error C1083: Cannot open include file: 'lib_def.h': No such file or directory
I downloaded the repo via git clone as mentioned in the build section but there's not a whole lot of details on using it with Windows 10. Is there something I am missing?
Hi, When i try to build the environment for Python SDK by building Warble I get this error in Command Prompt (as admin):
https://github.com/mbientlab/Warble
Microsoft Windows [Version 10.0.17134.228]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>MSBuild.exe warble.sln
Microsoft (R) Build Engine version 15.8.168+ga8fba1ebd7 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1009: Project file does not exist.
Switch: warble.sln
C:\WINDOWS\system32>
I get similar errors when I try to build the solution in Visual Studio 2017:
1>------ Rebuild All started: Project: warble, Configuration: Debug x64 ------
1>Object reference not set to an instance of an object.
2>------ Rebuild All started: Project: example-scanner, Configuration: Debug x64 ------
2>Object reference not set to an instance of an object.
2>Error: Object reference not set to an instance of an object.
3>------ Rebuild All started: Project: example-connect, Configuration: Debug x64 ------
3>Object reference not set to an instance of an object.
3>Error: Object reference not set to an instance of an object.
4>------ Rebuild All started: Project: example-read-dev-info, Configuration: Debug x64 ------
4>Object reference not set to an instance of an object.
4>Error: Object reference not set to an instance of an object.
========== Rebuild All: 0 succeeded, 4 failed, 0 skipped ==========
I have installed Python 3.7, FCU Windows 10 SDK (10.0.16299.0) and pip also.
What am I doing wrong? Thank you.
Greetings!
We are trying to compile Your project via pip so as to use the Metawear-SDK-Python on a Raspberry Pi 3 B+.
By following the instructions in the downstream repository (ie: the Python SDK), we have encountered a problem in building the Warble package.
By use of pip
to compile, we found that it tries to download the package posted on PythonHosted that actually has the already compiled .o files inside.
These files were compiled for X86-64 (information obtained by `file clibs/warble/deps/libblepp/src/att.o'), and therefore are not compatible with the ARM architecture of the Raspberry.
Given that these files are a dependency of the package, and that pip seems not to be configurable to first call make clean
so as to ensure that the sources are recompiled, we ask for informations on how to install Your library for use in other packages.
We attach a file with the compilation result, so as to give a proper context for the problem we found.
Thanks!
On ARM, -m32 should not be required. Building metawear
on ARM fails as well, due to this error.
So far this is the only c/c++ cross-platform BLE library I've found; I'm sure there are others somewhere.
I was wondering if it would be reasonable to advertise how supported different platforms are? linux/windows/macosx[/mobile]?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.