-
• #2
What you're doing looks ok... Can you try just sending the data explicitly with:
function makearr(){ return [0x56, 0xff, 0x08, 0x5a, 0x00, 0xf0, oxaa]; }
It'd remove one potential source of problems. I notice that what you're sending isn't related to what's in the comment at all - is that intentional?
-
• #5
Great! Looks like there's an issue with Espruino's conversion of strings into integers. For instance
+"0x10"
in the browser works fine but returns NaN in Espruino.For now I'd use
parseInt("ff",16)
, but I'll file a bug for it
Hello!
I am trying without success since couple hours to make work a simple system: button press turns on a light bulb.
Regarding the reverse engineering of the bulb https://medium.com/@urish/reverse-engineering-a-bluetooth-lightbulb-56580fcb7546
I managed to control the bulb from a Cordova app, so the javascript should already be ready. I manage to connect to the device, to get the service and characteristic I need...but cannot make it to writeValue correctly (the bulb is not reacting). No error is thrown.
I suppose the problem hides in the value passed - in Cordova through I library should be an ArrayBuffer - but here?
My code
Any suggestion will be very appreciated!