Closed shogsbro closed 8 years ago
I followed the code, and see it is looking for switch info in /etc/board.json
, which looks like this:
# cat /etc/board.json
{
"model": {
"id": "BTHOMEHUBV2B",
"name": "BTHOMEHUBV2B - BT Home Hub 2B"
},
"led": {
"wifi": {
"name": "wifi",
"type": "trigger",
"sysfs": "bthomehubv2b:blue:wireless",
"trigger": "phy0tpt"
},
"internet": {
"name": "internet",
"type": "netdev",
"sysfs": "bthomehubv2b:blue:broadband",
"device": "nas0",
"mode": "link tx rx"
}
},
"network": {
"lan": {
"ifname": "eth0",
"protocol": "static",
"macaddr": "00:21:04:da:4b:98"
},
"wan": {
"ifname": "nas0",
"protocol": "pppoe",
"macaddr": "00:21:04:da:4b:99"
}
},
"dsl": {
"atmbridge": {
"vpi": 1,
"vci": 32,
"encaps": "llc",
"payload": "bridged"
},
"modem": {
"type": "adsl",
"annex": "a",
"firmware": "\/lib\/firmware\/adsl.bin"
}
}
}
This looks to stem from this changeset by @jow- in reaction to this OpenWrt bug.
I'll try to work out what populates this file (and isn't adding the switch entries required).
So /etc/board.json
should be populated by /etc/board.d/02_network
, which is missing the switch section for BTHOMEHUBV2B
. Something like:
ucidef_add_switch "switch0" \
"1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5t@eth0"
I rebooted with this patch on my test router, but still see the same error. I then found this changeset by @blogic regarding /etc/board.json
, and the new config_generate
command to update the Luci configuration.
After saving the original files (/etc/board.json
, /etc/config/network
, /etc/config/system
) elsewhere, I ran config_generate
which regenerated those files.
Though the display looks funny (probably since the files do not match the running swconfig output), Luci no longer crashes. Woo-hoo!!!
It looks like the code protects itself from lacking data in /etc/board.json
:
if swc and topo then
I have not worked out how to output debugging info in LuCI code, but possibly this bug is caused by the defaulting to "eth0" at line 533 in this changeset by @jow-.
How to add a switch Xiaomi Redmi AC2100 Router (white)?
I built LEDE trunk for my HH2B last night, with full Luci. I copied switch configuration from here, and then see a Switch menu entry under Network.
When selected, I get this Lua error:
Here is relevant parts of
/etc/config/network
:Output from
swconfig dev eth0 show
:The switch configuration itself works as expected.