Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other version of Chsmartbulb ? #1

Open
hajs opened this issue Jun 25, 2018 · 5 comments
Open

Other version of Chsmartbulb ? #1

hajs opened this issue Jun 25, 2018 · 5 comments

Comments

@hajs
Copy link

hajs commented Jun 25, 2018

Hello,
I just bought a light bulb which should be a Chsmartbulb.
Unfortunately it does not respont to any commands.

The test-script fails at #508

python test-script/light.py 
no device specified.  Searching all nearby bluetooth devices for
the SampleServer service
connecting to "Serial Port Service - Channel 2" on F4:4E:FD:D1:5D:74
01fe000041021000470c000000000000
Traceback (most recent call last):
  File "test-script/light.py", line 46, in <module>
    assert r == h("01fe0000410210000100000000000000")
AssertionError

If I comment out the assert command I get

>python test-script/light.py 
no device specified.  Searching all nearby bluetooth devices for
the SampleServer service
connecting to "Serial Port Service - Channel 2" on F4:4E:FD:D1:5D:74
01fe000041021000470c000000000000
open
01fe000041811600355d000034304c42010100001300

Unfortunately I cannot see any changes on the light bulb.

Could you please give me a hint, how I can adapt the protocol?

Thanks :)

@eazel7
Copy link

eazel7 commented Aug 21, 2018

Same here, I'll try to get the btsnoop_hci.log from my phone. Maybe the protocol just changed a little.

@eazel7
Copy link

eazel7 commented Aug 21, 2018

btsnoop_hci.log
I just uploaded a capture of the Bluetooth log from my phone using the app. I'll try to understand what commands are different, but in any case it is here for you to use it also.

use bluetooth.dst == 00:e0:4c:c2:59:69 || bluetooth.src == 00:e0:4c:c2:59:69 as filter in wireshark

@eazel7
Copy link

eazel7 commented Aug 21, 2018

image
packet 734 is the same 01234567 hello message apparently

@samsam2310
Copy link
Owner

samsam2310 commented Dec 30, 2018

Hi
Sorry i didn't notice the issue.
When i make this repo, i just send the command with iLightPro App (https://play.google.com/store/apps/details?id=com.chipsguide.app.colorbluetoothlamp.v3.gp&hl=en_US)
, and then try to send the same data.

I comment out most of the code in light.py, so i think that is expected if you run directly and nothing happened.

But if you try the commands in the light.py and it still not work, maybe you can try to send all the commands which the app send.
After that, try to find out which one really affect the bulb.

It have been a long time since I make this repo so I forget some detail, but if you use the same app as i use then maybe I omit some commands that your bulb needed.

Something may help is, all the command is 01fe000051811800000000000......, but i suspect this prefix may be the bulb ID or something likely.
Try to do the same thing multiple times (turn on the bulb, off,on,off....), and find out the command that appear with the same frequency, that should be the right command.

@eazel7
Copy link

eazel7 commented Apr 13, 2019

Hi @samsam2310, @hajs I managed to get the lights I bought for my home working. This is the code I'm running in my raspberry pi: https://github.com/eazel7/living-room-lights-rpi
Apparently, you don't need to send the heartbeat, you can just send the set-color command again =) so that simplifies things a little bit.
Well, see the code, it's made for 2 lamps in my living room, with different modes. You can scavenge for the really useful stuff in there. This is working perfectly 24/7. The button1/button2/button3 is because I made a remote control for the lights with an M5 stack.
/button1: cycle intensity in intervals of 10% (starting with 10%)
/button2: start/stop color rotation
/button3: switch modes:

  • same color
  • opposite colors
  • 33% difference in color wheel
  • 50% difference in color wheel
  • 20% difference in color wheel
  • white
  • violet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants