Open Supermrk opened 1 year ago
This may be the issue:
I face similar issue when using muse-js with webbluetooth 3.2.1. I bumped the version from 3.0.1 as I thought that might resolve the issue. Unfortunately it did not. The muse-js
works with my device when used with Browser's Web Bluetooth - e.g. with https://github.com/kylemath/EEGEdu project.
This is what I get when I call await muse_client.start();
that uses webbluetooth
lib:
/home/user/development/muse-collector/node_modules/.pnpm/webbluetooth@3.2.1/node_modules/webbluetooth/dist/adapters/simpleble-adapter.js:468
throw new Error('Write failed');
^
Error: Write failed
at SimplebleAdapter.<anonymous> (/home/user/development/muse-collector/node_modules/.pnpm/webbluetooth@3.2.1/node_modules/webbluetooth/dist/adapters/simpleble-adapter
.js:468:27)
at step (/home/user/development/muse-collector/node_modules/.pnpm/webbluetooth@3.2.1/node_modules/webbluetooth/dist/adapters/simpleble-adapter.js:72:23)
at Object.next (/home/user/development/muse-collector/node_modules/.pnpm/webbluetooth@3.2.1/node_modules/webbluetooth/dist/adapters/simpleble-adapter.js:53:53)
at /home/user/development/muse-collector/node_modules/.pnpm/webbluetooth@3.2.1/node_modules/webbluetooth/dist/adapters/simpleble-adapter.js:47:71
at new Promise (<anonymous>)
at __awaiter (/home/user/development/muse-collector/node_modules/.pnpm/webbluetooth@3.2.1/node_modules/webbluetooth/dist/adapters/simpleble-adapter.js:43:12)
at SimplebleAdapter.writeCharacteristic (/home/user/development/muse-collector/node_modules/.pnpm/webbluetooth@3.2.1/node_modules/webbluetooth/dist/adapters/simpleble
-adapter.js:455:16)
at BluetoothRemoteGATTCharacteristicImpl.<anonymous> (/home/user/development/muse-collector/node_modules/.pnpm/webbluetooth@3.2.1/node_modules/webbluetooth/dist/chara
cteristic.js:250:65)
at step (/home/user/development/muse-collector/node_modules/.pnpm/webbluetooth@3.2.1/node_modules/webbluetooth/dist/characteristic.js:72:23)
at Object.next (/home/user/development/muse-collector/node_modules/.pnpm/webbluetooth@3.2.1/node_modules/webbluetooth/dist/characteristic.js:53:53)
Node.js v20.11.1
Whenever I try to write to a valid characteristic, the error "Write failed" always occurs. I'm trying to implement some code I found in the https://github.com/ib0b/RGB-PC repo into a NodeJS webserver project. The RGB-PC project worked perfectly fine on my machine, but implementing the same code with the webbluetooth library causes this error to happen.