logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

[Solved] Flashing BK7231N Chipset: User's Experience with Tongou TO-Q-SY-JWT Rail DIN Switch

Ramirez22 1953 6
ADVERTISEMENT
  • Helpful post
    #1 20788556
    Ramirez22
    Level 3  

    Hello.

    Total newbie and not good in English, please be patient with me :)

    I have a Rail DIN switch with power metering (look in title)

    I flash it with this file

    Chipset: BK7231N
    Build: Build on Oct 26 2023 06:53:47 version 1.17.291


    I apply these parameters
    {
      "vendor": "Tongou",
      "bDetailed": "0",
      "name": "TO-Q-SY-JWT Switch and Meter for DIN rail.",
      "model": "TO-Q-SY-JWT",
      "chip": "BK7231N",
      "board": "TODO",
      "flags": "33555456",
      "keywords": [
        "Power meter",
        "Rail DIN"
      ],
      "pins": {
        "9": "LED_n;1",
        "15": "WifiLED_n;0",
        "17": "Btn;1",
        "24": "BridgeFWD;1",
        "26": "BridgeREV;1"
      },
      "command": "backlog startDriver BL0942; SetupEnergyStats 1 30 120 0; startDriver NTP"
    }
    


    Flags:
    10, 38 and 40 are set to true

    Working:
    On / Off the switch with button or via Ethernet main page functional

    Not working:
    Power metering always shows "0"

    I have this error in web app logs:
    Quote:
    Warn:EnergyMeter:Consumed 256 unwanted non-header byte in BL0942 buffer


    Is it possible to have some help? But remember: newbie and not English, so simple words please :D

    Many thanks!

    [EDIT1]: I forgot to specify that I launch these commands with 100W Halogen lamp and meters:
    
    PowerSet 100
    VoltageSet 233
    CurrentSet 0.42
    

  • ADVERTISEMENT
  • #2 20789922
    p.kaczmarek2
    Moderator Smart Home
    Hello, how do you know it's BL0942?
    Maybe it's BL0937?
    Or some other chip...

    Can you do Tuya config extraction and attach here result: https://www.youtube.com/watch?v=WunlqIMAdgw
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20789986
    Ramirez22
    Level 3  
    Hello,

    Thanks for your help.

    I suppose this is a BL0942 cause https://www.elektroda.com/rtvforum/topic3934580.html#20435098. It's the same item, but you're right : I don't check components

    Here you can find results
    {
    	"bt1_pin":"17",
    	"led1_pin":"9",
    	"rl1_drvtime":"60",
    	"net_trig":"2",
    	"rl_on1_pin":"24",
    	"jv":"1.0..1",
    	"netled1_lv":"0",
    	"netled_reuse":"0",
    	"bt1_type":"0",
    	"nety_led":"1",
    	"rl_off1_pin":"26",
    	"over_cur":"64000",
    	"bt1_lv":"0",
    	"reset_t":"5",
    	"netled1_pin":"15",
    	"chip_type":"3",
    	"rl_on1_lv":"1",
    	"lose_vol":"0",
    	"over_vol":"0",
    	"module":"CBU",
    	"ch_cddpid1":"9",
    	"ch1_stat":"2",
    	"led1_lv":"0",
    	"rl1_type":"1",
    	"ch_num":"1",
    	"ele_fun_en":"1",
    	"rl_off1_lv":"1",
    	"netn_led":"0",
    	"vol_def":"0",
    	"ch_dpid1":"1",
    	"crc":"88",
    	"}/Agw_di0Atls_ca_cntbv":"40.00",
    	"pv":"2.2",
    	"lpv":"3.3",
    	"pk":"keyuh3jxk9wu8ruj",
    	"firmk":"keyuh3jxk9wu8ruj",
    	"cadv":"0",
    	"cdv":"1.0.0",
    	"dev_swv":"1.0.2",
    	"s_id":"null",
    	"dtp":"0",
    	"sync":"0",
    	"attr_num":"0",
    	"mst_tp_0":"0",
    	"mst_ver_0":"null",
    	"mst_tp_1":"0",
    	"mst.com":"1883",
    	"mq_ip":"3.121.210.75",
    	"ai_sp":"null",
    	"ai_sp_ip":"null",
    	"mq_psk":"m2.tuyaeu.com",
    	"mq_psk_ip":"3.121.210.75",
    	"md":"0",
    	"random":"0",
    	"wfb64":"1",
    	"stat":"0",
    	"token":"null",
    	"region":"null",
    	"reg_key":"null",
    	"dns_prio":"0",
    	"lp_ip":"null",
    	"time_z":"+01",
    	"s_time_z":"[[1679792400",
    	"wx_app_id":"null",
    	"wx_uuid":"null",
    	"dy_tls_m":"2",
    	"cloud_cap":"1025",
    	"psk21_key":"null "
    }
    

    Device configuration, as extracted from Tuya: 
    - Button (channel 1) on P17
    - LED (channel 1) on P9
    - WiFi LED on P15
    Device seems to be using CBU module, which is using BK7231N.
    And the Tuya section starts, as usual, at 2023424
    


    I don't understans anything, but I'm afraid that no information about meter ...

    This is the script generated:
    ClearIO // clear old GPIO/channels
    lfs_format // clear LFS
    StartupCommand ""  // clear STARTUP
    stopDriver *  // kill drivers
    setPinRole 15 WifiLED_n
    backlog setPinRole 9 LED; setPinChannel 9 1
    backlog setPinRole 17 Btn; setPinChannel 17 1
    


    Is it helpfull for you ?

    Added after 8 [hours] 4 [minutes]:

    [EDIT1] I add below logs during start driver BL0942, maybe important information ...

    Debug:CMD:cmd [startDriver BL0942]
    Info:EnergyMeter:Read ENERGYMETER status values. sizeof(ENERGY_METERING_DATA)=32
    Error:CMD:command with name EnergyCntReset already exists!
    Error:CMD:command with name SetupEnergyStats already exists!
    Error:CMD:command with name ConsumptionThreshold already exists!
    Error:CMD:command with name VCPPublishThreshold already exists!
    Error:CMD:command with name VCPPrecision already exists!
    Error:CMD:command with name VCPPublishIntervals already exists!
    Error:CMD:command with name VoltageSet already exists!
    Error:CMD:command with name CurrentSet already exists!
    Error:CMD:command with name PowerSet already exists!
    Info:CMD:[WebApp Cmd 'startDriver BL0942' Result] OK
    Warn:EnergyMeter:Consumed 2 unwanted non-header byte in BL0942 buffer
    Warn:EnergyMeter:Skipping packet with bad checksum 58 wanted 62
    Warn:EnergyMeter:Consumed 23 unwanted non-header byte in BL0942 buffer
    Warn:EnergyMeter:Consumed 24 unwanted non-header byte in BL0942 buffer
    Warn:EnergyMeter:Consumed 24 unwanted non-header byte in BL0942 buffer
    Warn:EnergyMeter:Consumed 24 unwanted non-header byte in BL0942 buffer
    
  • #4 20790095
    p.kaczmarek2
    Moderator Smart Home
    Are you able to open it and check what's used inside?
    Do you have 2MB original firmware backup?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20790631
    Ramirez22
    Level 3  
    In fact, the results above are given by the original backup ...

    [EDIT1] OK, I found the problem
    During flash, I solder small wires on pin 15 and 16.
    But when I remove these wires, I made a shortcut between these 2 pins.

    I clean all the pin and meter is now ok.

    Many thanks for help
  • ADVERTISEMENT
  • #6 20792337
    Ramirez22
    Level 3  
    Take care to don't shortcuts pins !!!
  • #7 20792347
    p.kaczmarek2
    Moderator Smart Home
    Ah, so you shorted two pins... no wonder, it didn't work. I am happy to hear now your issue is resolved.
    Helpful post? Buy me a coffee.

Topic summary

✨ A user experienced issues with a Tongou TO-Q-SY-JWT Rail DIN switch powered by the BK7231N chipset after flashing it with firmware. The switch functioned for basic on/off operations but failed to display power metering data, consistently showing "0". After troubleshooting, it was suggested to verify the chip type and perform a Tuya config extraction. The user later discovered that a short circuit between pins 15 and 16, caused by soldering wires during flashing, was the root of the problem. Once the short was resolved, the power metering functioned correctly.
ADVERTISEMENT