Closed amitn322 closed 4 years ago
The current firmware doesn't support the dimmer switch. Should be easy to add it but I don't own one to develop the code...
Any hints/pointers/instructions ? May be i could try to add that feature ? I have some programming background.
Are you able to build the FW? (Keil µVision with toolchain MDK-ARM)
I could provide you sample code to control that dimmer.
Yes I could build the FW I believe.
Thank You
I will add basic support in the code, then you can compile, test and fix whatever needed.
Sounds good, thanks a bunch !
Hi there, were you able to add the support for dimmer ?
Yes... I've added it 8 days ago. Check the commit history: https://github.com/ljalves/hfeasy/commits/master
Not sure if it is working as is (no way to test), but the basics are there.
BTW, if you aren't able to build the firmware maybe I can do it and then you do the testing. The current code should make the dimmer switches (up/down) work. If it does work, then all that is left is to add the mqtt control code.
Yeah Sorry, I saw it after I replied.. I was trying to download all the tools to build the firmware but if you already have the environment and can build it , that would be awesome. Also I am using hubitat so i am not sure mqtt is needed but other people might benefit. Another question.. is there a way to backup existing firmware from the device ?
Flash this fw using the webpage:
I did upload the firmware and the device rebooted ,but I still get the old interface and old firmware :(
That doesn't make sense. Please remember that the main webpage is "hardcoded" (it will not change). Can you try browsing to: http://module_ip/status and report what you see?
This is what i see :
System
Reset flags: 00000002, reason: softreset
Free memory: 25308 bytes
Uptime: 0 days 2h26m10s
GPIO status
Switch: High
Relay: Open(Off), last changed by: HTTP, publish: 0, action: 0
Timer status
Countdown (turn OFF): disabled
Countdown (turn ON): disabled
Connectivity
Hostname:
MQTT server: Disconnected```
Oh you know what, looks like it actually flashed :( my bad, the interface looked the same and i was expecting it to look a little different.. also my REC app is showing it offline now.
But I do not see any buttons like you mentioned :(
Yes, the main webpage is fixed, that's what makes these modules almost "unbrickable" (easy to flash back another fw and wifi settings are kept).
But I do not see any buttons like you mentioned :(
I mean the physical buttons (in the wall). Do they work?
Nope, they don't seem to work.. i can't even turn on/off the switch anymore..
Ok, bad news - try flashing the original FW and see if all works good again. I will check the code and try to find bugs.
Does not seem to work with the original firmware that you provided either.
Hmm... that might explain why it didn't work... Does the switch show in the App? If yes, there's a option to upgrade the FW in the app. Try that.
It shows offline in the app. I do have another switch as well, but i am not sure if there is a way to extract firmware from there.
Yes there is, but you have to open it up and connect the module serial port to a usb-serial adapter... If you are able do that, can you post some pictures of the insides? By the way, is the switch exactly as the one you posted on the first message?
Yes that is the exact switch, I don't think i would be able to extract the firmware with usb-serial adapter unfortunately :(
I find it weird that the app doesn't show the switch. Did you try a "factory reset"? Also, are you able to open up the switch and take some photos of the board?
Okay, I will try to pull it out and take some pictures tomorrow.
Thank You
Btw, dont do a factory reset - we might loose acess to webpage due to wifi getting unconfigured! I have some ideas to make it work. Let me do some tests on my side first. Meanwhile if you can get pictures of the insides it may help.
Actually I did do factory reset, but i am still able to access webpage over 10.x address..I will get pictures tomorrow.
1 question: did you try the physical buttons to turn on/off the lights after flashing the original firmware that I provided? If not, please test and let me know if that works.
Yes I did try that and it does not work.
I'm uploaded another version. When you have the chance try flashing this one:
I uploaded this version and now i don't have the "DEFAULT Open WIFI" .. The physical buttons or app does not work.
Nevermind, the default wifi came back after some time.. the physical buttons still don't work.. no LEDs blinking on the switch.
This means that they have 2 different dimmer modules... I'll try to find out more info on that... Meanwhile, whenever you can, disassemble your module and take some detailed board pictures - it should help.
Whats the name of the app you use with those dimmers?
REC Smart by Ankuoo on google play store.
Btw.. my working switch has v 1.08 while the firmware that you sent is 1.06
Also I now see the switch in the APP but it does not turn on.
If you can see it in the APP, try using the "update firmware" option in the app. Let me know if it worked.
Yeah that just times out on check :(
https://drive.google.com/drive/folders/1mPB06ZeS8gLTq-jwH-Yf6IBn9lred7eF?usp=sharing
there are the board pics for model AW51011D https://www.amazon.com/gp/product/B07C5YKRSG/ref=ppx_yo_dt_b_asin_title_o05_s02?ie=UTF8&psc=1
Nice. It's actually a LPT100F and not LPB100 as I thought!
Can you read the IC reference near the LPT100F? Can't see it from the pics. It looks like a port expander...
Edit: In one of the pictures I can barely read "PIC16F1503"
Ok, looking at the pics:
I2C is used to communicate with that IC above the module (which I assume it is a 8bit PIC) which does all the work.
So, the "only" thing missing to build a proper firmware for this module is to know which commands to send by I2C.
There are a couple of ways to do this: 1) With a working module capture I2C traffic for each button press. 2) With a working module dump firmware, disassemble and look for the i2c code. 3) With the broken module (or a working one) read PIC flash mem and disassemble code (it may not work as PICs allow to protect firmware from being read back).
Can anyone do any of the above? Easiest is 1) and I could easily do it if I had a working module.
Caution: NEVER program or "play" with the module while connected to the AC line! These module are powered from the AC line without any kind of isolation.
For example, to capture the I2C traffic, the board should be powered exclusively with a 3.3V supply, disconnected from the AC line.
Another way is to find the module firmware online. I know that the app allows to upgrade the firmware so it has to grab it somewhere! I don't have experience decompiling android app's... anyone?
@amitn322 (or someone else that's willing to get this working), please flash this firmware: https://drive.google.com/open?id=10fHrj-Irh_oNLUc-L0sOlkZ-JYjNGl1c
Then go to: http://_module_ip_/state
And copy/paste the result. Should be something like:
I2C SCAN RESULT found=0, addr0=0, addr1=0, addr0=0
It does an I2C scan and it should report back the address to control the PIC (if well implemented!).
If this works, it should be half way to get it done!
Edit: link updated
I2C SCAN RESULT found=113, addr0=15, addr1=16, addr0=17
do you have a discord this would be a good case for a channel to discuss things
What the f...?? Well... not really a surprise having a crappy i2c slave implemented by them...
Makes things harder but doable I think. I will make a web gui for you to try and send some values to those addresses to see if we can get the lights to turn on.
do you have a discord this would be a good case for a channel to discuss things
Not really... I'll see what I can do.
I2C SCAN RESULT found=113, addr0=15, addr1=16, addr0=17
When you hit refresh do you always get the same values? I hope so...
Hi there,
Does this firmware support wall switch dimmer ?
https://www.amazon.com/gp/product/B07C5YKRSG/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
I know that the model number is HF-LPB100 . I have access to the web UI .
Thank you !