logo elektroda
logo elektroda
X
logo elektroda

How to Enable SEND_POSTANDGET on BK7231N/T and Compile Custom Firmware

Tilator 318 8
ADVERTISEMENT
  • #1 21785828
    Tilator
    Level 11  
    I have several different paltforms. Mostly based on BK7231N/T but also others.

    It seems to be, I can run command sendPOST http://Router_name/Temp.php?Device_name and it does run the PHP code Temp.php on the router and passes parameter Device_name to it just fine. It works as expected and makes it possible to trigger cool things depending on what happens on the OpenBK device.

    But - it does only work by default on my ESP8266 device. The command seems to be commented out from other platforms I have.

    I would like to turn it on for the rest of them and I have a couple questions about it.

    I know there seems to be some documentation here: https://www.elektroda.com/news/news4033833.html but I did not quite understand how it is supposed to work.

    Do I download the github code on my own computer, edit it, and somehow make remote computer to compile the code on my own PC. Or how is it supposed to work?

    An other question is, the obk_config.h file has an exact section "PLATFORM_LN882H" and it has section "//#define ENABLE_SEND_POSTANDGET 1" to edit, but there seems not to be an an exact section for BK7231N or BK7231T. What should I edit to enable SEND_POSTANDGET for these two palforms?

    B.T.W: my Temp.php looks like this

    Code: PHP
    Log in, to see the code



    in case someone else would like to know. It's an OpenWRT router having PHP installed.
  • ADVERTISEMENT
  • #2 21785942
    p.kaczmarek2
    Moderator Smart Home
    There is no need to download anything. Just fork repository, edit obk_config.h and open a PR. It could even work without PR, but I am not sure, as I never tried it from the contributor side. @divadiow ?

    You need to make sure that the desired define exists in the target platform section. If that's not present, add it. So, if you want to have ENABLE_SEND_POSTANDGET on , let's say, BL602, you must find where BL602 section begins and add #define ENABLE_SEND_POSTANDGET 1 there.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #4 21786058
    Tilator
    Level 11  
    I made a fork.

    Then I changed header file even though I'm still not sure what section there is for BK7231N and *T devices. There isn't such section.

    If I now make a pull reguest, what exactly happens? It sounds like it does not start any compiling.

    I managed to make my first release, but it contains only two source code packages. Do I only need to wait now for it to compile or what?
  • ADVERTISEMENT
  • #5 21786114
    divadiow
    Level 37  
    Tilator wrote:
    There isn't such section.

    stick it under here

    https://github.com/divadiow/OpenBK7231T_App/blob/main/src/obk_config.h#L232C1-L232C21

    Tilator wrote:
    If I now make a pull reguest, what exactly happens? It sounds like it does not start any compiling.


    make a PR to the main repo and it should begin building under here https://github.com/openshwprojects/OpenBK7231T_App/actions

    or it'll sit needing admin approval. I'm not sure of the reasons why some people's PRs need approval and others don't. Maybe something @p.kaczmarek2 sets
  • #6 21786154
    p.kaczmarek2
    Moderator Smart Home
    This is the most lenient GitHub setting:
    Screenshot of GitHub fork pull request workflow approval settings


    Both T and N are under PLATFORM_BEKEN.
    Helpful post? Buy me a coffee.
  • #7 21786362
    Tilator
    Level 11  
    Thank you everybody. I'm amazed, I got it working!
  • #8 21787162
    p.kaczmarek2
    Moderator Smart Home
    So, is the POST/GET working for you now on futher platforms?

    And in general.... I think now you can agree, it's very easy to build OBK.
    Helpful post? Buy me a coffee.
  • #9 21787256
    Tilator
    Level 11  
    p.kaczmarek2 wrote:
    I think now you can agree, it's very easy to build OBK.


    Of course it was obviously easy. If you just know a few things on top of the documentation.

    For example it does not tell, if you make your own fork, you must make pull request from the original copy. Not from the copy you have done. I was not completely sure if it ruins something for everyone else while I make PR from the original and not from my own copy.

    I have compiled something like various kernel files and OpenWRT before. I knew what to expect happening next. For someone totally new it's a different ball game.

Topic summary

The discussion addresses enabling the SEND_POSTANDGET command on BK7231N/T platforms within the OpenBK firmware, which by default is active only on ESP8266 devices. To enable this feature on BK7231N/T and other platforms, users need to modify the obk_config.h file by adding or setting the define ENABLE_SEND_POSTANDGET to 1 in the appropriate platform section. Both BK7231N and BK7231T fall under the PLATFORM_BEKEN section in the configuration file. The recommended workflow involves forking the OpenBK7231T_App repository on GitHub, editing obk_config.h to include the define under the correct platform section, and then submitting a pull request (PR) to the main repository. Upon PR submission, the GitHub Actions CI system should automatically start compiling the firmware, although some PRs may require admin approval before building begins. Users can also perform minor edits directly via GitHub’s web interface, which creates a patch fork automatically. The compilation results can be monitored through the repository’s GitHub Actions page. This process allows custom firmware builds with SEND_POSTANDGET enabled on BK7231N/T devices, facilitating HTTP POST commands to trigger router-side PHP scripts with parameters.
Summary generated by the language model.
ADVERTISEMENT