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

Add client hotspot wwan connection handling #890

Merged
merged 16 commits into from
Mar 10, 2022

Conversation

spiccinini
Copy link
Contributor

@spiccinini spiccinini commented Jul 16, 2021

For multiple things it is useful to connect temporarily the device to an access point. To provide remote access/support through tmate or other means it is helpful that someone close to the device share its mobile phone connection to the router. The lime-app will use this functionality.
Enabling this functionality will provide "internet access" to the node only, not to other nodes of the network as the route won't be propagated. This is on purpose as acting as a default gateway may consume all the credit of a mobile connection.

Also the check-internet package now provides an optional (no new dependencies) ubus interface to check.

TODO:

  • add tests

@ilario
Copy link
Member

ilario commented Jul 17, 2021

Nice!!
Sounds like similar to auto-usb-wwan but directly with the router's antennas, correct?
https://github.com/libremesh/lime-packages/tree/master/packages/auto-usb-wwan

How will the user enable the wwan on the LibreMesh node?

@spiccinini
Copy link
Contributor Author

spiccinini commented Jul 18, 2021

Nice!!
Sounds like similar to auto-usb-wwan but directly with the router's antennas, correct?
https://github.com/libremesh/lime-packages/tree/master/packages/auto-usb-wwan

How will the user enable the wwan on the LibreMesh node?

It can be done with the following (using radio1 instead of the default radio0)

root@LiMe-1efa02:~# echo | /usr/libexec/rpcd/lime-utils-admin call hostpot_wwan_is_connected
{"status":"ok","connected":false}

root@LiMe-1efa02:~# echo '{"radio": "radio1"}'  | /usr/libexec/rpcd/lime-utils-admin call hostpot_wwan_enable
{"status":"ok"}

root@LiMe-1efa02:~# echo | /usr/libexec/rpcd/lime-utils-admin call hostpot_wwan_is_connected
{"status":"ok","connected":true,"signal":-47}

root@LiMe-1efa02:~# echo  '{"radio": "radio1"}'  | /usr/libexec/rpcd/lime-utils-admin call hostpot_wwan_disable
{"status":"ok"}

root@LiMe-1efa02:~# echo | /usr/libexec/rpcd/lime-utils-admin call hostpot_wwan_is_connected
{"status":"ok","connected":false}

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2021

Codecov Report

Merging #890 (7befdb2) into master (8c41ceb) will increase coverage by 0.54%.
The diff coverage is 96.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #890      +/-   ##
==========================================
+ Coverage   76.41%   76.95%   +0.54%     
==========================================
  Files          47       48       +1     
  Lines        3934     4057     +123     
==========================================
+ Hits         3006     3122     +116     
- Misses        928      935       +7     
Impacted Files Coverage Δ
...lime-utils/files/usr/lib/lua/lime/hotspot_wwan.lua 95.40% <95.40%> (ø)
...es/lime-system/files/usr/lib/lua/lime/wireless.lua 97.17% <100.00%> (+0.15%) ⬆️
tests/fakes/iwinfo.lua 97.11% <100.00%> (+0.05%) ⬆️
...kages/lime-system/files/usr/lib/lua/lime/utils.lua 81.06% <0.00%> (-0.30%) ⬇️
tests/utils.lua 98.95% <0.00%> (+0.09%) ⬆️
...-utils/files/usr/lib/lua/lime/wireless_service.lua 60.53% <0.00%> (+2.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c41ceb...7befdb2. Read the comment docs.

Copy link
Contributor

@luandro luandro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well tested and simple logic. Great work ;)

@luandro luandro merged commit 3570811 into libremesh:master Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants