NetHubQuickBringup:修订间差异

来自Bouffalo Lab Docs
跳转到导航 跳转到搜索
张良留言 | 贡献
无编辑摘要
张良留言 | 贡献
Sync NetHub docs from local Markdown
 
(未显示同一用户的5个中间版本)
第1行: 第1行:
= NetHub 快速上手 =
= NetHub Quick Start =


本文档面向首次接触 NetHub 的客户,目标是尽快完成 device host 的 bringup。
This document is for customers who are using NetHub for the first time. The goal is to help you complete device and host bring-up as quickly as possible.
[[index.php?title=文件:Nethub_sdio_quickstart_demo.gif|链接=文件:Nethub_sdio_quickstart_demo.gif|NetHub SDIO 快速入门演示]]


== 1. 方案概览 ==
[[文件:Nethub_sdio_quickstart_demo.gif | NetHub SDIO Quick Start Demo]]


* 当前主路径是 '''SDIO'''
If you only care about the currently available solution, keep these points in mind:
* device 侧运行 <code>Wi-Fi backend(fhost / wl80211)+ lwIP</code>
* <code>nethub</code> 负责把 device 侧 Wi-Fi 能力桥接到 host
* 控制通道和 <code>USER virtual channel</code> 都承载在同一条 host link 上


当前生效目录:
* The current primary path is <code>SDIO</code>
* The device runs <code>Wi-Fi backend (fhost / wl80211) + lwIP</code>
* <code>nethub</code> bridges device-side Wi-Fi capabilities to the host
* The control channel and <code>USER virtual channel</code> both run on the same host link


* device
Active directories:
 
* device side
** <code>components/net/nethub</code>
** <code>components/net/nethub</code>
** <code>examples/wifi/nethub</code>
** <code>examples/wifi/nethub</code>
* host
* host side
** <code>bsp/common/msg_router/linux_host/kernel</code>
** <code>bsp/common/msg_router/linux_host/kernel</code>
** <code>bsp/common/msg_router/linux_host/userspace/nethub</code>
** <code>bsp/common/msg_router/linux_host/userspace/nethub</code>


== 2. Bringup 前先确认两项选择 ==
== 1. Confirm Two Choices Before Bring-Up ==


=== 2.1 选择 Wi-Fi backend ===
=== 1.1 Choose the Wi-Fi Backend ===


默认配置:
Default configuration:


* 不打开 <code>CONFIG_WL80211</code>
* <code>CONFIG_WL80211</code> is disabled
* 使用 <code>fhost</code>
* <code>fhost</code> is used


如果要切到 <code>wl80211</code>,在 <code>examples/wifi/nethub/defconfig</code> 中打开:
If you want to switch to <code>wl80211</code>, enable this option in <code>examples/wifi/nethub/defconfig</code>:


<syntaxhighlight lang="make">
<syntaxhighlight lang="makefile">
CONFIG_WL80211=y
CONFIG_WL80211=y
</syntaxhighlight>
</syntaxhighlight>


说明:
Notes:


* <code>fhost</code> <code>wl80211</code> 是二选一关系
* <code>fhost</code> and <code>wl80211</code> are mutually exclusive
* 当前 <code>nethub</code> 同时支持这两种 device Wi-Fi backend
* The current <code>nethub</code> implementation supports both device-side Wi-Fi backends


=== 2.2 选择控制通道 ===
=== 1.2 Choose the Control Channel ===


device host 需要匹配:
device and host settings must match:


{| class="wikitable"
{| class="wikitable"
! device 配置
! host 启动方式
|-
|-
| <code>CONFIG_NETHUB_AT_USE_VCHAN=n</code>
! device configuration !! host startup
| <code>./output/bflbwifid</code> <code>./output/bflbwifid -c tty -p /dev/ttyAT0</code>
|-
| <code>CONFIG_NETHUB_AT_USE_VCHAN=n</code> || <code>./output/bflbwifid</code> or <code>./output/bflbwifid -c tty -p /dev/ttyAT0</code>
|-
|-
| <code>CONFIG_NETHUB_AT_USE_VCHAN=y</code>
| <code>CONFIG_NETHUB_AT_USE_VCHAN=y</code> || <code>./output/bflbwifid -c vchan</code>
| <code>./output/bflbwifid -c vchan</code>
|}
|}


