[BL602/BL0937] Yet another Smart Socket 20A (but 16A)
I bought a Smart Plug from Aliexpress: https://fr.aliexpress.com/item/1005005790622741
They are named Aubess on the website, but not on the packaging or on the socket.
Easy to open with pliers.
Contains an SM-028_V1.3 with a BL602L02 chip.
And BL0937.
I soldered cables in the back of the SM-028_V1.3 between:
SM-028_V1.3 RX -> FTDI232L TX
SM-028_V1.3 TX -> FTDI232L RX
SM-028_V1.3 3V3 -> FTDI232L VCC (on 3V3)
SM-028_V1.3 GND -> FTDI232L GND
SM-028_V1.3 BT -> to a 10Kohm to VCC
And flashed it with Bouffalo Lab Dev Cube
Then I disconnected all wires, remounted the socket, and put it on the plug.
And TADA! I entered my SSID and password and rebooted it.
I checked the circuit wiring on the PCB between BL0937 and BL602:
BL0937 CF1 -> BL602 GPIO3
BL0937 CF -> BL602 GPIO14
BL0937 SEL -> BL602 GPIO21
LED -> BL602 GPIO20
Relay -> BL602 GPIO2
Button -> BL602 GPIO17
(don't bother yet to check the LED and button) => TODO
But once configured, nothing showed up in the Web app (all values are zero)
Current working template :
I saw some discussions about the BL0937 driver on BL602 not working because of HAL interrupt falling edge counter.
Is it already implemented?
They are named Aubess on the website, but not on the packaging or on the socket.


Easy to open with pliers.

Contains an SM-028_V1.3 with a BL602L02 chip.

And BL0937.

I soldered cables in the back of the SM-028_V1.3 between:
SM-028_V1.3 RX -> FTDI232L TX
SM-028_V1.3 TX -> FTDI232L RX
SM-028_V1.3 3V3 -> FTDI232L VCC (on 3V3)
SM-028_V1.3 GND -> FTDI232L GND
SM-028_V1.3 BT -> to a 10Kohm to VCC
And flashed it with Bouffalo Lab Dev Cube

Then I disconnected all wires, remounted the socket, and put it on the plug.
And TADA! I entered my SSID and password and rebooted it.

I checked the circuit wiring on the PCB between BL0937 and BL602:
BL0937 CF1 -> BL602 GPIO3
BL0937 CF -> BL602 GPIO14
BL0937 SEL -> BL602 GPIO21
LED -> BL602 GPIO20
Relay -> BL602 GPIO2
Button -> BL602 GPIO17
(don't bother yet to check the LED and button) => TODO
But once configured, nothing showed up in the Web app (all values are zero)

Current working template :
Code: JSON
I saw some discussions about the BL0937 driver on BL602 not working because of HAL interrupt falling edge counter.
Is it already implemented?
Comments
Sadly the interrupt counter for BL0937 is still missing. I think there is an unfinished version: https://github.com/openshwprojects/OpenBK7231T_App/pull/862 Btw, can you also post a template for this... [Read more]
I just updated the post with template and finals BL602 GPIO. [Read more]
Thanks for the info. I tried correcting it, but I am not competent enough in C to include those changes. [Read more]
Got what looks like very similar socket, only button is on other pin, managed to solder and flash ( only destroyed one). Trying to add bl0937 support [Read more]
I saw a PR, but is it working? I don't even have that kind of socket to check. Hmm [Read more]
No it's not, doesn't even compile, but I got builds working on my fork, so trying to make it work [Read more]
It seems you are getting errors like: /home/runner/work/OpenBK7231T_App/OpenBK7231T_App/sdk/OpenBL602/customer_app/bl602_sharedApp/bl602_sharedApp/shared/src/driver/drv_bl0937.c:155:9:... [Read more]
Yes added that to try, but nothing happens, values always zero. No sure what else to try, could it be that some pin mapping is required like in W600? [Read more]
Here is pins code for BL602: https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/hal/bl602/hal_pins_bl602.c From what I can see, there are no pin mappings there. So, are you sure that... [Read more]
bl_gpio_enable_input should already be called from the driver via HAL_PIN_Setup_Input_Pullup (GPIO_HLW_CF1); [Read more]
Wait a minute. I had a report that during last few updates OTA has broken. Is BL602 OTA working for you? It would mean that we need to reduce BL602 binary again. [Read more]
It is working, but seems not 100% reliably. Sometimes I got starting OTA... and nothing happened, but after few retries it worked. This is with builds from my branch. [Read more]
Can you print the values of variables increased in the interrupt? Are they really not changing? Have you set correct GPIO for the CF and CFI pins? Are variables set as volatile? [Read more]
Actually made some progress with latest try. Now getting some values at least :) https://obrazki.elektroda.pl/6884445200_1705771798_thumb.jpg So hopefully it's now just wrong pins somewhere. Will... [Read more]
I suspect it;'s caused by too large flash binary, but I am not sure. I will try to reduce the size by stripping features that are not useful on BL602: https://github.com/openshwprojects/OpenBK7231T_App/pull/1044 Can... [Read more]
Good news, got it working. Now there is two things to solve here, I think these long sdk includes should not be here, it should be moved to HAL layer I think. However, not sure how interrupt stuff for... [Read more]
That's very good news, nice job. We have source for register function, it seems to be using a linked list: static gpio_ctx_t *pstgpio_head = NULL; int hal_gpio_register_handler(void *func, int... [Read more]
Is the binary size really the issue here, seems little bit strange, because it should never work if there is not enough space. Now it works sometimes, so maybe actual ram use is the issue? Also, is there... [Read more]
I'm just speaking from experience. We had OTA issue back then: https://github.com/openshwprojects/OpenBK7231T_App/issues/745 It was solved by reducing binary size. Do you think the cause may be different... [Read more]