Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6761107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:08:48+00:00 2026-05-26T14:08:48+00:00

If I have a GSM modem with 6 ports and each port inserted a

  • 0

If I have a GSM modem with 6 ports and each port inserted a SIM card,how can I send sms with random port?

Here is a simple code:

  include "php_serial_class.php";

  $serial=new phpSerial();
  $serial->deviceSet("/dev/ttyUSB0");
  $serial->deviceOpen();

  //continue....  

  ?>

So now the sms will sent through Port 1(ttyUSB0).What can I add or edit the script so that it can be sent with random port? Such as if Port 1 is busy or sending other sms then it will change to port 2…

I tried something like this:

  if(!$serial->deviceOpen())
  {
      $serial->deviceSet("/dev/ttyUSB1"); 
  }

and it won’t works..
Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:08:48+00:00Added an answer on May 26, 2026 at 2:08 pm

    You wouldn’t know if device is busy unless you try to open it, so you have to check it one step with deviceOpen method. Example:

    $ports = range(0,5);
    shuffle($ports);
    
    $serial = new phpSerial();
    
    foreach($ports as $port){
        if($serial->deviceSet("/dev/ttyUSB{$port}")){
            if($serial->deviceOpen()){
                // send sms
                break; // break the loop after sending sms
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got a Wavecom Supreme GSM modem. I wrote a simple application that
I want to send messages from php by using a GSM modem. I have
I have been using scampers library to send and receive SMS through a GSM
I have list view that I use to display SMS from my GSM modem.
I have a GSM modem connected via USB. The modem creates 2 serial ports.
I've developed an SMS app (send/receive SMS using GSM modem) using this library -
I have found the way to send SMS using the Android.Telephony.Gsm.SmsManager class but for
Background I have a GSM modem connected through a COM port. I open the
I have one GSM Modem Series 900. I want to test it for sending
I'm working on a program in C# that can send a SMS from my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.