默认配置是:
The default configuration is:


<syntaxhighlight lang="make">
<syntaxhighlight lang="makefile">
CONFIG_NETHUB_AT_USE_VCHAN=n
CONFIG_NETHUB_AT_USE_VCHAN=n
</syntaxhighlight>
</syntaxhighlight>


即控制通道默认走 <code>TTY</code>
That means the control channel uses <code>TTY</code> by default.


补充说明:
Additional notes:


* host 侧会同时编入 <code>tty + vchan</code>
* The host side always builds both <code>tty + vchan</code>
* 实际选择发生在 <code>bflbwifid</code> 运行时
* The actual selection happens at <code>bflbwifid</code> runtime


== 3. 编译并烧录 device 固件 ==
== 2. Build and Flash the Device Firmware ==


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第83行: 第82行:
</syntaxhighlight>
</syntaxhighlight>


烧录示例:
Flash example:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第90行: 第89行:
</syntaxhighlight>
</syntaxhighlight>


常见关键配置:
The most relevant bring-up configuration is located in:
 
* <code>examples/wifi/nethub/defconfig</code>
 
Common options:


* <code>CONFIG_NETHUB=y</code>
* <code>CONFIG_NETHUB=y</code>
第98行: 第101行:
* <code>CONFIG_NETHUB_AT_USE_VCHAN=n</code>
* <code>CONFIG_NETHUB_AT_USE_VCHAN=n</code>


== 4. 编译并启动 host 软件 ==
== 3. Build and Start the Host Software ==


=== 4.1 编译 ===
=== 3.1 Build ===


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第107行: 第110行:
</syntaxhighlight>
</syntaxhighlight>


产物:
Artifacts:


* <code>output/mr_sdio.ko</code>
* <code>output/mr_sdio.ko</code>
第115行: 第118行:
* <code>output/nethub_vchan_app</code>
* <code>output/nethub_vchan_app</code>


=== 4.2 加载内核模块 ===
=== 3.2 Load the Kernel Module ===


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第122行: 第125行:
</syntaxhighlight>
</syntaxhighlight>


如需卸载:
To unload:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第128行: 第131行:
</syntaxhighlight>
</syntaxhighlight>


=== 4.3 启动 host daemon ===
=== 3.3 Start the Host Daemon ===


默认 TTY 模式:
Default TTY mode:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第136行: 第139行:
</syntaxhighlight>
</syntaxhighlight>


显式指定 TTY:
Explicit TTY mode:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第142行: 第145行:
</syntaxhighlight>
</syntaxhighlight>


VCHAN 模式:
VCHAN mode:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第148行: 第151行:
</syntaxhighlight>
</syntaxhighlight>


== 5. 基础验证流程 ==
== 4. Basic Verification Flow ==


建议按下面顺序验证:
Recommended sequence:


=== 5.1 查看状态 ===
=== 4.1 Check the Current Status ===


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第158行: 第161行:
</syntaxhighlight>
</syntaxhighlight>


=== 5.2 扫描 AP ===
=== 4.2 Scan APs ===


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第164行: 第167行:
</syntaxhighlight>
</syntaxhighlight>


=== 5.3 连接 AP ===
=== 4.3 Connect to an AP ===


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第170行: 第173行:
</syntaxhighlight>
</syntaxhighlight>


=== 5.4 再次查看状态 ===
=== 4.4 Check Status Again ===


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第176行: 第179行:
</syntaxhighlight>
</syntaxhighlight>


如果连接成功,通常可以看到:
If the connection succeeds, you will usually see:


* backend 已连接
* the backend is connected
* Wi-Fi 状态为 <code>CONNECTED</code> <code>GOTIP</code>
* the Wi-Fi state is <code>CONNECTED</code> or <code>GOTIP</code>
* 获取到地址后显示 <code>IP / Gateway / Netmask / DNS</code>
* <code>IP / Gateway / Netmask / DNS</code> after an address is assigned


=== 5.5 断开连接 ===
=== 4.5 Disconnect ===


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第188行: 第191行:
</syntaxhighlight>
</syntaxhighlight>


== 6. 常用命令 ==
== 5. Common Commands ==


当前公共命令固定为 9 条:
The public CLI surface is fixed to 9 commands:


