-
-
Notifications
You must be signed in to change notification settings - Fork 113
Improve get node status results #974
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
Improve get node status results #974
Conversation
It splits get node status logic into multiple functions to make the code more redeable
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #974 +/- ##
==========================================
+ Coverage 77.71% 78.82% +1.10%
==========================================
Files 52 53 +1
Lines 4362 4415 +53
==========================================
+ Hits 3390 3480 +90
+ Misses 972 935 -37
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
packages/ubus-lime-utils/files/usr/lib/lua/lime/node_status.lua
Outdated
Show resolved
Hide resolved
|
Hey @selankon I was going to compile an image including these commits but I just wanted to make you notice that some unit tests are failing: https://github.com/libremesh/lime-packages/actions/runs/4083046792/jobs/7038111305 |
|
I want to change the: {
"signal": "-18 [-22, -21] dBm"
}To {
"signal": -18,
"chains": [-22, -21]
}I'm working on the regex to fix this |
91dc5b1 to
30e991a
Compare
|
What happens if DSA is in place rather than swconfig? |
|
Hi Ila!
Won't be a problem, the code will be updated easily. At the time DSA is implemented and we can test it, I will write the needed code to use it. When it arrive we'll check. At first moment we thought to use DSA directly, but this implementation will work on any router right now. And probebly, when DSA comes in, we can add an
If you do that I could start playing and preparing a PR to advance work :) |
Helooo!
Well, I would say that DSA is already here: If you check the modern routers, for example from here https://openwrt.org/toh/views/toh_extended_all?datasrt=target&dataflt%5BAvailability%2A~%5D=2023 and compare with the DSA targets list you will see that most of them already have DSA.
Yesss! I can give you one or two YouHua WR1200JS :) |
|
Also, next week I will try to compile images using the branch from this PR: openwrt/openwrt#4622 so that, if you want, you should be able to test with DSA even on LibreRouter. |
|
Maybe is better to merge this and then fix the case of DSA. |
It should be almost neutral, with no errors but either without information. I would like to test it a little bit more in a DSA router if possible.
As implemented on other parts, we can create a classic |
|
Ok, I will try to give you a DSA supported router. For the if/else statements, you can use the DSA checker that I am proposing in #959 |
|
Just tested calling the |
I'll merge this only into the development branch I think we should merge into the OpenWrt 19 compatibility branch only critical little fixes |
Improve get node status results with following improvements:
To get the switch status it combine the parsing of
/etc/board.jsonto get the roles andswconfig dev switch0 showto get if they are up or not. The switches connected directly yo the cpu doesn't have a role attribute on the/etc/board.jsonso they are discarded.Using
ubus call lime-utils get_node_status '{}'{ "ips": [ { "version": "4", "address": "10.219.123.10/16" }, { "version": "6", "address": "fddb:f81c:47ba::a7b:be00/64" }, { "version": "6", "address": "fe80::c24a:ff:febe:7b0a/64" } ], "hostname": "lapastoramesh-c", "switch_status": [ { "device": "eth0.1", "num": 2, "role": "lan", "link": "up" }, { "device": "eth0.1", "num": 3, "role": "lan", "link": "down" }, { "device": "eth0.1", "num": 4, "role": "lan", "link": "down" }, { "device": "eth0.1", "num": 5, "role": "lan", "link": "down" }, { "device": "eth0.1", "num": 0, "role": "cpu", "link": "up" }, { "device": "eth0.2", "num": 1, "role": "wan", "link": "down" }, { "device": "eth0.2", "num": 0, "role": "cpu", "link": "up" } ], "status": "ok", "uptime": "3186.15", "most_active": { "rx_short_gi": true, "station_mac": "C0:4A:00:DD:69:1C", "tx_bytes": 13809119, "rx_vht": false, "rx_mhz": 40, "rx_40mhz": true, "tx_packets": 31706, "tx_mhz": 40, "rx_packets": 97813, "rx_ht": true, "tx_mcs": 15, "noise": -90, "rx_mcs": 15, "chains": [ -17, -16 ], "rx_bytes": 19464143, "tx_ht": true, "iface": "wlan1-mesh", "tx_rate": 300000, "inactive": 30, "tx_short_gi": true, "tx_40mhz": true, "expected_throughput": 59437, "tx_vht": false, "rx_rate": 300000, "signal": -14 } }