每分钟使用 php_serial_class 连接到端口
如果我有一个使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过检查如果不发送消息会发生什么情况?主要是我看到调制解调器不支持这么多的流量/连接,然后您的代码中可能存在错误,如果未发送消息,将尝试再次发送它,依此类推,而不是报告它并“暂停”这个过程直到你看到发生了什么,这会导致大量流量,如果你的调制解调器不接受它,它最终会被炸毁。
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 .