So one of my recent new toys professional purchases was a lightsaber photography light wand. More specifically, the Yongnuo YN360 (newer version YN360-II here )
This is a icelight clone, that in my opinion is significantly more flexible, offering white light with variable temperature control, as well as providing arbitary RGB lighting as well. Frankly, the light was a great help at adding some fill light for my photography – but this is not meant to be a product review.
The very nerdy cool part of this device is that it offers a bluetooth app to enable remote control of the light from a smartphone. While cool, I tried this feature, and while it requires no pairing (thanks bluetooth 4.0), it is quite awkward to use, and is significantly more difficult to use than the physical controls on the light itself.
But this had me wondering – I had never played with bluetooth 4.0 till now, but my understanding was that it is a very very simple form of communication. So I grabbed out LightBlue on my iphone, and found I could read some data! Whoo hoo! However, I couldnt figure out what I needed to send to the light to control it. My first attempt was opening the .ipa file, hoping to find some secret strings or magic numbers, but I had no luck with this avenue. Googling “iphone app disassembly” was a fairly fruitless venture also. But – there was an android app as well! Searching for “apk disassembly” yielded several useful results, and within minutes, I was able to use an online tool to decompile the app and start perusing the source code!
Now, I only know C++, not java, but from what I could see, the difference seemed to be no greater than the difference between Spanish and Portuguese – you’re not going to be having a conversation, but you quickly get the gist of what the other person is trying to say. Unfortunately, due to either a lack of patience or a lack of skill, I didn’t find the information I wanted readily, and I interrupted the search as I had another idea.
Perhaps there was some way of sniffing the comunication between my iPhone and the light? I have a mac with Bluetooth Low Energy (BTLE) and another Android with the same. Surely one of these would be able to do some man-in-the-middle capturing of data? In fact it was even easier than that.
Android 4.4+ provides the ability to log BTLE data built into the system, and I simply installed the APK on my Huawei Y550, and turned the logger on before operating the app. Extracting the log files, and opening them up in wireshark soon showed me exactly what I was looking for.
YN360 BTLE Commands:
- 0xAEAA01XXYY56 — XX is hexadecimal code for cold white LED’s YY is hexadecimal code for warm white LED’s
- 0xAEA1RRGGBB56 — RR red hexadecimal, GG green hexadecimal, BB blue hexadecimal
- 0xAEEE00000056 — Off/Standby mode
- 0xAE3300000056 — Unknown
You can open up lightblue on mac or iphone, connect to the “Yongnuo LED” device, and then send command 0xAEAA01FFFF56 and turn on the LED’s easily, from the comfort of a keyboard.
Enrique Bencomo
Yongnuo app sucks, have you heard of any other third party app that works with it?
admin
Sorry, I haven’t. That’s what inspired me to muck around with it.
Janis
Hello!
Thank you for tutorial!
I am trying to control Yongnuo YN600 II from Lightblue on iPhone but it seems to have different bluetooth commands for turning on/off. Is there an app that logs bluetooth on iphone so I can check the commands that Yongnuo app would send to the LED device? How can I enter 0xAEAA01FFFF56 on Bluelight, there is no x letter?
Looking to hear from you,
Janis
admin
Hi Janis,
I was using the LightBlueLE app, but unfortunately ran into the problem since it does not log. That is why I had to resort to using the Android phone approach. “0x” is a way of writing “the following numbers are hex values”. You can leave off the 0x prefix when writing hex values into LightBlue.
I’d be quite happy to help modify my web app (which works on iPhone via Bluefy!) to support that device, but I don’t have YN600II myself.
Cheers,
Sam
Chris Champeau
How hard would it be to implement some way of connecting the YN360 via bluetooth to Homebridge?
I have played around with it, but cannot seem to get it to work correctly
admin
Without knowing your skills, it’s hard to know how hard it will be for you. You can control Bluetooth LE from python. Get that part working first, and then it should be easy-ish to get into homebridge.
Chris Champeau
I created a simple python script actually to control it at one point, I am just not really sure how to bridge what I know in terms of controlling it via python to homebridge. I guess I assumed I had to control it with node.js
admin
Great — I would suggest to join the homebridge discord and ask for advice on there. I’m happy to help answer any questions on the Bluetooth comm side.