* <code>connect_ap</code>
* <code>connect_ap</code>
第202行: 第205行:
* <code>stop_ap</code>
* <code>stop_ap</code>


== 7. SDIO 硬件信息 ==
Examples:
 
<syntaxhighlight lang="bash">
sudo ./output/bflbwifictrl version
sudo ./output/bflbwifictrl reboot
sudo ./output/bflbwifictrl start_ap "<ssid>" "<password>"
sudo ./output/bflbwifictrl stop_ap
</syntaxhighlight>
 
== 6. SDIO Hardware Information ==


当前客户 bringup 路径建议直接按 <code>SDIO</code> 使用。
For the current customer bring-up path, use <code>SDIO</code> directly. <code>USB / SPI</code> still keep architecture skeletons for now and are not the recommended bring-up path.
<code>USB / SPI</code> 目前仍保留架构骨架,不作为当前推荐 bringup 路径。


=== 7.1 芯片支持情况 ===
=== 6.1 Chip Support Matrix ===


{| class="wikitable"
{| class="wikitable"
! 接口类型
! BL616 / BL618
! BL618DG
! BL616CL
|-
|-
| SDIO
! Interface !! BL616 / BL618 !! BL618DG !! BL616CL
| 支持
| 支持
| 支持
|-
|-
| USB
| SDIO || Supported || Supported || Supported
| 规划中
| 规划中
| 规划中
|-
|-
| SPI
| USB || Planned || Planned || Planned
| 规划中
|-
| 规划中
| SPI || Planned || Planned || Planned
| 规划中
|}
|}


=== 7.2 SDIO 引脚 ===
=== 6.2 SDIO Pins ===


{| class="wikitable"
{| class="wikitable"
! 功能引脚
! BL616 / BL618
! BL618DG
! BL616CL
|-
|-
| SDIO_DAT2
! Pin Function !! BL616 / BL618 !! BL618DG !! BL616CL
| GPIO10
|-
| GPIO43
| SDIO_DAT2 || GPIO10 || GPIO43 || GPIO6
| GPIO6
|-
|-
| SDIO_DAT3
| SDIO_DAT3 || GPIO11 || GPIO44 || GPIO7
| GPIO11
| GPIO44
| GPIO7
|-
|-
| SDIO_CMD
| SDIO_CMD || GPIO12 || GPIO45 || GPIO8
| GPIO12
| GPIO45
| GPIO8
|-
|-
| SDIO_CLK
| SDIO_CLK || GPIO13 || GPIO46 || GPIO9
| GPIO13
| GPIO46
| GPIO9
|-
|-
| SDIO_DATA0
| SDIO_DATA0 || GPIO14 || GPIO47 || GPIO10
| GPIO14
| GPIO47
| GPIO10
|-
|-
| SDIO_DATA1
| SDIO_DATA1 || GPIO15 || GPIO48 || GPIO11
| GPIO15
| GPIO48
| GPIO11
|}
|}


== 8. USER Virtual Channel ==
== 7. USER Virtual Channel ==
 
If you need to transfer private messages between the host and device, use the <code>USER virtual channel</code>.


如果客户需要在 host 与 device 之间传输私有消息,可使用 <code>USER virtual channel</code>。
Notes:


说明:
* The <code>USER</code> channel and the control channel are parallel logical channels
* It is not a separate physical interface; it is a logical channel carried on the current host link


* <code>USER</code> 通道和控制通道是并列关系
=== 7.1 device-side APIs ===
* 它不是独立物理接口,而是承载在当前 host link 上的逻辑通道


device 侧头文件:
Header:


* <code>components/net/nethub/include/nethub_vchan.h</code>
* <code>components/net/nethub/include/nethub_vchan.h</code>


host 侧头文件:
Common APIs:
 
<syntaxhighlight lang="c">
int nethub_vchan_user_send(const void *data, uint16_t len);
int nethub_vchan_user_recv_register(nethub_vchan_recv_cb_t recv_cb, void *cb_arg);
</syntaxhighlight>
 
=== 7.2 host-side APIs ===
 
Header:


* <code>bsp/common/msg_router/linux_host/userspace/nethub/virtualchan/nethub_vchan.h</code>
* <code>bsp/common/msg_router/linux_host/userspace/nethub/virtualchan/nethub_vchan.h</code>


