每分钟使用 php_serial_class 连接到端口

发布于 2024-12-24 02:10:44 字数 599 浏览 0 评论 0原文

如果我有一个使用 crontab 每分钟发送短信的脚本:

$sql = "SELECT * FROM table WHERE Status = '0' LIMIT 0,6";
$query = mysql_query($sql);

$serial = new Sms_Serial;
$serial->deviceSet("/dev/ttyUSB0");
$serial->confBaudRate(115200);
$serial->confParity('none');
$serial->confCharacterLength(8);

    while ($row = mysql_fetch_array($query))
         {
         $serial->deviceOpen();

         //sending....

         $serial->deviceClose();
         }

这意味着它将检测端口并将 BaudRate 设置为每分钟发送几条短信。它会对端口或调制解调器造成任何损坏吗?我的某些端口将无法几天后再次检测SIM卡,我不确定是调制解调器质量问题还是我的脚本问题。

谢谢。

If I have a script which will send sms every minute using crontab :

$sql = "SELECT * FROM table WHERE Status = '0' LIMIT 0,6";
$query = mysql_query($sql);

$serial = new Sms_Serial;
$serial->deviceSet("/dev/ttyUSB0");
$serial->confBaudRate(115200);
$serial->confParity('none');
$serial->confCharacterLength(8);

    while ($row = mysql_fetch_array($query))
         {
         $serial->deviceOpen();

         //sending....

         $serial->deviceClose();
         }

Which means it will detect the port and set BaudRate to send few sms every minute.Will it bring any damage to the port or modem?Some of my ports will not able to detect SIM card anymore after some days,I'm not sure whether is the modem quality problem or my script problem.

Thank you.

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

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

发布评论

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

评论(1

你是年少的欢喜 2024-12-31 02:10:44

您是否尝试过检查如果不发送消息会发生什么情况?主要是我看到调制解调器不支持这么多的流量/连接,然后您的代码中可能存在错误,如果未发送消息,将尝试再次发送它,依此类推,而不是报告它并“暂停”这个过程直到你看到发生了什么,这会导致大量流量,如果你的调制解调器不接受它,它最终会被炸毁。

Have you tried checking to see what happens if it doesn't send the message? Mainly I see that the modem does not support so many traffic/connection and then there might be a bug in your code where if the message is not sent will try to send it again and so on and on instead of reporting it and "pause" the process until you see what is happening, that causes a lot of traffic and if your modem doesn't take it, it will get fried eventually .

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