Elektroda.com
Elektroda.com
X
  • disassembly pictures:
    BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl
    BK7231N - Universal IR Remote Contorl

    December 2022 update:
    * the IR blaster is now working (firmware 1.15.x , i tested mine on 1.15.226)
    * this device is Model S08 / PCB: S06-CBU-V1.2
    * all the pins needed for flashing are easily accessible on the board (TX1,RX1,GND,3.3v and CEN for reset)
    * After flashings set pins as follows and restart the device! (IR pins are not changed at real-time)




    PinDescription
    7IRSend
    8IRRecv
    24wifiLed

    BK7231N - Universal IR Remote Contorl

    * Testing the IRRecv: go to the webapp log and shot some coded for external remote, you should see something like that:
    
    Info:IR:IR IR_LG 0x88 0xC005 0
    Info:IR:IR IR_LG 0x88 0x160 0
    Info:IR:IR IR_LG 0x88 0x970 0
    Info:IR:IR IR_LG 0x88 0x980 0
    Info:IR:IR IR_LG 0x88 0x990 0
    

    * Testing the IRSend: copy the protocol and command from the log to create ir-send command as in the example below
    IRSend LG-88-130-1

    BK7231N - Universal IR Remote Contorl

    Cool? Ranking DIY
    About Author
    yarix2
    Level 3  
    Offline 
    yarix2 wrote 6 posts with rating 8. Been with us since 2022 year.
  • #2
    p.kaczmarek2
    Moderator Smart Home
    I haven't seen a BK7231N IR remote control before. Where did you buy it?
    CBU module information:
    BK7231N - Universal IR Remote Contorl
    Pin numberSymbolI/O typeFunction
    1P14I/OCommon GPIO, which can be reused as SPI_SCK (Correspond to Pin 11 of the IC)
    2P16I/OCommon GPIO, which can be reused as SPI_MOSI (Correspond to Pin 12 of the IC)
    3P20I/OCommon GPIO (Correspond to Pin 20 of the IC)
    4P22I/OCommon GPIO (Correspond to Pin 18 of the IC)
    5ADCI/OADC, which corresponds to P23 on the internal IC (Correspond to Pin 17 of the IC)
    6RX2I/OUART_RX2, which corresponds to P1 on the internal IC. (Correspond to Pin 28 of the IC)
    7TX2I/OUART_TX2, which is used for outputting logs and corresponds to P0 of the internal IC (Correspond to Pin 29 of the IC)
    8P8I/OSupport hardware PWM (Correspond to Pin 24 of the IC)
    9P7I/OSupport hardware PWM (Correspond to Pin 23 of the IC)
    10P6I/OSupport hardware PWM (Correspond to Pin 22 of the IC)
    11P26I/OSupport hardware PWM (Correspond to Pin 15 of the IC)
    12P24I/OSupport hardware PWM (Correspond to Pin 16 of the IC)
    13GNDPPower supply reference ground
    143V3PPower supply 3V3
    15TX1I/OUART_TX1, which is used for transmitting user data and corresponds to Pin 27 of the IC. For the MCU solution, please refer to CBx Module.
    16RX1I/OUART_RX1, which is used for receiving user data and corresponds to Pin 26 of the IC. For the MCU solution, please refer to CBx Module.
    17P28I/OCommon GPIO (Correspond to Pin 10 of the IC)
    18CENI/OReset pin, low active (internally pulled high), compatible with other modules (Correspond to Pin 21 of the IC)
    19P9I/OCommon GPIO (Correspond to Pin 25 of the IC)
    20P17I/OCommon GPIO, which can be reused as SPI_MISO (Correspond to Pin 14 of the IC)
    21P15I/OCommon GPIO, which can be reused as SPI_CS (Correspond to Pin 13 of the IC)
    Test pointCSNI/OMode selection pin. If it is connected to the ground before being powered on, enter the firmware test mode. If it is not connected or connected to VCC before being powered on, enter the firmware application mode. Correspond to Pin 19 on the internal IC.


    btw. on the PCB, I can clearly see RX2 and TX2 UART pads, which are used for debug log output. I can also see SPI pins for SPI mode flashing and CEN pin, but no RX1 and TX1 (UART programming). Luckily RX1 and TX1 are on CBU
  • #4
    bubu1769
    Level 42  
    I stayed on the stock exchange by mistake, I thought it was something else :D , for PLN 10 I bought such a miracle:
    https://www.amazon.pl/SwitchBot-Smart-pilot-zdalny-sterowania/dp/B07TTH5TMW
    All in all, I had a little fun and put it back in the wardrobe because I don't have so many devices with IR remotes in one room and those for which I don't have a remote are not on the list of predefined devices, so it doesn't give me anything anyway.
    I will see, maybe someday I will find some use for it.
    It looks a bit different inside
    BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl
  • #6
    p.kaczmarek2
    Moderator Smart Home
    There should be no problems with IR soon, just wait.
    I will try to order such a device for testing, if I find it somewhere with cheap shipping to Poland.
    Can you also do a flash dump for tuya-cloudcutter?

    I can also see it has a SH4 433MHz radio module, do anyone know here how it works? Is it just like with simple wall switches, where RF chip just outputs digital 1 or 0 signals on button inputs?
    Quote:

    SH4 is a low-power embedded Sub-G 433M that Tuya has developed. It consists of a highly integrated RF transceiver chip (CMTOV30-EQR) and a few peripherals. SH4 needs to control transmitting and receiving with the MCU. On the basis of this, you can develop the embedded Sub-G communication products as needed.

    BK7231N - Universal IR Remote Contorl
    BK7231N - Universal IR Remote Contorl
  • #7
    btsimonh
    Level 11  
    Just bought one, £8.50 delivered to UK :).
    Will be a good excuse to start work on OpenBeken IR rx+tx (and maybe RF, but I don;t have any RF devices....).
  • #8
    p.kaczmarek2
    Moderator Smart Home
    Yes, let's get IR working! I will also buy that one.

    But wait... can't we just get any IR receiver module (even one from old CRT TV) and use that for testing? I have tons of them.
  • #9
    ferbulous
    Level 15  
    p.kaczmarek2 wrote:
    Yes, let's get IR working! I will also buy that one.

    But wait... can't we just get any IR receiver module (even one from old CRT TV) and use that for testing? I have tons of them.


    I think you can just connect any IR receiver and IR transmitter from any remote to test it out with beken chip similar to esp
  • #11
    p.kaczmarek2
    Moderator Smart Home
    @omelchuk890 you are seeing correct, although it is a preliminary development version. Please wait few days.
    @ferbulous I'm on it. Here are some random photos from IR testing, my IR parts collection, comparison with Arduino, preparation of WB2S. Stay tuned for more!
    BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl
  • #12
    ferbulous
    Level 15  
    @p.kaczmarek2 great work on ir component!
    Looking forward to try it once it's stable
  • #13
    p.kaczmarek2
    Moderator Smart Home
    @ferbulous we're working on it, but it's T only so far.
    Here is a LED strip driver that didn't have IR receiver at first but I managed to solder one to it:



    EDIT: I see that my camera broke the effect. You should see the strip dimming going gradually up. I can increase the brightness of the strip via remote, but my camera also has auto-brightness and on video it looks bad.

    Development test ONLY script, do not use because it sets PWM directly (it ignores LED driver with Enable function):
    
    addEventHandler2 IR_Samsung 0x707 0x65 setChannel 0 0
    addEventHandler2 IR_Samsung 0x707 0x62 setChannel 0 100
    addEventHandler2 IR_Samsung 0x707 0x60 addChannel 0 10 0 100
    addEventHandler2 IR_Samsung 0x707 0x61 addChannel 0 -10 0 100
    

    This script was used for presentation above. The documentation is coming soon.
  • #14
    omelchuk890
    Level 10  
    Tested on firmware 1.14.42 - reception is working, data in MQTT is leaving.
    How do I send a transfer command via MQTT?

    @p.kaczmarek2
    You are simply a treasure of knowledge, patience and enthusiasm!!!

    P.S. I have noticed device freezes...
    only a power reboot helps.
    And the IR receiver sends incomprehensible data to the controller even if it is completely closed. I watched the oscilloscope at its output.
    Spoiler:
    BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl BK7231N - Universal IR Remote Contorl

    The other receiver does the same thing.
    Spoiler:



    But I just need to read the data and then I can turn off reception.
  • #15
    p.kaczmarek2
    Moderator Smart Home
    Thank you.

    Yesterday we had to increase the stack size slightly to prevent potential, exactly, freezes, that happened to us in multiple places. Today I also added a MQTT deduper, which prevents things like "led_enableAll" being send multiple times per second due to user holding a remote button to turn up gradually the brightness.

    More optimization coming soon.

    The "unknown" IR kind of packets are hidden now, they're just noise.
  • #16
    omelchuk890
    Level 10  
    @p.kaczmarek2
    I constantly receive it with variable frequency.
    Spoiler:
    BK7231N - Universal IR Remote Contorl

    Spoiler:
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x41
    Info:IR:Repeat
    Info:IR: Gap 29900us
    Info:IR: Raw-Data=0x1
    Info:IR: 1 bits
    Info:IR: MSB first
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x41 1 took 8ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000041
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR: Raw-Data=0x0
    Info:IR: 0 bits
    Info:IR: MSB first
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 0 took 2ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR: Raw-Data=0x0
    Info:IR: 0 bits
    Info:IR: MSB first
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 0 took 7ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR:Repeat
    Info:IR: Gap 36100us
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 1 took 6ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR:Repeat
    Info:IR: Gap 9300us
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 1 took 1ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR:Repeat
    Info:IR: Gap 10200us
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 1 took 7ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR: Raw-Data=0x0
    Info:IR: 0 bits
    Info:IR: MSB first
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 0 took 2ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR:Repeat
    Info:IR: Gap 48350us
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 1 took 7ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR: Raw-Data=0x0
    Info:IR: 0 bits
    Info:IR: MSB first
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 0 took 6ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR: Raw-Data=0x0
    Info:IR: 0 bits
    Info:IR: MSB first
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 0 took 3ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR: Raw-Data=0x0
    Info:IR: 0 bits
    Info:IR: MSB first
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 0 took 6ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR:Repeat
    Info:IR: Gap 28300us
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 1 took 6ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 4
    Info:IR:Address=0x0
    Info:IR: Command=0x0
    Info:IR:Repeat
    Info:IR: Gap 11250us
    Info:IR:IR decode returned true, protocol JVC (4)
    Info:IR:IR MQTT publish IR_JVC 0x0 0x0 1 took 8ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000000
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR:Repeat
    Info:IR: Gap 51200us
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 1 took 2ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR:Repeat
    Info:IR: Gap 15700us
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 1 took 4ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR:Repeat
    Info:IR: Gap 85900us
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 1 took 2ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040
    Info:IR:IR decode returned true, protocol 16
    Info:IR:Address=0x0
    Info:IR: Command=0x40
    Info:IR: Raw-Data=0x0
    Info:IR: 0 bits
    Info:IR: MSB first
    Info:IR:IR decode returned true, protocol RC5 (16)
    Info:IR:IR MQTT publish IR_RC5 0x0 0x40 0 took 8ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000040

    Spoiler:
    BK7231N - Universal IR Remote Contorl
  • #17
    avdm
    Level 5  
    This looks very promising! I have the same IR blaster as yarix2 (the s06-CBU-v1.2 board) and successfully flashed it with OpenBK7231N. Does anyone know what settings you should use for the IRsend and IRRecv pins? I tried to test a (wrong) pin but the device almost bricked. It's up and running now but I damaged the RX1 solder pad (I know, stupid me) so I can now only do OTA updates so I'm a bit worried of making a mistake and not being able to re-flash the device again.

    Edit: If I'm not mistaken IRRecv seems to be on Pin 8 (according to my multimeter). Unfortunately I seem to have killed the device while reverse engineering the traces so I can't test it myself at the moment.

    Datasheet: https://solution.tuya.com/hardware/detail/60004
    BK7231N - Universal IR Remote Contorl
  • #18
    p.kaczmarek2
    Moderator Smart Home
    Hello @avdm . The N platform requires a timer adjust which has not been done yet, but @btsimonh has just received his N IR receiver today, sooo I hope this will be resolved soon. Please wait several days, ok? In a meantime, check which pin connects where.

    Also don't worry about bricking the device. IR driver is started only in normal mode, and safe mode is started if device fails to boot correctly for 30 seconds 5 time in the row. No matter what happens with IR, you should always be able to get back into the safe mode and use it to change back the configuration (pins config) back to safe one.
  • #19
    avdm
    Level 5  
    Thank you for the update, I appreciate it! And you are absolutely right. After some power resets the device came back to life. I've ordered 2 extra (Got a great deal: 2 for less than €13) so I can safely use the unit I already have as a test device.If there is anything I can test, please let me know. In the mean time I"ll wait patiently.

    About the pins:
    A quick test with my multimeter seems to show the following:




    Pin Symbol I/O type Function Possible connection
    8 P8 I/O Support hardware PWM (Correspond to Pin 24 of the IC) IRRecv
    12 P24 I/O Support hardware PWM (Correspond to Pin 16 of the IC) IRSend and/or status led
  • #20
    p.kaczmarek2
    Moderator Smart Home
    I think that @btsimonh got IR working on N today. It was just a little fix related to timer. It should be possible to receiver IR on both T and N now. Only MQTT rate improvements are pending. If you spam a lot of IR MQTT, then you might get a MQTT disconnect.
  • #21
    avdm
    Level 5  
    IRreceive is working! I tested it with multiple remotes and seems to work great. The receive pin is Pin 8. Does anyone know if the transmitter also works? I haven't figured out how to use that successfully. I've tried to sending the following command in the log terminal like this but it didn't seem to do anything (no IR led flashes detected with my phone camera).
    IRsend {"Protocol":"PANASONIC","Bits":48,"Data":0x100BCBD}

    Maybe the formatting is of as it seems different then the MQTT formatting. Any guidance would be much appreciated.

    Example IR receiving MQTT message of a Sony remote:
    Topic: IRBlaster/ir/get
    Value: IR_Sony 0x1 0x0 1


    Example of IR receiving of a Sony remote:
    Info:IR:IR decode returned true, protocol 21
    Info:IR:Address=0x1
    Info:IR: Command=0x0
    Info:IR: Raw-Data=0x80
    Info:IR: 12 bits
    Info:IR: LSB first
    Info:IR:IR decode returned true, protocol Sony (21)
    Info:MQTT:Publishing val IR_Sony 0x1 0x0 0 to IRBlaster/ir/get retain=0
    Info:IR:IR MQTT publish IR_Sony 0x1 0x0 0 took 1ms
    Info:IR:IR fire event took 0ms
    Info:IR:Received cmd 00000000
    Info:IR:IR decode returned true, protocol 21
    Info:IR:Address=0x1
    Info:IR: Command=0x0
    Info:IR:Repeat
    Info:IR: Gap 27450us
    Info:IR: Raw-Data=0x80
    Info:IR: 12 bits
    Info:IR: LSB first
  • #22
    exotsk
    Level 2  
    I have the same question. mqtt publishing in /ir/set : IR_NEC 0x7F00 0xF3 1 (raw) in log ->
    Info:MQTT:MQTT client in mqtt_incoming_publish_cb topic ir_blaster/ir/set
    Info:MQTT:MQTT in topic ir_blaster/ir/set
    Info:MQTT:channelSet part topic ir/set
    Info:MQTT:channelSet channel -1

    need right syntax mqtt command.
  • #23
    omelchuk890
    Level 10  
    @exotsk we are all waiting for an answer to this question
  • #24
    p.kaczmarek2
    Moderator Smart Home
    It was not yet even tested by me, @btsimonh might say more about it, but:
    Code: c
    Log in, to see the code
  • #25
    exotsk
    Level 2  
    CMD_RegisterCommand("IRSend","",IR_Send_Cmd, "NEC-1-1A-0", NULL); -> Error:CMD:cmd CMD_RegisterCommand("IRSend","",IR_Send_Cmd, NOT found (args "NEC-1-1A-0", NULL);)
    BK7231N - Universal IR Remote Contorl
  • #26
    p.kaczmarek2
    Moderator Smart Home
    You must enable IR driver first, "startDriver IR". Futhermore, I am not sure because I am not at home right now, in some cases you might get incorrect "command not found" messages while it was executed (I am not sure, it is being addressed these days and should be fixed next week).

    EDIT: Wait, you typed whole C code into the console? That is not right.

    You should rather try:
    
    IRSend NEC-1-1A-0
    

    Syntax is: PROT-ADDR-CMD-REP, protocol-address-command-repetitions
  • #27
    exotsk
    Level 2  
    right topic
    cmnd/ir_blaster/IRSend

    payload
    NEC-1-1A-0
    it`s accepted by log;

    but maybe IR_NEC????
    and
    How can i found right pin and channel for IRSend? BK7231N - Universal IR Remote Contorl
  • #28
    p.kaczmarek2
    Moderator Smart Home
    Yes, it is possible to executes commands both by MQTT and by console.
  • #29
    exotsk
    Level 2  
    BK7231N - Universal IR Remote Contorl
    ir in -> conected to EN (3)
    ir out -> tx2 / (12)

    but irreceive with pin8 settings recevive signal ok
  • #30
    omelchuk890
    Level 10  
    @p.kaczmarek2
    is it possible to add an output to the transmitter in an inverted form? as on a relay or led.
    I always have this, when choosing "output to IR", this is how the output stage is built, common emitter circuit
    BK7231N - Universal IR Remote Contorl

    I have transistors, output, control the LEDs as a relay output or led - the high level turns on the ir.