更多说明见 [[NetHubVirtualChannel|NetHub USER Virtual Channel]]。
Common APIs:


== 9. 常见问题 ==
<syntaxhighlight lang="c">
int nethub_vchan_init(void);
int nethub_vchan_deinit(void);


=== 9.1 <code>bflbwifid</code> 启动失败 ===
int nethub_vchan_user_send(const void *data, size_t len);
int nethub_vchan_user_register_callback(nethub_vchan_recv_callback_t callback);


优先检查:
int nethub_vchan_get_state_snapshot(nethub_vchan_state_snapshot_t *snapshot);
</syntaxhighlight>
 
Typical host-side usage order:
 
# <code>nethub_vchan_init()</code>
# <code>nethub_vchan_user_register_callback()</code>
# <code>nethub_vchan_user_send()</code>
# Call <code>nethub_vchan_deinit()</code> when finished
 
If you need to check whether the link is ready, you can optionally query:
 
* <code>link_state == NETHUB_VCHAN_LINK_UP</code>
** the link is ready for TX/RX
* <code>host_state == NETHUB_VCHAN_HOST_STATE_DEVICE_RUN</code>
** the host has completed the handshake with the device
 
== 8. Common Issues ==
 
=== 8.1 <code>bflbwifid</code> Fails to Start ===
 
Check first:
 
* whether the device and host control backends match
* whether <code>/dev/ttyAT0</code> exists
* whether <code>mr_sdio.ko</code> has been loaded successfully
* whether the SDIO hardware link is working properly


* device 和 host 的控制 backend 是否匹配
=== 8.2 <code>connect_ap</code> Succeeds but the Host Has No Network Access ===
* <code>/dev/ttyAT0</code> 是否存在
* <code>mr_sdio.ko</code> 是否已经成功加载
* SDIO 硬件链路是否正常


=== 9.2 <code>connect_ap</code> 成功但 host 没有网络 ===
Check first:


优先检查:
* whether <code>status</code> has reached <code>GOTIP</code>
* whether <code>mr_eth0</code> has an address
* whether services such as <code>NetworkManager</code> or <code>dhcpcd</code> override the NetHub configuration


* <code>status</code> 是否已经进入 <code>GOTIP</code>
Notes:
* <code>mr_eth0</code> 是否已经获取地址
* 系统里的 <code>NetworkManager</code>、<code>dhcpcd</code> 等服务是否覆盖了 NetHub 配置


说明:
* <code>build.sh</code> builds userspace with <code>ENABLE_NETIF_AUTO_CONFIG=1</code> by default
* After the device reports <code>GOTIP</code>, the host automatically configures the IP, gateway, and DNS of <code>mr_eth0</code>


* <code>build.sh</code> 默认以 <code>ENABLE_NETIF_AUTO_CONFIG=1</code> 编译 userspace
=== 8.3 <code>build.sh unload</code> Reports That the Module Is Busy ===
* device 上报 <code>GOTIP</code> 后,host 会自动配置 <code>mr_eth0</code> 的 IP、网关和 DNS


=== 9.3 <code>build.sh unload</code> 提示模块被占用 ===
Check first:


优先确认:
* whether <code>bflbwifid</code> is still running
* whether <code>nethub_vchan_app</code> is still running


* 是否还有 <code>bflbwifid</code> 正在运行
=== 8.4 How Do I Change the Host-Side Virtual Interface Name <code>mr_eth0</code>? ===
* 是否还有 <code>nethub_vchan_app</code> 正在运行


通常直接执行:
The default host-side virtual network interface name comes from <code>bsp/common/msg_router/linux_host/kernel/netdev/mr_netdev.c</code>:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="c">
sudo ./build.sh unload
#define ETH_DRV_NAME "mr_eth%d"
</syntaxhighlight>
</syntaxhighlight>


脚本会先尝试停止已知持有者,再执行卸载。
The first created interface therefore appears as <code>mr_eth0</code>.
 
To change the interface name, update <code>ETH_DRV_NAME</code> to the pattern you want. For example:
 
<syntaxhighlight lang="c">
#define ETH_DRV_NAME "nethub%d"
</syntaxhighlight>


== 10. 延伸阅读 ==
Notes:


