logo elektroda
logo elektroda
X
logo elektroda

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

jbrande 1941 20
ADVERTISEMENT
  • #1 20662403
    jbrande
    Level 3  

    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
    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 3  
    Wow sorry that i missed that
  • ADVERTISEMENT
  • #4 20858176
    xtremmax31
    Level 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.
  • #5 20858193
    p.kaczmarek2
    Moderator Smart Home
    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 3  
    >>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
    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.
  • ADVERTISEMENT
  • #8 21216104
    kodacy
    Level 3  
    >>21212848 Thank you for highlighting this to me. I'll wait for the implementation.
  • #9 21219984
    max4elektroda
    Level 20  
    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).
  • #10 21220022
    p.kaczmarek2
    Moderator Smart Home
    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.
  • #11 21220104
    max4elektroda
    Level 20  
    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
    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 34  
    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 20  
    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?
  • ADVERTISEMENT
  • #16 21220452
    max4elektroda
    Level 20  
    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
    Helpful post? Buy me a coffee.
  • #18 21220498
    divadiow
    Level 34  
    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.
  • #21 21221017
    p.kaczmarek2
    Moderator Smart Home
    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.
Summary generated by the language model.
ADVERTISEMENT