While waiting for my espruino boards I dug out my old miraprism AR headset in attempt to hack the controller. Controller has touchpad, buttons, gyro and accelerometer. I always wanted to do that and now figured maybe there is a chip inside supporting espruino. I opened it and there was nRF51822 inside with nice SW programming connector on the PCB. After looking through the forums 51 series doesnt support the espruino fully. Maybe you can have more comments on that how hard would it be to flash it.
I thought I will try to hack it anyway by sniffing the services and characteristics so I can write web bluetooth app to use it. I found some people were able to hack the google daydream which is similar controller.
I based my web bluetooth app on the second link. Miraprism doesnt have much info but I found out that the guangdong company that was making the controller for them made their own which is identical and its called ximflip. I think they made similar headsets/controllers under different names or for different companies. There is a lot of documentation available including BOM.
Note that comparing to the daydream they dont have the magnetometer so they have to calibrate their controller position.
I spent two evenings and I think got quite far but dont want to get stuck in the rabbit hole especially that I would prefer to get the espruino working there. In original daydream they where sending all axes mag/acc/gyro in raw values. It was challenging to figure out the bits in the whole frame.
Its different with ximflip. They by default send 3 bytes 2's complement per axis rotation. I was wondering why the value goes from -1800000 to +1800000. Then I looked through their higher level SDK. Its only header files and main, the rest is compiled. You can see there that the accuracy of rotation is 4 digits.
So I realised if I divide the rotation by 10k I will get +-180.0000 deg. One of the axis behaves different. Thats the point when I got stuck. Also I bet to get the raw acc and gyro you need to send command through F002 characteristic but couldn't figure out that either.
Anyway, that was fun. Here is the repo where you can try out the code if you get controller.
Here I found a controller that should be a clone of it:
Cool feature of this controller is touchpad which works quite well.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem