logo elektroda
logo elektroda
X
logo elektroda

[Solved] BK7231 flashing sensor via tuya-cloudcutter, not connecting to network

minchutu 15630 26
Best answers LABEL_AI_GENERATED

How can I get a BK7231 sensor flashed with tuya-cloudcutter to finish connecting and become accessible on my network?

If cloudcutter gets stuck at AP-ENABLED, leave it running, then use the Tuya app to manually add the device, remove location permission from the app, and when the Wi‑Fi step appears enter `cloudcutterflash` with password `abcdabcd`; after the device is added, the firmware update should resume within a few minutes [#20658238] Make sure you selected the correct firmware/build for the chip, because BK7231T and BK7231N need different binaries [#20515888] If it still boots but will not connect on an N platform, try clearing/restoring the RF partition from the OBK web app or the BK7231 Easy Gui flasher, since that has fixed Wi‑Fi issues for some devices [#20529181]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • #1 20515745
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    Hello.
    Has anyone managed to successfully inject the firmware using cloudcutter?
    I've tried and everything seems to be fine, but I can't get the sensor to connect to my network and therefore I can't configure or access BK7231 flashing sensor via tuya-cloudcutter, not connecting to network it. It doesn't show up in the DHCP list anywhere.
    On the other hand, I have created a box to integrate a DC converter, and forgot about batteries and deep_sleep. You can download it from https://www.thingiverse.com/thing:5940603/files
  • ADVERTISEMENT
  • #2 20515772
    dheenhasty
    Level 13  
    Posts: 111
    Help: 2
    Rate: 17
    Yes, i have done it.

    But on cloud cutter you had 2 version cause there's a new firmware on it.
  • ADVERTISEMENT
  • #3 20515795
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    Excuse me!
    What 2 versions are you talking about? I can just find one. I'm afraid I know even less than I thought...
  • #4 20515812
    dheenhasty
    Level 13  
    Posts: 111
    Help: 2
    Rate: 17
    It's the same device listed on obk webapp, but on cloud cutter you will find two version. The key is different. So you had to try both version.

    If the flash is succesfull, you need to connect to the opbk wifi ap access, to configure your wifi after.
  • #5 20515888
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14767
    Help: 659
    Rate: 12907
    Make sure you are choosing proper binary, the BK7231T build for BK7231T, and BK7231N build for BK7231N.
    Helpful post? Buy me a coffee.
  • #6 20515907
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    Now I see what you mean.

    This is what I did:

    - I set -r parameter
    - I chose 2) Flash 3rd party firmware
    - I chose OpenBK7231N_UG_1.15.635.bin
    - I selected 1.1.17 firmware version (as shown in Tuya app)

    Everything was ok until the point when the sensor has to connect to 'cloudcutterflash'. Then I'm stuck
  • #7 20515996
    dheenhasty
    Level 13  
    Posts: 111
    Help: 2
    Rate: 17
    So it might be the firmware version you can try the other one ?
  • #8 20516016
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    Same result. It got stuck and no connect to cloudcutterflash.
    I've tried without the -r as well.
  • #9 20517703
    dheenhasty
    Level 13  
    Posts: 111
    Help: 2
    Rate: 17
    You can post a printscreen or the output of cloudcutter please ? to know where it stuck exactly.
  • Cloudcutter flashing log for BK7231N sensor

    #10 20517744
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    First, thank you all for your help

    This is the sequence:



    sudo ./tuya-cloudcutter.sh
    [sudo] password for minchutu:
    Building cloudcutter docker image
    Sending build context to Docker daemon 23.18MB
    Step 1/10 : FROM python:3.9-slim-buster AS base
    ---> 954110adf96f
    Step 2/10 : RUN apt-get -qq update && apt-get install -qy --no-install-recommends git hostapd rfkill dnsmasq build-essential libssl-dev iproute2 mosquitto
    ---> Using cache
    ---> b3dcd8221715
    Step 3/10 : FROM base AS python-deps
    ---> b3dcd8221715
    Step 4/10 : RUN pip install --upgrade pipenv
    ---> Using cache
    ---> bcdb7816cdf0
    Step 5/10 : COPY src/Pipfile /src/
    ---> Using cache
    ---> e5b258010cfc
    Step 6/10 : COPY src/Pipfile.lock /src/
    ---> Using cache
    ---> 52da6d1b41e2
    Step 7/10 : RUN cd /src && PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
    ---> Using cache
    ---> e45e9a626ade
    Step 8/10 : FROM python-deps AS cloudcutter
    ---> e45e9a626ade
    Step 9/10 : COPY src /src
    ---> Using cache
    ---> 6a3be18d0fa6
    Step 10/10 : WORKDIR /src
    ---> Using cache
    ---> 73a318802cb0
    Successfully built 73a318802cb0
    Successfully tagged cloudcutter:latest
    Successfully built docker image
    1) Detach from the cloud and run Tuya firmware locally
    2) Flash 3rd Party Firmware
    [?] Select your desired operation [1/2]: 2
    Loading options, please wait...
    [?] Select your custom firmware file: OpenBK7231N_UG_1.15.635.bin
    > OpenBK7231N_UG_1.15.635.bin

    [?] How do you want to choose the device?: By firmware version and name
    By manufacturer/device name
    > By firmware version and name
    From device-profiles (i.e. custom profile)

    [?] Select the firmware version and name: 1.1.17 - BK7231N / oem_bk7231n_temp_hum_sensor
    1.1.0 - BK7231T / oem_bk7231s_curtain_switch_nuohua
    1.1.0 - BK7231T / oem_bk7231s_light5_sleepwake_random_globe
    1.1.0 - BK7231T / oem_bk7231s_rnd_switch
    1.1.1 - BK7231T / HYS_03_018_bk7231t_a4y9plclmzpct6ol
    1.1.1 - BK7231T / oem_bk7231s_light_ty_oldDp
    1.1.11 - BK7231N / oem_bk7231n_temp_hum_sensor
    > 1.1.17 - BK7231N / oem_bk7231n_temp_hum_sensor
    1.1.2 - BK7231N / oem_bk7231n_control_switch
    1.1.2 - BK7231T / oem_bk7231s_control_switch
    1.1.2 - BK7231T / oem_bk7231s_hailai_1_plug
    1.1.2 - BK7231T / oem_bk7231s_light_db
    1.1.2 - BK7231T / oem_bk7231s_light_ty
    1.1.2 - BK7231T / oem_bk7231s_rnd_switch

    [?] Select the brand of your device: Tuya Generic
    > Tuya Generic

    [?] Select the article number of your device: Temperature and Humidity Sensor v1.1.17
    > Temperature and Humidity Sensor v1.1.17

    Selected Device Slug: tuya-generic-temperature-and-humidity-sensor-v1.1.17
    Selected Profile: oem-bk7231n-temp-hum-sensor-1.1.17-sdk-2.3.1-40.00
    Selected Firmware: /work/custom-firmware/OpenBK7231N_UG_1.15.635.bin

    ================================================================================
    Place your device in AP (slow blink) mode. This can usually be accomplished by either:
    Power cycling off/on - 3 times and wait for the device to fast-blink, then repeat 3 more times. Some devices need 4 or 5 times on each side of the pause
    Long press the power/reset button on the device until it starts fast-blinking, then releasing, and then holding the power/reset button again until the device starts slow-blinking.
    See https://support.tuya.com/en/help/_detail/K9hut3w10nby8 for more information.
    ================================================================================

    Scanning for open Tuya SmartLife AP
    .............................
    Found access point name: "A-A1BC", trying to connect...
    Device 'wlp2s0' successfully activated with '14cb3162-ba10-402c-8a70-89ef237829df'.
    Connected to access point.
    Waiting 1 sec to allow device to set itself up...
    Running initial exploit toolchain...
    Exploit run, saved device config too!
    output=/work/configured-devices/obzM4Umou2nr.deviceconfig
    Saved device config in /work/configured-devices/obzM4Umou2nr.deviceconfig

    ================================================================================
    Power cycle and place your device in AP (slow blink) mode again. This can usually be accomplished by either:
    Power cycling off/on - 3 times and wait for the device to fast-blink, then repeat 3 more times. Some devices need 4 or 5 times on each side of the pause
    Long press the power/reset button on the device until it starts fast-blinking, then releasing, and then holding the power/reset button again until the device starts slow-blinking.
    See https://support.tuya.com/en/help/_detail/K9hut3w10nby8 for more information.
    ================================================================================

    Scanning for open Tuya SmartLife AP
    ...............................................
    Found access point name: "A-A1BC", trying to connect...
    Device 'wlp2s0' successfully activated with '14cb3162-ba10-402c-8a70-89ef237829df'.
    Connected to access point.
    Configured device to connect to 'cloudcutterflash'
    Device is connecting to 'cloudcutterflash' access point. Passphrase for the AP is 'abcdabcd' (without ')
    Checking UDP port 53... Occupied by dnsmasq with PID 2362.
    Port 53 is needed to resolve DNS queries
    Do you wish to terminate dnsmasq? [y/N] y
    Attempting to stop dnsmasq.service
    Checking UDP port 67... Available.
    Checking TCP port 80... Available.
    Checking TCP port 443... Available.
    Checking TCP port 1883... Occupied by mosquitto with PID 2293.
    Port 1883 is needed to run MQTT
    Do you wish to terminate mosquitto? [y/N] y
    Attempting to stop mosquitto.service
    Checking TCP port 8886... Available.
    Flashing custom firmware...

    ================================================================================
    Wait for up to 10-120 seconds for the device to connect to 'cloudcutterflash'. This script will then show the firmware upgrade requests sent by the device.
    ================================================================================

    Using WLAN adapter: wlp2s0
    Configuration file: /dev/stdin
    Using interface wlp2s0 with hwaddr ec:55:f9:53:d1:aa and ssid "cloudcutterflash"
    wlp2s0: interface state UNINITIALIZED->ENABLED
    wlp2s0: AP-ENABLED

    After that I got nothing else. I've tried:

    - wait for half an hour
    - EZ mode (quick blick)
    - AP mode (slow blink)
    - Use Tuya App trying to connect with the sensor

    I do not know what else to do.
  • #11 20518736
    dheenhasty
    Level 13  
    Posts: 111
    Help: 2
    Rate: 17
    You see the cloudcutter ap with a smartphone for example ?

    Be sure to configure your wifi card to 2,4ghz for the ap mode. If it's a 5g endpoint it will not work.
  • #12 20521885
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    @dheenhasty it's confirmed: cloudcutterflash is a 2.4GHz network

    BK7231 flashing sensor via tuya-cloudcutter, not connecting to network
  • ADVERTISEMENT
  • #13 20528519
    dheenhasty
    Level 13  
    Posts: 111
    Help: 2
    Rate: 17
    Sorry for the delay in anwser. it's really strange. seems like your sensor don't want to connect to the AP you expose .....

    i'll have a couple of sensor to patch this week end. so i see if i encounter the same error. you have the possibility to patch it thru serial port ?
  • ADVERTISEMENT
  • #14 20528762
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    Thanks a lot for your interest.
    Yes, I've ordered a CH340 module. I'll try as soon as I receive the item.
  • Clear rf partition to fix WiFi connection issues

    #15 20529181
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14767
    Help: 659
    Rate: 12907
    I have split this into separate topic, because it doesn't have much to do with the sensor itself. Parent topic is here:
    https://www.elektroda.com/rtvforum/topic3945688-120.html

    Regarding WiFi issue - I saw few times something strange with N platform. It was not able to connect to WIFi and the only fix was to use the web app "clear rf partition" button or the same button from our flash tool. I am not sure why it happens. Maybe it's because Tuya updated their RF calibration structure and it's now not compatible with our SDK. It does not happen often, though.
    Helpful post? Buy me a coffee.
  • Cloudcutter flash completes but device never joins Wi‑Fi

    #16 20530807
    dheenhasty
    Level 13  
    Posts: 111
    Help: 2
    Rate: 17
    >>20528519


    Ok i've just flash 2 in a row with no issue :

    Quote:

    Flashing custom firmware...

    ================================================================================
    Wait for up to 10-120 seconds for the device to connect to 'cloudcutterflash'. This script will then show the firmware upgrade requests sent by the device.
    ================================================================================

    Using WLAN adapter: wlp3s0
    Configuration file: /dev/stdin
    Using interface wlp3s0 with hwaddr 60:67:20:d7:be:74 and ssid "cloudcutterflash"
    wlp3s0: interface state UNINITIALIZED->ENABLED
    wlp3s0: AP-ENABLED
    Using PSK v1 - Received PSK ID version 01
    Processing endpoint /v2/url_config
    Processing endpoint tuya.device.active
    Processing endpoint tuya.device.dynamic.config.get
    Processing endpoint tuya.device.dev.dp.get
    !!! Endpoint response not found, using default response - tuya.device.dev.dp.get (This is usually okay and safe to ignore unless something isn't working)
    Processing endpoint tuya.device.uuid.pskkey.get
    [MQTT Sending] Triggering firmware update message.
    Processing endpoint tuya.device.upgrade.get
    Processing endpoint tuya.device.upgrade.status.update
    Processing endpoint /files/OpenBK7231N_App_UG_1.11.33.bin
    Firmware update progress: 26%
    Processing endpoint atop.online.debug.log
    Processing endpoint tuya.device.dynamic.config.get
    Processing endpoint tuya.device.dynamic.config.ack
    Firmware update progress: 56%
    Firmware update progress: 86%
    [Firmware Upload] /files/OpenBK7231N_App_UG_1.11.33.bin send complete, request range: bytes=0-626831/626832
    Firmware update progress: 98%
    Firmware file has been sent and MQTT reported a progress of nearly complete. Waiting 15 seconds to ensure flashing completes.
    Flashing should be complete. It takes about 15 seconds for the device to reboot and verify the flash was valid.
    Please wait about 30 seconds then look for signs of activity from the firmware you supplied (either watch for AP mode or check if it joined your network).


    So first connection put the sensor in slow blinking ( hold button => fast blinking => Release => hold again => Slow blinking)
    then when it asked for the other connection : => remove battery => put them back in => Hold button => Fast blinking => Release => hold again => Slow blinking

    then it stuck to cloudcutterflash line for One minutes at least. and then it flash the firmware.
  • #17 20543660
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    Hi!

    The CH340 module finally arrived and I have been able to flash the latest firmware with no problems. I don't know exactly why this module has resisted cloudcutter. You never know..

    Now that I have the module working again (although I have a small problem that I mentioned in the original chat), I'm going to try cloudcutter in two other modules still with original Tuya software. This time I hope everything goes well.

    Greetings.
  • #18 20546930
    dheenhasty
    Level 13  
    Posts: 111
    Help: 2
    Rate: 17
    Glad you find a solution :)
  • MQTT port conflict during cloudcutter flashing

    #19 20547017
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    Hello.
    I have been able to flash two sensors with cloudcutter without "barely" problems. And I say this because I had to try twice in both cases. The only difference I found is that while in the first one the mqtt port was busy:

    Configured device to connect to 'cloudcutterflash'
    Device is connecting to 'cloudcutterflash' access point. Passphrase for the AP is 'abcdabcd' (without ')
    Checking UDP port 53... Occupied by dnsmasq with PID 2697.
    Port 53 is needed to resolve DNS queries
    Do you wish to terminate dnsmasq? [y/N] and
    Attempting to stop dnsmasq.service
    Checking UDP port 67... Available.
    Checking TCP port 80... Available.
    Checking TCP port 443... Available.
    Checking TCP port 1883... Occupied by mosquito with PID 2645.
    Port 1883 is needed to run MQTT
    Do you wish to terminate mosquito? [y/N] y
    Attempting to stop mosquito.service
    Checking TCP port 8886... Available.
    Flashing custom firmware...

    The second time the port was free and the procedure was managed without incident:

    Configured device to connect to 'cloudcutterflash'
    Device is connecting to 'cloudcutterflash' access point. Passphrase for the AP is 'abcdabcd' (without ')
    Checking UDP port 53... Occupied by systemd-resolve with PID 2209.
    Port 53 is needed to resolve DNS queries
    Do you wish to terminate systemd-resolve? [y/N] y
    Attempting to stop systemd-resolved.service
    Checking UDP port 67... Available.
    Checking TCP port 80... Available.
    Checking TCP port 443... Available.
    Checking TCP port 1883... Available.
    Checking TCP port 8886... Available.
    Flashing custom firmware...

    I say this not as a complaint, but in case any of you might find some more useful information.

    ¡Saludos!
  • #20 20590117
    BennyB44
    Level 1  
    Posts: 1
    >>20529181
    Would you be able to elaborate on what you need to do here?

    My downlights have an N chip and are displaying the same behavior.

    Cheers
  • #21 20590477
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14767
    Help: 659
    Rate: 12907
    BennyB44 wrote:

    My downlights have an N chip and are displaying the same behavior.

    What kind of behaviour?
    You can clear/Restore RF partition via Web App in OBK or via button in BK7231 Easy Gui flasher.
    Please provide more information and we can try to come up with something.
    Helpful post? Buy me a coffee.
  • No clear pattern for cloudcutter failures

    #22 20607470
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    Hello.

    It's actually quite frustrating, but I can't find a pattern that gives away what the problem is. I have tried downloading firmware to 3 other thermometers and have had problems on one of them (same as the first one for which the thread was opened). I can't say what the problem is because I have used the same system on all 6 and I have succeeded on 4 and failed on 2. The version of Tuya is the same (1.1.17), the version of cloudcutter used is the same, the ttl-usb driver is the same, ....
    At first I thought it was a MAC issue (I have 4 starting with 1c:90:ff and 2 with a8:80:55), but it doesn't match with the ones that have had problems.
    Now that I know the behavior, my method is as follows.
    1) try it with cloudcutter a couple of times.
    2) if it fails, open the thermometer and use ttl-usb driver and cables to download firmware.
    Sorry, but I can't offer any solution other than that.

    Saludos

    Added after 2 [minutes]:

    @p.kaczmarek2 , if you don't mind I will close this thread.

    Regards
  • Cloudcutter flashing sequence for BK7231N sensor

    #23 20608064
    jkwim
    Level 13  
    Posts: 186
    Help: 4
    Rate: 25
    minchutu wrote:
    First, thank you all for your help

    This is the sequence:



    sudo ./tuya-cloudcutter.sh
    [sudo] password for minchutu:
    Building cloudcutter docker image
    Sending build context to Docker daemon 23.18MB
    Step 1/10 : FROM python:3.9-slim-buster AS base
    ---> 954110adf96f
    Step 2/10 : RUN apt-get -qq update && apt-get install -qy --no-install-recommends git hostapd rfkill dnsmasq build-essential libssl-dev iproute2 mosquitto
    ---> Using cache
    ---> b3dcd8221715
    Step 3/10 : FROM base AS python-deps
    ---> b3dcd8221715
    Step 4/10 : RUN pip install --upgrade pipenv
    ---> Using cache
    ---> bcdb7816cdf0
    Step 5/10 : COPY src/Pipfile /src/
    ---> Using cache
    ---> e5b258010cfc
    Step 6/10 : COPY src/Pipfile.lock /src/
    ---> Using cache
    ---> 52da6d1b41e2
    Step 7/10 : RUN cd /src && PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
    ---> Using cache
    ---> e45e9a626ade
    Step 8/10 : FROM python-deps AS cloudcutter
    ---> e45e9a626ade
    Step 9/10 : COPY src /src
    ---> Using cache
    ---> 6a3be18d0fa6
    Step 10/10 : WORKDIR /src
    ---> Using cache
    ---> 73a318802cb0
    Successfully built 73a318802cb0
    Successfully tagged cloudcutter:latest
    Successfully built docker image
    1) Detach from the cloud and run Tuya firmware locally
    2) Flash 3rd Party Firmware
    [?] Select your desired operation [1/2]: 2
    Loading options, please wait...
    [?] Select your custom firmware file: OpenBK7231N_UG_1.15.635.bin
    > OpenBK7231N_UG_1.15.635.bin

    [?] How do you want to choose the device?: By firmware version and name
    By manufacturer/device name
    > By firmware version and name
    From device-profiles (i.e. custom profile)

    [?] Select the firmware version and name: 1.1.17 - BK7231N / oem_bk7231n_temp_hum_sensor
    1.1.0 - BK7231T / oem_bk7231s_curtain_switch_nuohua
    1.1.0 - BK7231T / oem_bk7231s_light5_sleepwake_random_globe
    1.1.0 - BK7231T / oem_bk7231s_rnd_switch
    1.1.1 - BK7231T / HYS_03_018_bk7231t_a4y9plclmzpct6ol
    1.1.1 - BK7231T / oem_bk7231s_light_ty_oldDp
    1.1.11 - BK7231N / oem_bk7231n_temp_hum_sensor
    > 1.1.17 - BK7231N / oem_bk7231n_temp_hum_sensor
    1.1.2 - BK7231N / oem_bk7231n_control_switch
    1.1.2 - BK7231T / oem_bk7231s_control_switch
    1.1.2 - BK7231T / oem_bk7231s_hailai_1_plug
    1.1.2 - BK7231T / oem_bk7231s_light_db
    1.1.2 - BK7231T / oem_bk7231s_light_ty
    1.1.2 - BK7231T / oem_bk7231s_rnd_switch

    [?] Select the brand of your device: Tuya Generic
    > Tuya Generic

    [?] Select the article number of your device: Temperature and Humidity Sensor v1.1.17
    > Temperature and Humidity Sensor v1.1.17

    Selected Device Slug: tuya-generic-temperature-and-humidity-sensor-v1.1.17
    Selected Profile: oem-bk7231n-temp-hum-sensor-1.1.17-sdk-2.3.1-40.00
    Selected Firmware: /work/custom-firmware/OpenBK7231N_UG_1.15.635.bin

    ================================================================================
    Place your device in AP (slow blink) mode. This can usually be accomplished by either:
    Power cycling off/on - 3 times and wait for the device to fast-blink, then repeat 3 more times. Some devices need 4 or 5 times on each side of the pause
    Long press the power/reset button on the device until it starts fast-blinking, then releasing, and then holding the power/reset button again until the device starts slow-blinking.
    See https://support.tuya.com/en/help/_detail/K9hut3w10nby8 for more information.
    ================================================================================

    Scanning for open Tuya SmartLife AP
    .............................
    Found access point name: "A-A1BC", trying to connect...
    Device 'wlp2s0' successfully activated with '14cb3162-ba10-402c-8a70-89ef237829df'.
    Connected to access point.
    Waiting 1 sec to allow device to set itself up...
    Running initial exploit toolchain...
    Exploit run, saved device config too!
    output=/work/configured-devices/obzM4Umou2nr.deviceconfig
    Saved device config in /work/configured-devices/obzM4Umou2nr.deviceconfig

    ================================================================================
    Power cycle and place your device in AP (slow blink) mode again. This can usually be accomplished by either:
    Power cycling off/on - 3 times and wait for the device to fast-blink, then repeat 3 more times. Some devices need 4 or 5 times on each side of the pause
    Long press the power/reset button on the device until it starts fast-blinking, then releasing, and then holding the power/reset button again until the device starts slow-blinking.
    See https://support.tuya.com/en/help/_detail/K9hut3w10nby8 for more information.
    ================================================================================

    Scanning for open Tuya SmartLife AP
    ...............................................
    Found access point name: "A-A1BC", trying to connect...
    Device 'wlp2s0' successfully activated with '14cb3162-ba10-402c-8a70-89ef237829df'.
    Connected to access point.
    Configured device to connect to 'cloudcutterflash'
    Device is connecting to 'cloudcutterflash' access point. Passphrase for the AP is 'abcdabcd' (without ')
    Checking UDP port 53... Occupied by dnsmasq with PID 2362.
    Port 53 is needed to resolve DNS queries
    Do you wish to terminate dnsmasq? [y/N] y
    Attempting to stop dnsmasq.service
    Checking UDP port 67... Available.
    Checking TCP port 80... Available.
    Checking TCP port 443... Available.
    Checking TCP port 1883... Occupied by mosquitto with PID 2293.
    Port 1883 is needed to run MQTT
    Do you wish to terminate mosquitto? [y/N] y
    Attempting to stop mosquitto.service
    Checking TCP port 8886... Available.
    Flashing custom firmware...

    ================================================================================
    Wait for up to 10-120 seconds for the device to connect to 'cloudcutterflash'. This script will then show the firmware upgrade requests sent by the device.
    ================================================================================

    Using WLAN adapter: wlp2s0
    Configuration file: /dev/stdin
    Using interface wlp2s0 with hwaddr ec:55:f9:53:d1:aa and ssid "cloudcutterflash"
    wlp2s0: interface state UNINITIALIZED->ENABLED
    wlp2s0: AP-ENABLED

    After that I got nothing else. I've tried:

    - wait for half an hour
    - EZ mode (quick blick)
    - AP mode (slow blink)
    - Use Tuya App trying to connect with the sensor

    I do not know what else to do.


    The fact that you get following line indicates that the device has been already declouded:
    Found access point name: "A-A1BC", trying to connect... 


    Access point changes from SmartLife-A1BC to A-A1BC when the initial exploit is successful.

    Are you sure that your 'cloudclutterflash' accesspoint is active at the following point:
    Quote:
    Using interface wlp2s0 with hwaddr ec:55:f9:53:d1:aa and ssid "cloudcutterflash"
    wlp2s0: interface state UNINITIALIZED->ENABLED
    wlp2s0: AP-ENABLED


    Also I have a concern about not seeing the following types of messages at this point indicating that the DHCP server is running in your setup:

    Quote:
    Jun 5 15:25:58 dnsmasq[15]: started, version 2.80 cachesize 150
    Jun 5 15:25:58 dnsmasq[15]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
    Jun 5 15:25:58 dnsmasq-dhcp[15]: DHCP, IP range 10.42.42.10 -- 10.42.42.40, lease time 12h
    Jun 5 15:25:58 dnsmasq-dhcp[15]: DHCP, sockets bound exclusively to interface wlan0
    Jun 5 15:25:58 dnsmasq[15]: read /etc/hosts - 5 addresses


    The previous message about port 53 not being available also might have a dependency here.

    If the DHCP server is not running, the device would not be able to successfully connect and proceed.

    Your issue may be not in the device but the server side.
  • DHCP server likely not the cause of intermittent failure

    #24 20608524
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    Thanks a lot @jkwin for your time and help.

    -The fact that you get following line indicates that the device has been already declouded:
    Code: text Expand Select all Copy to clipboard
    Found access point name: "A-A1BC", trying to connect...
    Access point changes from SmartLife-A1BC to A-A1BC when the initial exploit is successful.

    That's what happen the first time, but not the 5 time that came later

    - Are you sure that your 'cloudclutterflash' access point is active at the following point:
    Quote:
    Using interface wlp2s0 with hwaddr ec:55:f9:53:d1:aa and ssid "cloudcutterflash"
    wlp2s0: interface state UNINITIALIZED->ENABLED
    wlp2s0: AP-ENABLED

    100% sure
    BK7231 flashing sensor via tuya-cloudcutter, not connecting to network

    -Also I have a concern about not seeing the following types of messages at this point indicating that the DHCP server is running in your setup:
    Quote:
    Jun 5 15:25:58 dnsmasq[15]: started, version 2.80 cachesize 150
    Jun 5 15:25:58 dnsmasq[15]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
    Jun 5 15:25:58 dnsmasq-dhcp[15]: DHCP, IP range 10.42.42.10 -- 10.42.42.40, lease time 12h
    Jun 5 15:25:58 dnsmasq-dhcp[15]: DHCP, sockets bound exclusively to interface wlan0
    Jun 5 15:25:58 dnsmasq[15]: read /etc/hosts - 5 addresses

    I'd never seen such messages: nor the 2 times the operation went wrong neither the 4 times it run ok. The DHCP works great at router level with no issues so far. I understand that this is the way it works, or there's something I've forgot or misunderstood? Do I have anything to do with the DHCP service for the operation to run properly?

    - Your issue may be not in the device but the server side.

    You might be right, but why sometimes works and sometimes don't? Can you suggest any kind of trial or test I can do to find the "mystery"?

    Saludos.
  • Helpful post

    Tuya app workaround resumes cloudcutter flashing

    #25 20658238
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    I found this topic as I did run into the exact same issue with a Tuya Globe Fairy Lights kit

    https://www.aliexpress.com/item/1005004946026...order_list.order_list_main.113.21ef1802T0lCoU

    I have found that the following process works for me (assuming your device is already cut from Tuya and it has a new AP (not the original Tuya SmartLife AP)

    1. After your device gets stuck at the AP-ENABLED step - Just leave cloudcutter at the AP-ENABLED step (do not stop it, do not CTRL-C out if it - just leave it as it)
    2. On your phone remove the location permission for the Tuya app
    3. Start the Tuya app on your mobile phone
    4. Manually add a new device selecting the device type you have
    5. Put your device back into fast blinking pairing mode
    6. In the Tuya app add your device and follow the steps (confirm that is fast blinking etc)
    7. When it gets to the WIFI step - add cloudcutterflash as the WiFi name and abcdabcd as the password
    8. Let the Tuya app try and add the device. When the device is added the fast blinking (pairing mode) stops
    9. Go to your cloudcutter window and watch the logs - within a few minutes the update process will resume and the firmware will be successfully deployed to the device

    Hope this helps someone out there and it will stop devices being opened (and maybe damaged in the process) and flashed via serial/USB
  • Helpful post

    Tuya app workaround resumes cloudcutter flashing

    #26 20684785
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    CLOSED: Thank MnM1

    I found this topic as I did run into the exact same issue with a Tuya Globe Fairy Lights kit

    https://www.aliexpress.com/item/1005004946026...order_list.order_list_main.113.21ef1802T0lCoU

    (quote)
    I have found that the following process works for me (assuming your device is already cut from Tuya and it has a new AP (not the original Tuya SmartLife AP)

    1. After your device gets stuck at the AP-ENABLED step - Just leave cloudcutter at the AP-ENABLED step (do not stop it, do not CTRL-C out if it - just leave it as it)
    2. On your phone remove the location permission for the Tuya app
    3. Start the Tuya app on your mobile phone
    4. Manually add a new device selecting the device type you have
    5. Put your device back into fast blinking pairing mode
    6. In the Tuya app add your device and follow the steps (confirm that is fast blinking etc)
    7. When it gets to the WIFI step - add cloudcutterflash as the WiFi name and abcdabcd as the password
    8. Let the Tuya app try and add the device. When the device is added the fast blinking (pairing mode) stops
    9. Go to your cloudcutter window and watch the logs - within a few minutes the update process will resume and the firmware will be successfully deployed to the device

    Hope this helps someone out there and it will stop devices being opened (and maybe damaged in the process) and flashed via serial/USB
  • #27 20684795
    minchutu
    Level 5  
    Posts: 18
    Help: 1
    Rate: 2
    Solved

Topic summary

LABEL_AI_GENERATED
The discussion revolves around issues faced while flashing a BK7231 sensor using Tuya Cloudcutter. The user reports difficulties in connecting the sensor to their network after flashing, despite following the correct procedures. Various responses suggest checking the firmware version, ensuring the correct binary is used for the specific BK7231 model, and confirming that the cloudcutterflash access point is active. Some users recommend using a CH340 module for direct flashing if Cloudcutter fails. A successful workaround involves leaving the Cloudcutter at the AP-ENABLED step and manually adding the device through the Tuya app. The conversation highlights the importance of network settings, firmware compatibility, and troubleshooting steps for successful device integration.
AI summary based on the discussion. May contain errors.

FAQ LABEL_AI_GENERATED

TL;DR: 6 sensors were tested; “leave cloudcutter at AP-ENABLED” is the key workaround for BK7231N Tuya sensors stuck on cloudcutterflash. This FAQ helps OpenBK users fix cloudcutter flashing, DHCP, 2.4 GHz AP, RF partition, and CH340 serial fallback issues. [#20607470]

Why it matters: A stalled AP-ENABLED step can look like a dead sensor, but the thread shows recoverable software and setup causes.

Method Best use Thread result Main risk
tuya-cloudcutter No-open OTA flashing 4 of 6 sensors succeeded in one user’s batch Can stall at AP-ENABLED
CH340 serial flashing Recovery after cloudcutter failure Worked on the stubborn first sensor Requires opening the sensor
Tuya app assist Reconnecting to cloudcutterflash Reported as the closing workaround Must keep cloudcutter running

Key insight: If the device already changed from SmartLife-A1BC to A-A1BC, cloudcutter has likely declouded it. Do not stop at AP-ENABLED; force pairing to cloudcutterflash with password abcdabcd.

Quick Facts

  • Cloudcutter asked users to wait 10–120 seconds for the device to connect to cloudcutterflash, though one user waited 30 minutes without progress. [#20517744]
  • The cloudcutterflash access point used password abcdabcd and must be reachable as a 2.4 GHz WiFi network, not a 5 GHz endpoint. [#20518736]
  • Required service checks included UDP 53, UDP 67, TCP 80, TCP 443, TCP 1883, and TCP 8886 before firmware upload. [#20517744]
  • A successful example uploaded OpenBK7231N_App_UG_1.11.33.bin and reported firmware progress at 26%, 56%, 86%, and 98%. [#20530807]
  • In one batch, the same setup flashed 4 of 6 Tuya firmware 1.1.17 BK7231N thermometers; 2 required another approach. [#20607470]

How do I flash a BK7231N temperature and humidity sensor with tuya-cloudcutter and OpenBK7231N firmware?

Select third-party flashing, choose OpenBK7231N_UG_1.15.635.bin, then pick the BK7231N sensor profile.
  1. Run sudo ./tuya-cloudcutter.sh and choose option 2.
  2. Select firmware version 1.1.17 - BK7231N / oem_bk7231n_temp_hum_sensor.
  3. Put the sensor into slow-blink AP mode twice when cloudcutter requests it.
The thread’s log used the slug tuya-generic-temperature-and-humidity-sensor-v1.1.17 and SDK profile 2.3.1-40.00. [#20517744]

Why does tuya-cloudcutter get stuck at the “AP-ENABLED” step when waiting for a device to connect to “cloudcutterflash”?

It stalls because the device does not complete the connection to the temporary cloudcutterflash access point. The log stops after wlp2s0: AP-ENABLED, before upgrade endpoints appear. One suspected cause is server-side DHCP not starting. Another is the device failing to join the exposed AP. A working flash later showed endpoint messages within minutes after AP-ENABLED, including /v2/url_config and tuya.device.upgrade.get. [#20608064]

What should I do if a Tuya BK7231 sensor does not appear in my router DHCP list after flashing OpenBK firmware?

First connect to the OpenBK access point, then configure your WiFi inside OBK. A successful flash does not immediately mean the device joins your router. The user initially could not see the sensor in any DHCP list. Another participant clarified that after flashing, you must connect to the opbk WiFi AP and configure network credentials there. If the device still cannot join WiFi on BK7231N, use the RF partition clear option. [#20515812]

Which OpenBK binary should I choose for a Tuya device with a BK7231N or BK7231T chip?

Choose the OpenBK binary that exactly matches the chip family. Use a BK7231N build for BK7231N and a BK7231T build for BK7231T. The thread explicitly warns not to mix them. One failed-case log selected OpenBK7231N_UG_1.15.635.bin for a profile named BK7231N / oem_bk7231n_temp_hum_sensor, which is the correct family match. [#20515888]

What is the difference between BK7231N and BK7231T when flashing OpenBK7231 firmware?

BK7231N and BK7231T require different OpenBK firmware builds during flashing. The cloudcutter menu listed both families, including 1.1.17 - BK7231N / oem_bk7231n_temp_hum_sensor and several BK7231T profiles. Selecting the wrong binary can prevent a valid boot or working firmware. The practical rule is simple: match N to N and T to T. [#20517744]

What is tuya-cloudcutter and how does it flash Tuya devices without opening them?

“tuya-cloudcutter” is a flashing toolchain that disconnects supported Tuya devices from cloud firmware and serves a local OTA firmware update, using temporary WiFi, DNS, HTTP, HTTPS, and MQTT services instead of soldered serial access. The thread shows it creating a Docker image, exploiting the device, saving a .deviceconfig, then making the device join cloudcutterflash for firmware upload. [#20517744]

What is OpenBK7231 or OBK firmware used for on Tuya smart devices?

“OpenBK7231” is third-party firmware for BK7231-based Tuya smart devices that replaces the stock Tuya software, exposes local configuration, and can create an opbk WiFi AP after flashing for device setup. In the thread, users flashed OpenBK7231N_UG_1.15.635.bin and later configured devices without relying on Tuya cloud control. [#20515907]

How do I put a Tuya temperature and humidity sensor into AP slow-blink mode for cloudcutter?

Hold the reset button until fast blinking starts, release it, then hold again until slow blinking starts. Cloudcutter asks for this AP slow-blink mode twice. One working sequence used batteries: remove them, insert them again, hold for fast blinking, release, then hold again for slow blinking. The same post says cloudcutter may sit at cloudcutterflash for at least 1 minute before flashing begins. [#20530807]

Why does a Tuya device access point change from “SmartLife-A1BC” to “A-A1BC” during the cloudcutter process?

The AP name changes after the initial exploit successfully declouds the device. One participant stated that seeing A-A1BC means the device has already been cut from Tuya. The original Tuya-style AP appears as SmartLife-A1BC; after the exploit, cloudcutter finds A-A1BC. This is a progress sign, not a failure by itself. [#20608064]

How can I use the Tuya app to help a device connect to the “cloudcutterflash” WiFi network with password “abcdabcd”?

Leave cloudcutter running at AP-ENABLED, then use the Tuya app to push the cloudcutterflash WiFi details. Remove location permission from the Tuya app first. Manually add the device type, put the device into fast-blinking pairing mode, and enter SSID cloudcutterflash with password abcdabcd. When pairing stops blinking, return to cloudcutter; the firmware upload should resume within a few minutes. [#20658238]

What ports does tuya-cloudcutter need, and why can dnsmasq, systemd-resolved, or mosquitto block the flashing process?

Cloudcutter needs UDP 53, UDP 67, TCP 80, TCP 443, TCP 1883, and TCP 8886 available. The log says UDP 53 resolves DNS queries, and TCP 1883 runs MQTT. dnsmasq, systemd-resolved, or mosquitto can occupy these ports. Cloudcutter asked to terminate dnsmasq on port 53 and mosquitto on port 1883 before flashing. [#20517744]

What does “clear RF partition” mean in OpenBK or BK7231 Easy GUI Flasher, and when should I use it?

Use “clear RF partition” when a BK7231N device cannot connect to WiFi after flashing. A firmware contributor reported rare BK7231N cases where WiFi failed until clearing the RF partition through the OBK web app or BK7231 Easy GUI Flasher. The suspected cause was an RF calibration structure changed by Tuya and not compatible with the SDK. Use it only after normal WiFi setup fails. [#20529181]

Cloudcutter vs CH340 serial flashing — which method is better for recovering or flashing a stubborn BK7231N Tuya sensor?

Use cloudcutter first, then use CH340 serial flashing if the device repeatedly stalls. Cloudcutter avoids opening the sensor, and one user flashed 4 of 6 thermometers that way. CH340 succeeded on the first stubborn module after cloudcutter failed. The user’s final method was simple: try cloudcutter a couple of times; if it fails, open the thermometer and flash through a TTL-USB adapter. [#20607470]

Why do some identical Tuya firmware 1.1.17 BK7231N sensors flash with cloudcutter while others fail on the same setup?

The thread found no reliable pattern across identical firmware 1.1.17 BK7231N sensors. One user tested 6 thermometers with the same cloudcutter version, same TTL-USB driver, and same Tuya version. Four succeeded and two failed. MAC prefixes did not explain it: devices starting with 1c:90:ff and a8:80:55 did not match the failures consistently. [#20607470]

How can I power a Tuya temperature and humidity sensor from a DC converter instead of batteries while avoiding deep sleep issues?

Use a physical enclosure and DC converter integration, but plan for firmware deep sleep behavior. The original poster created a box to integrate a DC converter and shared a Thingiverse file, while noting they had forgotten about batteries and deep_sleep. The thread does not provide voltage, wiring, or regulator specifications. Treat the enclosure idea as mechanical guidance, not a complete electrical design. [#20515745]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT