Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BL602 code to work with latest sdk. #1487

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

giedriuslt
Copy link
Contributor

@giedriuslt giedriuslt commented Jan 1, 2025

This updates code so that BL602 works with latest sdk.
This has following advantages

  • It now can connect to WP2/WPA3 and mixed networks
  • Powersave now works (even with bl0937)

However,

  • It's bigger, I worked hard to remove unnecessary stuff, but still ends up 4 kb bigger than before
  • seems new sdk does not like github and does not build in there.

Tested:

  • OTA
  • Basic functions
  • BL0937
  • Mqtt

Not tested:

  • Everything else

@giedriuslt
Copy link
Contributor Author

Now it builds and looks working

@giedriuslt
Copy link
Contributor Author

Backported igmp and mqtt password fix, changed hostname to be OpenBL602_xxxxxxxx. Did some more cleanup.
Testing, hopefully it's good to merge

@ataa
Copy link
Contributor

ataa commented Jan 5, 2025

Thanks for this.
So the hostname is not hardcoded in this version and can be changed?

@giedriuslt
Copy link
Contributor Author

No, it's still hardcoded unfortunately, I just changed it to match the general pattern

@giedriuslt
Copy link
Contributor Author

Found another issue, version is not set, will fix later, trying to see how stable it is.

@giedriuslt
Copy link
Contributor Author

Seems to be rebooting every 1-2 days for me. Need to investigate more...

@r0bb10
Copy link

r0bb10 commented Jan 14, 2025

i can confirm it connects to my wpa2/3 wifi and works now

@MaxineMuster
Copy link
Contributor

Since you mentioned the size is even bigger than the "old" sdk, I recently found that disabling TLS will reduce the size about 100k :

-rwxr-xr-x 1 max max 793244 Jan 14 20:03 OpenBL602_dev_20250114_190155.bin
-rwxr-xr-x 1 max max 689300 Jan 14 20:06 OpenBL602_dev_20250114_190617.bin

The diff is simple:

diff --git a/components/network/lwip/lwip-port/config/lwipopts.h b/components/network/lwip/lwip-port/config/lwipopts.h
index 13b7546c..aa783a8e 100644
--- a/components/network/lwip/lwip-port/config/lwipopts.h
+++ b/components/network/lwip/lwip-port/config/lwipopts.h
@@ -26,8 +26,8 @@
 
 #define LWIP_NUM_NETIF_CLIENT_DATA      1
 
-#define LWIP_ALTCP                      1
-#define LWIP_ALTCP_TLS                  1
+//#define LWIP_ALTCP                      1
+//#define LWIP_ALTCP_TLS                  1
 /**
  * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
  * use lwIP facilities.

@giedriuslt
Copy link
Contributor Author

Yes disabling tls would be useful, we could enable more stuff for bl602. SendGet does not support tls even on bk7231. Unless we need that for mqtt? but probably there is no support for that either.

@MaxineMuster
Copy link
Contributor

I don't recall any usage of TLS in OpenBeken, so it should be safe to disable it. We might disable some more features/code to save some more space, but that will be harder in changing makefiles

@giedriuslt
Copy link
Contributor Author

I fixed the version string, and changed temp reading to use a new way from new sdk, which does not use wait loops. Now it's stable for 3 days already. So I think it's good yo merge now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants