logo elektroda
logo elektroda
X
logo elektroda

Configuring BK7231T Chip for PWM on Pin 26 with LED, Relay, and Button Setup

wayneperryman1983 885 4
ADVERTISEMENT
  • #1 20664526
    wayneperryman1983
    Level 2  

    I have an item with the BK7231T chip flashed to the latest firmware.
    I have:
    1x on/off LED on pin 9 set to ch 2
    1x on/off relay on pin 6 set to ch 1
    1x button on pin 14 set to ch 1

    In this configuration, it works perfectly.

    I also have an LED I wish to dim using PWM on pin 26. It works when I set it to any other channel; however, the button (and relay) plays up and stops working when I enable this PWM. I've tried custom scripts with no luck. I just want this LED to be completely separate or make a custom rule like "when the Wi-Fi is disconnected, toggle the LED the same as channel 1," otherwise completely independent.

    Any help would be great!!

    Added after 1 [minutes]:
  • ADVERTISEMENT
  • #2 20664530
    ElektrodaBot
    AI OpenAI ChatGPT4
    wayneperryman1983 wrote:
    (...) (and relay plays up) stops working when I enable this PWM. I've tried custom scripts with no luck. I just want this LED to be separate completely or make a custom rule like "when the wifi is disconnected toggle the LED the same as channel 1" otherwise completely independent.

    Any help would be great!!
    Hello User4293554,

    It seems like you are trying to accomplish quite a sophisticated task here. It's interesting that the button and relay stop working when you enable the PWM. When they stop working, is it directly because you enable the PWM, or do you change anything else in your setup? Also, can you please elaborate on what you mean by "relay plays up"?

    From the scenario you described, I suspect you might be running into a conflict of resources, especially if the PWM frequency is too high. The BK7231T chip is a Wi-Fi SoC, so it has to manage Wi-Fi communications alongside your GPIO tasks. There are limits to what it can handle simultaneously.

    Regarding your desire to have the LED behave differently based on the Wi-Fi status, that should be achievable through the BK7231T's SDK. You would typically monitor the Wi-Fi status and adjust the LED's state accordingly in your code.

    Can you share the script you have tried? It would help me better understand your setup and try to suggest a solution.
    You can call me in any topic by writing @ElektrodaBot. Disclaimer: Some answers provided by the ElektrodaBot may be inaccurate. Elektroda not responsible for accuracy, reliability or completeness of the information presented. All ElektrodaBot responses should be verified by the user. OpenAI can monitor and save information entered after calling ElektrodaBot.
  • ADVERTISEMENT
  • #3 20664562
    wayneperryman1983
    Level 2  

    I literally just added PWM on any channel other than 1 or 2 and it stops working. If I change it back, it works again.

    The relay no longer toggles on channel 1 unless I turn off the new light, but it only toggles once. Then I need to turn the light back on before I can toggle it again, certainly not ideal.

    The PWM works fine by itself.

    The script was simply to try to isolate the items on channel 1, but it made no difference. I'm not sure I even did it correctly as I couldn't find a clear how-to guide when trying to do this.
  • ADVERTISEMENT
  • #4 20664681
    p.kaczmarek2
    Moderator Smart Home
    Please don't use Elektroda GPT 4 bot for software that was released after 2021, it will not be helpful.

    Please post your full config, maybe screenshots or something, or just copy JSON template from Web App so I can test on my device.

    Maybe setting "show raw PWM controllers" flag in flags menu can help.

    Also, if you want to have separate relay and PWM, make sure to use separate channels. So, let's say, Relay should be channel 1 and PWM should be channel 2.
    Helpful post? Buy me a coffee.
  • #5 20664701
    wayneperryman1983
    Level 2  

    Is this what you mean by full config?

    {
    "vendor": "Tuya",
    "bDetailed": "0",
    "name": "Full Device Name Here",
    "model": "enter short model name here",
    "chip": "BK7231T",
    "board": "TODO",
    "flags": "1032",
    "keywords": [
    "TODO",
    "TODO",
    "TODO"
    ],
    "pins": {
    "6": "Rel;1",
    "9": "LED_n;2",
    "14": "Btn;1",
    "26": "LED;3"
    },
    "command": "",
    "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
    "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }

    This is working

    Added after 1 [minutes]:

    >>20664681

    {
    "vendor": "Tuya",
    "bDetailed": "0",
    "name": "Full Device Name Here",
    "model": "enter short model name here",
    "chip": "BK7231T",
    "board": "TODO",
    "flags": "1032",
    "keywords": [
    "TODO",
    "TODO",
    "TODO"
    ],
    "pins": {
    "6": "Rel;1",
    "9": "LED_n;2",
    "14": "Btn;1",
    "26": "PWM;3"
    },
    "command": "",
    "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
    "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }

    This is not
ADVERTISEMENT