logo elektroda
logo elektroda
X
logo elektroda

Testing OBK Config for Smaller Builds on OpenBK7231T - Feedback Needed

p.kaczmarek2 1749 65
ADVERTISEMENT
  • #31 21385195
    p.kaczmarek2
    Moderator Smart Home
    Mine is silent but PCB seems slightly bent and I wonder if it's broken already, or is it firmware or user (my) fault?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #32 21385201
    divadiow
    Level 34  
    flash then open port with log in same session HLK-W801-KIT

    Screenshot of Upgrade Tools V1.5.4 software with operational log.

    Added after 1 [minutes]:

    >>21385195
    doesn't sound good :(
  • #33 21385207
    max4elektroda
    Level 20  
    Iirc the logging was only visible on TX0 (PB19) - only when sending update over USB-C logging stopped and there was some "noise". I don't recall logging on the USB port.
    But @divadiow should have the same device ;-)

    Added after 2 [minutes]:

    p.kaczmarek2 wrote:
    PCB seems slightly bent

    Sorry to hear that. Probably it was not packed correctly during shipping :-(
  • ADVERTISEMENT
  • #35 21385223
    p.kaczmarek2
    Moderator Smart Home
    Huh, it seems the problem is solved accidentally, but I don't know how.

    I just plugged again board, only opened tools, and got that:
    User interface of software update tool with open log and settings.
    I didn't even flash, it's still flashed by wm_tool.exe
    However... it is still silent in Realterm?
    Screenshot of the RealTerm serial capture program.
    It died as soon as I stopped Upgrade Tools...
    With upgrade tools log open, it works:
    OpenW800_CDCE8EC7 user interface with navigation buttons.
    I just checked with multimeter and I can see that opening Realterm (Open port button) brings RESET from 3.3V to 0V, what's going on?
    Ah, I had to press here:
    Screenshot of RealTerm program showing terminal interface with connection data and RTS/DTR buttons.
    It seems that Realterm has played a trick on me, I didn't expect that. Does this particular board has somehow DTR/RTS role inverted or did this setting change on it's own in my Realterm?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #37 21385914
    p.kaczmarek2
    Moderator Smart Home
    So it seems my W800 board works. Thank you for sending it, @max4elektroda , as it's from you, unless my memory fails me...

    Now it's time for DHT test. I think it's a final thing I'll do before merging size PR:
    https://github.com/openshwprojects/OpenBK7231...mits/0094aa678b57c4855f5658c388e83977cb045a51

    Added after 46 [seconds]:

    Ok, so makefile needs update:
    Code: C / C++
    Log in, to see the code

    Did anyone run DHT on W800, actually?

    Added after 1 [minutes]:

    Ok:
    
    CSRCS += $(_SHARED_APP)/driver/drv_dht.c
    CSRCS += $(_SHARED_APP)/driver/drv_dht_internal.c
    


    Added after 9 [minutes]:

    Works:
    OpenW800_CDCE8EC7 interface screenshot displaying DHT11 sensor and system configuration information.
    Helpful post? Buy me a coffee.
  • #38 21385970
    max4elektroda
    Level 20  
    Yes, the board was from me, so I'm glad it's not broken.
    I tried DHT with W800 when I got my pack (thanks for the hint @p.kaczmarek2 ) but obviously didn't report back - and this was with the rtl changes, not the "smaller build".
  • #39 21386042
    divadiow
    Level 34  
    >>21385550

    updated to include BL602 with old partition layout/LFS
  • #40 21386335
    p.kaczmarek2
    Moderator Smart Home
    My BL602 knowledge is very rusty, and my BL602 dev board is still bricked. I really need to look into that someday...

    For now, I've tested DS18B20 with W800:
    Screenshot of OpenW800 interface showing sensor data
    Test setup:
    Breadboard with a module and electronic components
    DHT11 sensor module and DS18B20 thermometer on a breadboard.
    I think I forgot about something. HASS Discovery is not enabled on W800:
    Device configuration interface with setting options.
    I need to enable it in this PR before merging...

    Added after 10 [minutes]:

    Obviously, unresolved, gotta update makefile:
    
    ./bin/build/w800/lib/libuser.a(json_interface.o): In function `http_tasmota_json_status_TIM':
    (.text.unlikely.http_tasmota_json_status_TIM+0x8): undefined reference to `NTP_GetCurrentTime'
    ./bin/build/w800/lib/libuser.a(json_interface.o): In function `http_tasmota_json_status_TIM':
    (.text.unlikely.http_tasmota_json_status_TIM+0x8): relocation truncated to fit: R_CKCORE_PCREL_IMM26BY2 against undefined symbol `NTP_GetCurrentTime'
    ./bin/build/w800/lib/libuser.a(json_interface.o): In function `http_tasmota_json_status_TIM':
    (.text.unlikely.http_tasmota_json_status_TIM+0xe): undefined reference to `NTP_GetCurrentTimeWithoutOffset'
    ./bin/build/w800/lib/libuser.a(json_interface.o): In function `http_tasmota_json_status_TIM':
    (.text.unlikely.http_tasmota_json_status_TIM+0xe): relocation truncated to fit: R_CKCORE_PCREL_IMM26BY2 against undefined symbol `NTP_GetCurrentTimeWithoutOffset'
    collect2: error: ld returned 1 exit status
    


    Added after 14 [minutes]:


    NTP:
    Screenshot of the OpenW800 control panel displaying sensor information and configuration options.

    Added after 12 [minutes]:

    OpenW800 command tool interface with SSDP enabled.


    Window showing network device properties of OpenW800 on a Windows computer.

    Added after 21 [minutes]:

    Trying to get OpenWeatherMap to compile. What's that?
    Screenshot from Microsoft Visual Studio showing C source code related to the BL602 platform.
    I will try to sort out those includes as well in few moments.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #41 21386440
    divadiow
    Level 34  
    cool progress. It's a shame BL602 new SDK isn't the de-facto BL602 base already. Will these kind of fixes need doing again for that?
  • #42 21386446
    p.kaczmarek2
    Moderator Smart Home
    OWM:
    
    startDriver OpenWeatherMap
    // owm_setup lat long APIkey
    owm_setup 40.7128 -74.0060 REMOVEDMYKEYHERE
    setChannelType 6 Temperature_div10
    setChannelType 7 Humidity
    setChannelType 8 Pressure_div100
    // owm_channels temperature humidity pressure
    owm_channels 6 7 8
    // this will send a HTTP GET once
    owm_request
    

    The image shows a user interface for generating scripts for OpenWeatherMap with script text and sending log.
    All works:
    Screenshot of the OpenWeatherMap integration and sensor readings from DHT11 and DS18B20.

    Added after 3 [minutes]:

    divadiow wrote:
    It's a shame BL602 new SDK isn't the de-facto BL602 base already. Will these kind of fixes need doing again for that?

    Didn't one of our contributors already do the porting and was only waiting for final tests?
    https://www.elektroda.com/rtvforum/topic4024917-60.html#21376234
    @miegapele
    I need help with BL602, some testing and feedback would be great before we merge those changes... I mean BL602 SDK update for latest WiFi security, etc.

    Or if you are asking about my size changes? I think there should be no problems with merging @miegapele PR after we merge size changes, I didn't touch BL602-specific code.
    Helpful post? Buy me a coffee.
  • #43 21386458
    divadiow
    Level 34  
    p.kaczmarek2 wrote:
    I didn't touch BL602-specific code.

    ah ok ok. that answers that
  • #44 21386485
    p.kaczmarek2
    Moderator Smart Home
    New mail arrived, just in time:
    Two plastic bags with BMP280 and AHT20 sensors.

    Added after 1 [hours] 51 [minutes]:



    Testing I2C software
    Table showing pin configuration for electronic devices.
    OpenW800 command tool interface displaying I2C status.

    Added after 3 [minutes]:

    
    backlog stopDriver BMP280 ; startDriver BMP280 25 24 9 10 11 236
    

    Bad pins:
    OpenW800 tool interface with BMP280 driver information.
    Correct pins:
    Screenshot of OpenW800_CDCE8EC7 tool showing a command line interface with a command to the BMP280 driver.

    Added after 1 [minutes]:

    Screenshot of a control panel displaying BMP280 temperature and pressure data.

    Added after 4 [hours] 41 [minutes]:

    Merged, but you can still give feedback...
    Helpful post? Buy me a coffee.
  • #45 21387071
    max4elektroda
    Level 20  
    Thanks for merging.
    Made a fix for the DS1820 change made for W600 (post #28) in PR #1504
  • #46 21387076
    p.kaczmarek2
    Moderator Smart Home
    Thank you.

    I'm making Startup Command multiline now. If Scripting is enabled, startup will be run at script. I'm planning to merge it today, but if there is anything against it, let me know.
    Helpful post? Buy me a coffee.
  • #47 21387150
    max4elektroda
    Level 20  
    That will make backlog obsolete or at least nor needed for multiple commands?
    That's a good idea!
  • #48 21387167
    p.kaczmarek2
    Moderator Smart Home
    Backlog can still be used, no problem there. I really hope I won't break stuff. I need to maintain compatibility with previous versions. I also hope that running script from there won't cause stack overflow.

    For now, I'm struggling with a strange error:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1505
    Screenshot of compilation logs for the OpenBK7231T project in Ubuntu environment, ending with an error.
    This looks like a compiler bug, not a compile error. I'm checking step by step in separate PR what causes that:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1506
    Maybe I made some silly typo, but again, the error message is so confusing.

    Added after 47 [seconds]:

    .. wait, maybe it's the long name of binary that is at fault? That would be silly!

    Added after 28 [minutes]:

    It really works with shorter names:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1506

    Added after 8 [minutes]:

    Testing:
    Screenshot of the OBK_DevBoard_CB3S configuration panel with startup commands.
    Screenshot showing a log with information about channels and network settings.
    Helpful post? Buy me a coffee.
  • #49 21387246
    max4elektroda
    Level 20  
    p.kaczmarek2 wrote:
    For now, I'm struggling with a strange error:

    I think I remember having the same error once, but only on the online build while the same code was compiled fine locally. Maybe it was also a too long name for the image...
  • #50 21387301
    p.kaczmarek2
    Moderator Smart Home
    It works now, but now W800 binary is over 1MB and OTA is broken.
    It seems its' time to disable some stuff in W800 itself:
    Code: C / C++
    Log in, to see the code

    So W800 comes with TLS enabled? No wonder it's 900kB without OBK drivers.

    Added after 20 [minutes]:

    I got W800 binary from 1MB to 0.55MB:
    Screenshot of changes in the configuration file from source code.

    Added after 37 [seconds]:

    Here is test script:
    
    setChannel 30 0
    again:
    addChannel 30 1
    echo Hello $CH30
    delay_s 1
    goto again
    
    Helpful post? Buy me a coffee.
  • #51 21387414
    divadiow
    Level 34  
    p.kaczmarek2 wrote:
    So W800 comes with TLS enabled? No wonder it's 900kB without OBK drivers.

    oh wow

    p.kaczmarek2 wrote:
    I got W800 binary from 1MB to 0.55MB:


    that's a bit better!
  • #52 21387415
    max4elektroda
    Level 20  
    It's a good thing, W800 is going to be a platform like the others. I still remember the time when it was "OBK_DISABLE_ALL_DRIVERS" and I had to do many detours to make a driver working (don't recall if it was the clock or DS1820).
    Enough indulging the past.
    That's a huge step to decrease image size. Very good!
  • #53 21387492
    p.kaczmarek2
    Moderator Smart Home
    I forgot about waitFor. waitFor was broken on new platforms:
    Screenshot of a pull request on GitHub concerning a fix for the waitFor function.
    I need testing again. Can anyone check if the new "startup command" behaviour is the same as previous? I'm worried that we might get random stack overflow at some commands that I didn't test.

    Added after 36 [minutes]:

    I've found a problem.
    For this call:
    http://192.168.0.151/api/info
    JSON newlines of startup command has to be escaped.

    Added after 16 [minutes]:

    Another issue - crash.
    Steps to repro:
    - set long script in new textArea startup command
    - OTA to release
    -release crashes on boot:
    
    
    fo:MQTT:MQTT_RegisterCallback called for bT cmnd/w800s/ subT cmnd/w800s/+
    Info:MQTT:MQTT_RegisterCallback called for bT w800CDCE8EC7/ subT w800CDCE8EC7/+/
    ror:CMD:Too many args, skipped all after 32nd.                         
    fo:MAIN:Started DS1820.                                             
    fo:CMD:CMD_StartScript: failed to get file autoexec.bat                   
    fo:MAIN:Main_Init_After_Delay done
    fset:213923                                                                
    CPU Exception : 3                                                            
    r0: 00000017	   r1: 00000000	   r2: 2000aea0	   r3: 00000000	   r4: 00000017	  
    r5: 20000868	   r6: 2000ae9c	   r7: 2000aea5	   r8: 2000b4d4	   r9: 09090909	  
    r10: 10101010	  r11: 11111111	  r12: 0000004e	  r13: 200232d4	  r14: 200232a4	 
    r15: 080ecbdc	                                                              
    epsr: 80000341     
    

    In safe mode you can remove startup command and reboot.
    It works now again.

    It seems like current release W800 does not like long startup commands?
    Helpful post? Buy me a coffee.
  • #55 21387790
    p.kaczmarek2
    Moderator Smart Home
    Wait, I am adding security checks, you can test later today:
    Screenshot of Visual Studio with source code and diagnostics window open.
    The bad thing is that I still am not sure why W800 crashed when I first set long startup command in my PR, and then updated it to old Release. Still, it seems like a somewhat rare scenario, and it's easily recoverable in safe mode. Most likely I'll just ignore that, because who would first set long script and then downgrade to old version?

    Added after 46 [seconds]:

    Screenshot of WinTest_3145CAFF software interface with startup command.

    Added after 3 [hours] 34 [minutes]:

    Next change - not size related, but I'm adding:
    - HAL_PIN_Find (find pin obk index by string name)
    - Tokenizer_GetPin (parses pin by string name like RB8)
    For now implemented for W800 and W600.

    Added after 12 [minutes]:

    Excellent:
    Screenshot of the OpenW600_CD3E352F interface with command inputs.
    
    backlog stopDriver BMP280 ; startDriver BMP280 PB9 PB8 9 10 11 236
    


    W600 config:
    
    startDriver DS1820
    startDriver BMP280 PB9 PB8 9 10 11 236
    
    // wifi wait
    waitFor WiFiState 4
    startDriver OpenWeatherMap
    // owm_setup lat long APIkey
    owm_setup 40.7128 -74.0060 qqqqqqqqqqqqq
    setChannelType 6 Temperature_div10
    setChannelType 7 Humidity
    setChannelType 8 Pressure_div100
    // owm_channels temperature humidity pressure
    owm_channels 6 7 8
    owm_request
    
    
    setChannel 30 0
    again:
    addChannel 30 1
    echo Hello $CH30
    delay_s 1
    goto 
    

    OpenW600 interface screen with weather information and toggles.
    Helpful post? Buy me a coffee.
  • #56 21398800
    p.kaczmarek2
    Moderator Smart Home
    @divadiow can you give a quick check to this before I merge?
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1506
    at least on Beken
    Helpful post? Buy me a coffee.
  • #57 21398861
    divadiow
    Level 34  
    I only have BKN, BKT, TR, RTL8720CF modules with me until home tomorrow. What do you want to know - flashes, boots, multiline startup command to run 3 drivers perhaps?
  • #58 21399041
    p.kaczmarek2
    Moderator Smart Home
    Just do some random tests, it should work good.

    If you have Beken with UART programmer, try flashing my PR, then set some startup command (use my loop code?) and then flash back current release and see if it works or breaks
    Helpful post? Buy me a coffee.
  • #59 21399329
    divadiow
    Level 34  
    OK,

    so with this on BK-N with 1506_merge_3c730d0b6a77

    Code: Text
    Log in, to see the code


    you get all drivers starting and the looping echos
    Code: Text
    Log in, to see the code


    flash back to GA and this is the startup command content

    Code: Text
    Log in, to see the code


    and of course only ntp starts with that
    flash back to PR again and the startup command is back to multi-line, all drivers load and the loop runs

    Added after 43 [minutes]:

    RTL87X0C is the same up to the point where I've gone from PR->GA (with the exception of SSDP start - I guess this isn't enabled) but I can't finish with GA->PR to check multi-line is still present because sometimes this happens:

    OTA update window with invalid file selected for update.
    so you can't choose an OTA file. different browsers, incognito, device reboots, different APs (Wndows hotspot and real AP - both with internet) - at the moment OTA in console GUI isn't in place for RTL, which is usually the workaround.

    Message about the lack of OTA update implementation for OpenRTL87X0C
    Maybe it's something to do with PR builds #s? I think I've only ever seen it in testing. Not taken enough of a note to get a pattern for why.

    Anyway, that's a different thing. Also, I don't actually have BK-T with me at the moment, as previously stated.
  • #60 21399371
    p.kaczmarek2
    Moderator Smart Home
    This OTA problem is a known bug. This is because multiline startup command can have newline characters, also known as \n, but those characters should be escaped in JSON. And they are not escaped in JSON in older builds. So, the "get chip info" API call of Web App fails, so Web App is broken as long as you have old startup command line, so it doesn't know what the platform is and can't check OTA.

    Solution - remove startup commandline text and then do OTA. Does it work?
    Helpful post? Buy me a coffee.

Topic summary

Dyskusja dotyczy wprowadzenia mniejszych kompilacji w projekcie OpenBK7231T, w tym dodania nowych definicji do pliku obk_config.h, co pozwala na redukcję rozmiaru budowy. Użytkownicy omawiają możliwość wyłączenia niektórych stron HTML, sterowników LED oraz kodu wspólnego dla BL0942/BL0937. Testy wykazały, że nowa kompilacja osiąga rozmiar 388KB w porównaniu do 500KB w ostatnim publicznym wydaniu. Uczestnicy dyskusji dzielą się doświadczeniami z testowaniem różnych urządzeń, takich jak DHT, BL0942, oraz omawiają problemy związane z OTA i nowymi komendami startowymi. Wskazano również na potrzebę dalszych testów i integracji z innymi platformami.
Summary generated by the language model.
ADVERTISEMENT