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

Xiaomi Desk Lamp - Encoder Read Correctly, But Doesn't turn on #1621

Closed
mikestocking opened this issue Mar 9, 2019 · 2 comments
Closed

Xiaomi Desk Lamp - Encoder Read Correctly, But Doesn't turn on #1621

mikestocking opened this issue Mar 9, 2019 · 2 comments
Milestone

Comments

@mikestocking
Copy link

mikestocking commented Mar 9, 2019

Thanks for the great firmware, look forward to your thoughts on the issue below.

Bug description
Light doesn't turn on regardless of encoder inputs or switch/brightness/color settings in web interface.

Steps to reproduce
Load firmware on Xiaomi Smart Desk Lamp, attempt to turn on.

Expected behavior
Light on/off status reflects switch position in web interface

Screenshots
This shows web interface responding as expected to all encoder actions, but light does not turn on.
image

Device information

[753816] [MAIN] ESPURNA 1.13.5 (83195fd)
[753817] [MAIN] xose.perez@gmail.com
[753818] [MAIN] http://tinkerman.cat

[753819] [MAIN] CPU chip ID: 0xA30B3B60
[753821] [MAIN] CPU frequency: 80 MHz
[753825] [MAIN] SDK version: 1.5.3(aec24ac9)
[753829] [MAIN] Core version: 2.3.0
[753832] [MAIN] Core revision: 159542381
[753835] 
[753836] [MAIN] Flash chip ID: 0x1540C8
[753841] [MAIN] Flash speed: 40000000 Hz
[753843] [MAIN] Flash mode: DOUT
[753846] 
[753848] [MAIN] Flash size (CHIP)   :  2097152 bytes /  512 sectors (   0 to  511)
[753860] [MAIN] Flash size (SDK)    :  2097152 bytes /  512 sectors (   0 to  511)
[753862] [MAIN] Reserved            :     4096 bytes /    1 sectors (   0 to    0)
[753871] [MAIN] Firmware size       :   501840 bytes /  123 sectors (   1 to  123)
[753879] [MAIN] Max OTA size        :   520192 bytes /  127 sectors ( 124 to  250)
[753887] [MAIN] EEPROM size         :     4096 bytes /    1 sectors ( 251 to  251)
[753893] [MAIN] Reserved            :    16384 bytes /    4 sectors ( 252 to  255)
[753900] 
[753902] [MAIN] EEPROM sectors: 507, 506
[753905] [MAIN] EEPROM current: 506
[753907] 
[753909] [MAIN] EEPROM:  4096 bytes initially |  1315 bytes used (32%) |  2781 bytes free (67%)
[753917] [MAIN] Heap  : 34624 bytes initially | 20672 bytes used (59%) | 13952 bytes free (40%)
[753925] [MAIN] Stack :  4096 bytes initially |  1616 bytes used (39%) |  2480 bytes free (60%)
[753934] 
[753935] [MAIN] Boot version: 6
[753939] [MAIN] Boot mode: 1
[753940] [MAIN] Last reset reason: Reboot from web interface
[753944] 
[753946] [MAIN] Board: XIAOMI_SMART_DESK_LAMP
[753949] [MAIN] Support: ALEXA API BROKER BUTTON DEBUG_SERIAL DEBUG_TELNET DEBUG_WEB DOMOTICZ ENCODER HOMEASSISTANT LED MDNS_SERVER MQTT NTP SCHEDULER TELNET TERMINAL THINGSPEAK WEB 
[753968] [MAIN] WebUI image: LIGHT
[753970] 
[753973] [MAIN] Firmware MD5: da809ee89d9806a243bcf18ad2c37728
[753976] [MAIN] Power: 4094 mV
[753979] [MAIN] Power saving delay value: 1 ms
[753983] 

Tools used

  • Mac
  • Safari
  • Using precompiled release from here.

Context
This is the log describing the gif above.

[895553] [BUTTON] Button #0 event 1
[896054] [BUTTON] Button #0 event 2
[896057] [RELAY] #0 scheduled ON in 0 ms
[896060] [RELAY] #0 set to ON
[897062] [RELAY] Setting relay mask: 1
[897591] [BUTTON] Button #0 event 1
[898092] [BUTTON] Button #0 event 2
[898095] [RELAY] #0 scheduled OFF in 0 ms
[898098] [RELAY] #0 set to OFF
[899101] [RELAY] Setting relay mask: 0
[899162] [BUTTON] Button #0 event 1
[899663] [BUTTON] Button #0 event 2
[899667] [RELAY] #0 scheduled ON in 0 ms
[899670] [RELAY] #0 set to ON
[900672] [RELAY] Setting relay mask: 1
[903136] [ENCODER] Delta: -1
...more encoder deltas...
[904265] [ENCODER] Delta: -1
...more encoder deltas...
[906900] [ENCODER] Delta: 1
[908775] [BUTTON] Button #0 event 1
[909159] [ENCODER] Delta: -1
...more encoder deltas...
[910665] [ENCODER] Delta: -1
[911238] [ENCODER] Delta: 1
...more encoder deltas...
[912401] [ENCODER] Delta: 1
[912725] [BUTTON] Button #0 event 4
[913894] [BUTTON] Button #0 event 1
[914394] [BUTTON] Button #0 event 2
[914397] [RELAY] #0 scheduled OFF in 0 ms
[914400] [RELAY] #0 set to OFF
[915402] [RELAY] Setting relay mask: 0
@Ctrl-F4
Copy link
Contributor

Ctrl-F4 commented Mar 9, 2019

Same experienced here.

I added
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
to code/espurna/config/hardware.h
Then it works.
I'm new to github so don't know how to make a pr yet.

edit:
uploaded bin file:
xiaomi-smart-desk-lamp.zip

@mikestocking
Copy link
Author

Thanks for the tip, @Ctrl-F4 !!!
I'm new to PlatformIO and having difficulties with dependencies in the build. Any chance you could upload that binary for me somewhere while I get my mind wrapped around PIO? If not, no worries, appreciate the tip!

Ctrl-F4 added a commit to Ctrl-F4/espurna that referenced this issue Mar 10, 2019
fix for Xiaomi Desk Lamp (xoseperez#1621)
Ctrl-F4 added a commit to Ctrl-F4/espurna that referenced this issue Mar 10, 2019
fix for Xiaomi Desk Lamp (xoseperez#1621)
@mcspr mcspr closed this as completed in b0d47b4 Mar 13, 2019
@mcspr mcspr added this to the 1.13.6 milestone Mar 13, 2019
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