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

Enable Node Information Exchange #1043

Merged
merged 8 commits into from
Aug 31, 2023
Merged

Conversation

javierbrk
Copy link
Collaborator

This pull request adds node information exchange using shared state. This information will be used in the UI an is going to be compared with the reference state to display alerts when a node has changed or gone.

This module has been tested using two tplinks wdr3500 with the following output

root@LiMe-462895:~#echo | shared-state reqsync node_info

{"LiMe-da4eaa":{"bleachTTL":30,"data":{"coordinates":{"long":"-64.19291","lat":"-31.43393"}, "board":"tplink,tl-wdr3500-v1","device":"Router","macs":["14:cc:20:da:4e:af","14:cc:20:da:4e:ac", "14:cc:20:da:4e:ab", "00:00:00:00:00:00", "14:cc:20:da:4e:aa"], "hostname":"LiMe-da4eaa", "ipv4":"10.13.78.170","uptime":37.829999999999998, "ipv6":"fd0d:fe46:8ce8::aa4e:da00","firmware_version":"nodeinfo"}, "author":"LiMe-da4eaa"},"LiMe-462895":{"bleachTTL":30,"data":{"ipv6":"fd0d:fe46:8ce8::9528:4600","board":"tplink,tl-wdr3500-v1","device":"Router","macs":["a0:f3:c1:46:28:96","a0:f3:c1:46:28:97","a0:f3:c1:46:28:9a","00:00:00:00:00:00","a0:f3:c1:46:28:95"],"hostname":"LiMe-462895","firmware_version":"nodeinfo","coordinates":{"long":"FIXME","lat":"FIXME"}, "uptime":38.789999999999999,"ipv4":"10.13.40.149"},"author":"LiMe-462895"}}

root@LiMe-462895:~# ubus -S call shared-state getFromSharedState '{"data_type": "node_info"}'
{"LiMe-462895":{"coordinates":{"long":"FIXME","lat":"FIXME"},"board":"tplink,tl-wdr3500-v1","device":"Router","macs":["a0:f3:c1:46:28:96","a0:f3:c1:46:28:97","a0:f3:c1:46:28:9a","00:00:00:00:00:00","a0:f3:c1:46:28:95"],"hostname":"LiMe-462895","ipv4":"10.13.40.149","uptime":38.790000,"ipv6":"fd0d:fe46:8ce8::9528:4600","firmware_version":"nodeinfo"},"LiMe-da4eaa":{"coordinates":{"long":"-64.19291","lat":"-31.43393"},"board":"tplink,tl-wdr3500-v1","device":"Router","uptime":37.830000,"hostname":"LiMe-da4eaa","firmware_version":"nodeinfo","ipv6":"fd0d:fe46:8ce8::aa4e:da00","macs":["14:cc:20:da:4e:af","14:cc:20:da:4e:ac","14:cc:20:da:4e:ab","00:00:00:00:00:00","14:cc:20:da:4e:aa"],"ipv4":"10.13.78.170"}}

@javierbrk javierbrk added this to the mesh-wide milestone Aug 31, 2023
@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2023

Codecov Report

Merging #1043 (111b848) into master (e64db16) will increase coverage by 0.00%.
Report is 2 commits behind head on master.
The diff coverage is n/a.

❗ Current head 111b848 differs from pull request most recent head e5c53b5. Consider uploading reports for the commit e5c53b5 to get more accurate results

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

@@           Coverage Diff           @@
##           master    #1043   +/-   ##
=======================================
  Coverage   79.71%   79.72%           
=======================================
  Files          53       53           
  Lines        4536     4538    +2     
=======================================
+ Hits         3616     3618    +2     
  Misses        920      920           

see 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ilario
Copy link
Member

ilario commented Aug 31, 2023

Nice!
A few comments on the makefile:

$RANDOM will not be available in the upcoming LibreMesh releases.
See #800 and #991 (this means that the makefile should include a dependency from the replacement package and the uci-default package should include the random-numgen command instead of the $RANDOM)

Consider using libremesh.mk as, for example, here:

include ../../libremesh.mk

Fill the maintainer field

@javierbrk javierbrk marked this pull request as draft August 31, 2023 14:24
@javierbrk javierbrk marked this pull request as ready for review August 31, 2023 18:55
@G10h4ck
Copy link
Member

G10h4ck commented Aug 31, 2023

$RANDOM will not be available in the upcoming LibreMesh releases. See #800 and #991 (this means that the makefile should include a dependency from the replacement package and the uci-default package should include the random-numgen command instead of the $RANDOM)

@ilario this new packages are being developed on top of OpenWrt development branch which includes $RANDOM and are not retro-compatible with currently stable stuff anyway. OpenWrt developers are in the process to publish a new release which have $RANDOM just now (they have already published a few RC).

So don't worry about this for this new packages ;)

@G10h4ck G10h4ck merged commit c1b9ed3 into libremesh:master Aug 31, 2023
1 check passed
@ilario
Copy link
Member

ilario commented Aug 31, 2023

$RANDOM will not be available in the upcoming LibreMesh releases. See #800 and #991 (this means that the makefile should include a dependency from the replacement package and the uci-default package should include the random-numgen command instead of the $RANDOM)

@ilario this new packages are being developed on top of OpenWrt development branch which includes $RANDOM and are not retro-compatible with currently stable stuff anyway. OpenWrt developers are in the process to publish a new release which have $RANDOM just now (they have already published a few RC).

Ok, just be aware that this package will not work until when we will make a release based on OpenWrt 23, which is not going to be soon (seems).

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.

None yet

6 participants