基于buildroot connman 网络管理工具的应用

发布时间 2024-01-08 13:25:43作者: LuckyBear0

快速了解connman的使用 可以参考:

https://www.jianshu.com/p/03aed25b96f7

ConnMan - ArchWiki (archlinux.org)

wifi配置文件的介绍:https://man.archlinux.org/man/connman-service.config.5#Security=

关于 wpa_supplicant -u 选项的说明   当buildroot配置了connman后 会自动使能 wpa_supplicant  的dbus接口 即支持-u选项,最好全量编译buildroot  我有遇到过  wpa_supplicant -u  支持后 依然报 Error /net/connman/technology/wifi: Not supported的错误

 

 启动wifi的ap功能:设置共享wifi

 示例: connmanctl  tether wifi on  wifi  123456789  2415 

 

报错如下: Error enabling wifi tethering: Not supported

 报错原因是内核不支持iptables的相关配置操作

按照网上的建议,启动了下面的配置选项:(主要是IP: Netfilter Configuration这个目录下的一些配置)

 

 

root@starcharge:/etc/connman# iptables -L -n -t nat

iptables v1.8.9 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)

Perhaps iptables or your kernel needs to be upgraded.

 

解决办法,参考:https://blog.csdn.net/qq_18804879/article/details/131856331

更新内核后需要重新编译wifi驱动,否则wifi 驱动加载会失败

Error enabling wifi tethering: Permission denied 没有使能wifi 执行:connmanctl enable wifi

 

执行成功的打印:

 

 

 

 

手机连接成功的打印:

 

 

 

后续关于connman其它的应用功能待开发