logo elektroda
logo elektroda
X
logo elektroda

OpenBeken - Setting Up Static IP for BK7231 IoT Devices with Poor Signal Strength

jbrande 3024 20
Best answers

How do I set a static IP for an OpenBeken BK7231 device?

Set it in OpenBeken under Config → Configure IP, then enter the static IP, subnet mask, DNS, and gateway; make sure the address is not already in use or you will get an IP conflict [#20662501] If your router supports it, you can also leave OpenBeken on DHCP and reserve the device’s MAC address in the router instead [#20662501] For LN882H builds, static IP was previously broken and could show as "hu.hu.hu.hu", but the issue was fixed in newer builds; after updating to a build like 1.17.682, the device should boot on the configured static IP and keep it after OTA [#21212848] [#21220484] [#21220498]
Generated by the language model.
ADVERTISEMENT
  • #1 20662403
    jbrande
    Level 4  
    Posts: 25

    How can I set a static IP for devices that do not have a good signal?

    Thanks.
  • ADVERTISEMENT
  • #2 20662501
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Hello @jbrande ,
    to set the static IP in OpenBeken, first click Config:
    OpenBeken - Setting Up Static IP for BK7231 IoT Devices with Poor Signal Strength
    Then go to Configure IP:
    OpenBeken - Setting Up Static IP for BK7231 IoT Devices with Poor Signal Strength
    In Configure IP, enter your desired static IP, your mask, DNS and gateway:
    OpenBeken - Setting Up Static IP for BK7231 IoT Devices with Poor Signal Strength

    If you are not sure about the Mask, IP, etc, settings, you can check them on your router or on your PC machine (ipconfig command). Futhermore, please make sure that you are setting IP address that is not already reserved, otherwise you'd get an IP conflict.

    Alternatively, you can stick to DHCP setting on OpenBeken and just configure a MAC-based address reservation on your DHCP settings of your router.

    Let me know if you have any further questions or if something is not clear.[/b]
    Helpful post? Buy me a coffee.
  • #3 20662755
    jbrande
    Level 4  
    Posts: 25
    Wow sorry that i missed that
  • #4 20858176
    xtremmax31
    Level 1  
    Posts: 1

    >>20662501
    Hi,
    I may have used it wrongly. I did set an IP address 21.21.21.21 and let the rest default.
    Now the device is no longer connecting to the network. I think my router would not allow something different from 192.168.0.X
    So, I have tried to create the same network (hotspot) from a Linux trying to reach the device and go to the previous setting, but no luck in doing that.
    I don't think the device did successfully join the hotspot.

    I have tried as well powering down 5 times quickly hoping the OpenBk hotspot shows up again, but no new network showed up.

    Do you have any idea on how I could restore the device?

    Thank you very much for any help.
  • ADVERTISEMENT
  • #5 20858193
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    The safe mode should just work. I'd say it always worked for me, so far.

    Just keep in mind that devices may have large capacitors, so when you do power off, wait maybe even 5 seconds or so.
    So, do that 5 times:
    - power off
    - wait 5+seconds
    - power on
    - wait 2 or so seconds
    Do it 5 or maybe 6 times, and you should get OBK safe mode access point
    Helpful post? Buy me a coffee.
  • #6 21212667
    kodacy
    Level 5  
    Posts: 6
    >>20662501 Tried multiple times in different browsers and it always reverts back to original set DHCP IP. When I access the configure screen I always get this hu.hu.hu.hu on every line.

    Screenshot of the CozyLife Mini Smart Switch LN882H configuration screen with IP fields filled with hu.hu.hu.hu.

    Any idea on how to fix this issue on a LN882H.

    Thank you
  • #7 21212848
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    It seems that obkStaticIP_t is not currently used (implemented) for LN882H:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/hal/ln882h/hal_wifi_ln882h.c
    So it's a pending feature.
    Helpful post? Buy me a coffee.
  • #8 21216104
    kodacy
    Level 5  
    Posts: 6
    >>21212848 Thank you for highlighting this to me. I'll wait for the implementation.
  • #9 21219984
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    A first approach to implement this is in PR#1342.

    I first had to deal with the unknown "%hhu" in printf (generating the IPs like hu.hu.hu.hu) and ssccanf.
    Then setting an IP just didn't seem to work, and this turned out to be an implementation of the netif that will always use DHCP.

    So as a first try I simply made an extension to the call setting the IP, so afterwards we know IP was statically set and netif handling shall not use DHCP then. Seems simple and straightforward, but maybe there should be a more direct way to disable DHCP on an interface?

    So to test it, at the moment you can't simply take the artifacts from the PR but compile it on your own with the patch of SDK file.

    @p.kaczmarek2 can I do a PR for the SDK and then make this PR for the APP also including this other PR (to the SDK)?
    (I hope you get my question).
  • ADVERTISEMENT
  • #10 21220022
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Thank you! Please open PR in SDK and I will first apply SDK PR, and then you can try to update submodules on main module PR and we will see if it works.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #11 21220104
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    No problem.
    Made PR #17 for OpenLN882H for this.
    I introduced a global bool variable for this (g_STA_static_IP) which is set during STA setup (see latest commit on PR #1342)

    BTW: your update on pwm_toggler is failing on BL602 (doesn't know "fabs()" - maybe include math.h or use a replacement?)
    A very simple idea would be to compare the squares, which will be always positive - but to be honest, I don't know the actual range of the floats, so this might not work if you loose precision needed.

    Added after 1 [hours] 15 [minutes]:

    Thanks for including the SDK PR.
    I did a new checkout of my (OpenBK7231T_App-)PR and the change in SDK was present.
    Compiled a LN882H version and it works like expected ;-)
  • #12 21220266
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Thank you, merged. I didn't check it myself but I hope you've done it well. @divadiow may check later if he finds time.

    Btw, I see we have ESP support PR, would you be able to give it a go?
    Helpful post? Buy me a coffee.
  • #13 21220399
    divadiow
    Level 38  
    Posts: 4851
    Help: 421
    Rate: 854
    hmm. it'll give 4 ping responses from the static-set IP (192.168.1.223) but then it switches back to DHCP (192.168.1.163 in my case)

    Screen showing device information with build date, online time, MAC address, and chipset name.

    responses here after each reboot
    Screenshot of ping command results showing replies and availability errors.
  • #14 21220431
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Which version did you try? Maybe it's still built with the old SDK? This would in fact "overwrite" the static settings ...
    How does the config page look? Does it show correct IPs or still "hu.hu.hu.hu"?

    I just cloned the git and built a new version. and its working for me. Just to be sure, could you try this version?
    Attachments:
    • dev_20240909_130254.zip (753.87 KB) You must be logged in to download this attachment.
  • #16 21220452
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    I see. Looking at the logs, the OpenLN882H SDK is different:

    From git run:
      Submodule path 'sdk/OpenBL602': checked out 'e5769160cfc91a5fe36f040b3d5314e51eda3a28'
      From https://github.com/openshwprojects/OpenLN882H
       * branch            cc711f3166d8104e0f41d54f7873dcf99c07087c -> FETCH_HEAD
      Submodule path 'sdk/OpenLN882H': checked out 'cc711f3166d8104e0f41d54f7873dcf99c07087c'
      Submodule path 'sdk/OpenW600': checked out 'ad8f51d064a78465ec1845287cf19c3a24c655b8'
    


    From my build:
    
    Submodule path 'sdk/OpenBL602': checked out 'e5769160cfc91a5fe36f040b3d5314e51eda3a28'
    Submodule path 'sdk/OpenLN882H': checked out '8846bdaa303aa64cdb216dec168c2f7582471da2'
    Submodule path 'sdk/OpenW600': checked out 'ad8f51d064a78465ec1845287cf19c3a24c655b8'
    


    Added after 12 [minutes]:

    p.kaczmarek2 wrote:
    Btw, I see we have ESP support PR, would you be able to give it a go?

    I did, but sadly don't have some C devices to test - and it fails for ESP32 for me. Maybe the author gives a hint how to fix it (my device indeed have 4MB, which is needed, but only 2MB is configured) or he also adds S2/S3, than I can happily test with them ;-)
  • #17 21220484
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Helpful post? Buy me a coffee.
  • #18 21220498
    divadiow
    Level 38  
    Posts: 4851
    Help: 421
    Rate: 854
    all good with 1.17.682. After OTA it brought itself up on the preconfigured static IP and is staying there

    Network configuration interface with IP, mask, DNS, and gateway settings. Screenshot of a command prompt window pinging IP address 192.168.1.223 with response times between 1-5 ms.
  • #19 21220502
    max4elektroda
    Level 24  
    Posts: 745
    Help: 47
    Rate: 183
    Good to hear, thanks!
  • #20 21220503
    divadiow
    Level 38  
    Posts: 4851
    Help: 421
    Rate: 854
    great work!
  • #21 21221017
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Well I guess that we now await @kodacy 's feedback. I will ping him to make sure he got notification @kodacy
    Helpful post? Buy me a coffee.

Topic summary

✨ The discussion focuses on configuring static IP addresses for BK7231 IoT devices using OpenBeken, particularly in scenarios with poor signal strength. Users are guided through the process of setting a static IP via the OpenBeken interface, including entering the desired IP, subnet mask, DNS, and gateway. Issues arise when users attempt to set IPs outside their router's DHCP range, leading to connectivity problems. Suggestions include using DHCP with MAC address reservation as an alternative. Some users report difficulties with specific models like LN882H, where static IP functionality is not yet implemented. Ongoing development efforts are noted, with users discussing patches and updates to enable static IP settings effectively.
Generated by the language model.

FAQ

TL;DR: To set or recover static IP on OpenBeken, use Config → Configure IP; safe mode triggers after 5–6 power cycles, and “The safe mode should just work.” For BK7231/LN882H users troubleshooting poor signal or mis-set IPs. [Elektroda, p.kaczmarek2, post #20858193]

Why it matters: If a weak Wi‑Fi link or bad IP knocks your device offline, these steps restore control fast.

Quick Facts

How do I set a static IP in OpenBeken on BK7231/LN882H?

Open the device web UI. Click Config → Configure IP. Enter IP, subnet mask, DNS, and gateway. Choose an unused IP to prevent conflicts. If unsure, read these values from your router or run ipconfig on your PC. Save and reboot to apply. [Elektroda, p.kaczmarek2, post #20662501]

What should I enter for subnet mask, DNS, and gateway?

Use your LAN’s mask, gateway, and DNS shown in your router. On Windows, run ipconfig to see mask, gateway, and DNS. Pick an unused IP in the same subnet as your router. This avoids address conflicts and routing errors. [Elektroda, p.kaczmarek2, post #20662501]

I set a wrong IP and lost access. How do I recover the device?

Enter OBK Safe Mode to reconfigure. “The safe mode should just work.” Use this sequence:
  1. Power off the device and wait 5+ seconds.
  2. Power on and wait ~2 seconds.
  3. Repeat steps 1–2 five or six times until the OBK Safe Mode AP appears. Connect, open the UI, and fix the IP. [Elektroda, p.kaczmarek2, post #20858193]

The Safe Mode AP doesn’t appear. What timing works?

Some devices hold charge on large capacitors. After powering off, wait at least five seconds before the next power on. Repeat the cycle five or six times. The OBK safe mode access point should then broadcast for recovery. [Elektroda, p.kaczmarek2, post #20858193]

Can I avoid on‑device static settings and use my router instead?

Yes. Leave DHCP enabled on OpenBeken. In your router’s DHCP settings, create a MAC‑based reservation for the device. The router will always hand out the same IP without changing device settings. [Elektroda, p.kaczmarek2, post #20662501]

Why does the Configure IP page show “hu.hu.hu.hu”?

That display came from a printf/scanf format quirk (%hhu) and a netif implementation that always used DHCP. Update to a build including PR #1342 and the SDK patch. The fields will parse and display correctly. [Elektroda, max4elektroda, post #21219984]

Does OpenBeken on LN882H support static IP now?

Yes. After updates, users confirmed success. On version 1.17.682, the device booted on the preconfigured static IP and stayed there after OTA. [Elektroda, divadiow, post #21220498]

Was static IP on LN882H previously unavailable?

Earlier, obkStaticIP_t was not implemented for LN882H. Configure IP could not apply a static address there. It was tracked as a pending feature at that time. [Elektroda, p.kaczmarek2, post #21212848]

What does DHCP override look like on older LN882H builds?

One tester saw exactly four ping replies from the static IP, then the device switched to a DHCP‑assigned address. This indicated the previous behavior before fixes landed. [Elektroda, divadiow, post #21220399]

Which build confirmed the LN882H static‑IP fix?

OpenBeken 1.17.682 retained the configured static IP across reboots and OTA updates during user testing. Update to that or newer. [Elektroda, divadiow, post #21220498]

I updated but it still reverts—did I get the right build?

Verify your build includes the updated OpenLN882H SDK submodule. Some automated artifacts pulled an older SDK, missing the static‑IP persistence changes. Rebuild or flash newer artifacts. [Elektroda, max4elektroda, post #21220452]

How can I avoid IP conflicts when choosing a static IP?

Select an unused address within your LAN’s subnet. Confirm the mask, gateway, and DNS from your router or with ipconfig. Ensure the chosen IP is not reserved elsewhere to prevent conflicts. [Elektroda, p.kaczmarek2, post #20662501]
Generated by the language model.
ADVERTISEMENT