* [[NetHubArchitecture|NetHub 架构说明]]
* Keep <code>%d</code> if you want Linux to allocate names such as <code>nethub0</code>, <code>nethub1</code>, and so on
* [[NetHubVirtualChannel|NetHub USER Virtual Channel]]
* Rebuild the host software after the change and reload the host-side kernel module
* If any local scripts or service configuration still refer to <code>mr_eth0</code>, update them accordingly

2026年3月31日 (二) 00:14的最新版本

NetHub Quick Start

This document is for customers who are using NetHub for the first time. The goal is to help you complete device and host bring-up as quickly as possible.

NetHub SDIO Quick Start Demo

If you only care about the currently available solution, keep these points in mind:

  • The current primary path is SDIO
  • The device runs Wi-Fi backend (fhost / wl80211) + lwIP
  • nethub bridges device-side Wi-Fi capabilities to the host
  • The control channel and USER virtual channel both run on the same host link

Active directories:

  • device side
    • components/net/nethub
    • examples/wifi/nethub
  • host side
    • bsp/common/msg_router/linux_host/kernel
    • bsp/common/msg_router/linux_host/userspace/nethub

1. Confirm Two Choices Before Bring-Up

1.1 Choose the Wi-Fi Backend

Default configuration:

  • CONFIG_WL80211 is disabled
  • fhost is used

If you want to switch to wl80211, enable this option in examples/wifi/nethub/defconfig:

CONFIG_WL80211=y

Notes:

  • fhost and wl80211 are mutually exclusive
  • The current nethub implementation supports both device-side Wi-Fi backends

1.2 Choose the Control Channel

device and host settings must match:

device configuration host startup
CONFIG_NETHUB_AT_USE_VCHAN=n ./output/bflbwifid or ./output/bflbwifid -c tty -p /dev/ttyAT0
CONFIG_NETHUB_AT_USE_VCHAN=y ./output/bflbwifid -c vchan

The default configuration is:

CONFIG_NETHUB_AT_USE_VCHAN=n

That means the control channel uses TTY by default.

Additional notes:

  • The host side always builds both tty + vchan
  • The actual selection happens at bflbwifid runtime

2. Build and Flash the Device Firmware

cd examples/wifi/nethub

# BL616
make CHIP=bl616 BOARD=bl616dk

# BL616CL
make CHIP=bl616cl BOARD=bl616cldk

# BL618DG
make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap

Flash example:

cd examples/wifi/nethub
make flash CHIP=bl618dg COMX=/dev/ttyUSB0

The most relevant bring-up configuration is located in:

  • examples/wifi/nethub/defconfig

Common options:

  • CONFIG_NETHUB=y
  • CONFIG_MR_NETDEV=y
  • CONFIG_MR_TTY=y
  • CONFIG_MR_VIRTUALCHAN=y
  • CONFIG_NETHUB_AT_USE_VCHAN=n

3. Build and Start the Host Software

3.1 Build

cd bsp/common/msg_router/linux_host/userspace/nethub
./build.sh build

Artifacts:

  • output/mr_sdio.ko
  • output/bflbwifid
  • output/bflbwifictrl
  • output/libnethub_vchan.a
  • output/nethub_vchan_app

3.2 Load the Kernel Module

cd bsp/common/msg_router/linux_host/userspace/nethub
sudo ./build.sh load

To unload:

sudo ./build.sh unload

3.3 Start the Host Daemon

Default TTY mode:

sudo ./output/bflbwifid

Explicit TTY mode:

sudo ./output/bflbwifid -c tty -p /dev/ttyAT0

VCHAN mode:

sudo ./output/bflbwifid -c vchan

4. Basic Verification Flow

Recommended sequence:

4.1 Check the Current Status

sudo ./output/bflbwifictrl status

4.2 Scan APs

sudo ./output/bflbwifictrl scan

4.3 Connect to an AP

sudo ./output/bflbwifictrl connect_ap "<ssid>" "<password>"

4.4 Check Status Again

sudo ./output/bflbwifictrl status

If the connection succeeds, you will usually see:

  • the backend is connected
  • the Wi-Fi state is CONNECTED or GOTIP
  • IP / Gateway / Netmask / DNS after an address is assigned

4.5 Disconnect

sudo ./output/bflbwifictrl disconnect

5. Common Commands

