4G USB加密狗自动重新连接 /自动恢复

发布于 2025-01-27 13:17:22 字数 246 浏览 3 评论 0原文

我有一个Raspberry Pi,其中有4G USB加密狗连接到Internet访问。一切都可以在电源上,所有自动连接和连接性都可以建立。 实际上,如果我将Raspberry Pi放在办公桌上,它可以通过4G加密狗连接数周,没有任何问题。 一旦我离开移动电池区域,连通性就会下降并且无法恢复。我还希望能够拔下USB 4G加密狗并重新连接并与单元格自动恢复。我正在使用USB模型开关和WVDIAL。 无论如何,我可以让4G加密狗自动恢复吗?

感谢您的阅读。 布罗德。

I have a Raspberry Pi with a 4G USB dongle connected to it for internet access. Everything works on power-up, everything auto-connects and connectivity is established.
In fact if I leave the Raspberry Pi on my desk powered up it stays connected through the 4G dongle for weeks without any issues.
As soon as I leave my mobile cell area, connectivity drops out and does not recover. I also want to be able to unplug the USB 4G dongle and reconnect it and have the cell link auto recover. I am using USB-Modeswitch and wvdial.
Is there anyway I can get the 4G dongle to auto recover?

Thanks for reading.
Brodes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

涙—继续流 2025-02-03 13:17:22

好的,我想我找到了我正在寻找的解决方案。...

我创建了这个脚本,该脚本将5个ping发送到VPN隧道的另一端。如果ping失败,则Raspberry Pi重新启动。

#!/bin/bash
# This script checks for an active Internet connection by pinging.
# If the pings fail, it will reset the USB modem dongle.
ping -c5 10.8.0.1
let a=$?
if [ "$a" != "0" ]; then
/sbin/shutdown -r now Connection lost, rebooting...
fi

然后,我创建了一个Cronjob每2分钟运行此脚本。

如果有人有更好的主意,请告诉我。

欢呼,

布罗德。

OK I think I have found the solution I was looking for....

I created this script that sends 5 pings to the other end of a VPN tunnel. If the pings fail then the Raspberry Pi reboots.

#!/bin/bash
# This script checks for an active Internet connection by pinging.
# If the pings fail, it will reset the USB modem dongle.
ping -c5 10.8.0.1
let a=$?
if [ "$a" != "0" ]; then
/sbin/shutdown -r now Connection lost, rebooting...
fi

Then I created a cronjob to run this script every 2 minutes.

If anyone has a better idea please let me know.

Cheers,

Brodes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文