The public CLI surface is fixed to 9 commands:

  • connect_ap
  • disconnect
  • scan
  • status
  • version
  • reboot
  • ota
  • start_ap
  • stop_ap

Examples:

sudo ./output/bflbwifictrl version
sudo ./output/bflbwifictrl reboot
sudo ./output/bflbwifictrl start_ap "<ssid>" "<password>"
sudo ./output/bflbwifictrl stop_ap

6. SDIO Hardware Information

For the current customer bring-up path, use SDIO directly. USB / SPI still keep architecture skeletons for now and are not the recommended bring-up path.

6.1 Chip Support Matrix

Interface BL616 / BL618 BL618DG BL616CL
SDIO Supported Supported Supported
USB Planned Planned Planned
SPI Planned Planned Planned

6.2 SDIO Pins

Pin Function BL616 / BL618 BL618DG BL616CL
SDIO_DAT2 GPIO10 GPIO43 GPIO6
SDIO_DAT3 GPIO11 GPIO44 GPIO7
SDIO_CMD GPIO12 GPIO45 GPIO8
SDIO_CLK GPIO13 GPIO46 GPIO9
SDIO_DATA0 GPIO14 GPIO47 GPIO10
SDIO_DATA1 GPIO15 GPIO48 GPIO11

7. USER Virtual Channel

If you need to transfer private messages between the host and device, use the USER virtual channel.

Notes:

  • The USER channel and the control channel are parallel logical channels
  • It is not a separate physical interface; it is a logical channel carried on the current host link

7.1 device-side APIs

Header:

  • components/net/nethub/include/nethub_vchan.h

Common APIs:

int nethub_vchan_user_send(const void *data, uint16_t len);
int nethub_vchan_user_recv_register(nethub_vchan_recv_cb_t recv_cb, void *cb_arg);

7.2 host-side APIs

Header:

  • bsp/common/msg_router/linux_host/userspace/nethub/virtualchan/nethub_vchan.h

Common APIs:

int nethub_vchan_init(void);
int nethub_vchan_deinit(void);

int nethub_vchan_user_send(const void *data, size_t len);
int nethub_vchan_user_register_callback(nethub_vchan_recv_callback_t callback);

int nethub_vchan_get_state_snapshot(nethub_vchan_state_snapshot_t *snapshot);

Typical host-side usage order:

  1. nethub_vchan_init()
  2. nethub_vchan_user_register_callback()
  3. nethub_vchan_user_send()
  4. Call nethub_vchan_deinit() when finished

If you need to check whether the link is ready, you can optionally query:

  • link_state == NETHUB_VCHAN_LINK_UP
    • the link is ready for TX/RX
  • host_state == NETHUB_VCHAN_HOST_STATE_DEVICE_RUN
    • the host has completed the handshake with the device

8. Common Issues

8.1 bflbwifid Fails to Start

Check first:

  • whether the device and host control backends match
  • whether /dev/ttyAT0 exists
  • whether mr_sdio.ko has been loaded successfully
  • whether the SDIO hardware link is working properly

8.2 connect_ap Succeeds but the Host Has No Network Access

Check first:

  • whether status has reached GOTIP
  • whether mr_eth0 has an address
  • whether services such as NetworkManager or dhcpcd override the NetHub configuration

Notes:

  • build.sh builds userspace with ENABLE_NETIF_AUTO_CONFIG=1 by default
  • After the device reports GOTIP, the host automatically configures the IP, gateway, and DNS of mr_eth0

8.3 build.sh unload Reports That the Module Is Busy

Check first:

  • whether bflbwifid is still running
  • whether nethub_vchan_app is still running

8.4 How Do I Change the Host-Side Virtual Interface Name mr_eth0?

The default host-side virtual network interface name comes from bsp/common/msg_router/linux_host/kernel/netdev/mr_netdev.c:

#define ETH_DRV_NAME "mr_eth%d"

The first created interface therefore appears as mr_eth0.

To change the interface name, update ETH_DRV_NAME to the pattern you want. For example:

#define ETH_DRV_NAME "nethub%d"

Notes:

  • Keep %d if you want Linux to allocate names such as nethub0, nethub1, and so on
  • Rebuild the host software after the change and reload the host-side kernel module
  • If any local scripts or service configuration still refer to mr_eth0, update them accordingly