Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    3g modem not being reset

    Scheduled Pinned Locked Moved 2.0-RC Snapshot Feedback and Problems - RETIRED
    1 Posts 1 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      shaggy63
      last edited by

      Testing a verizon wireless 3g usb modem I ran into problems first with needing to eject the usb cdrom the device has and then not being able to reconnect on reboot or disconnect until you reinsert the 3g card or cold boot.

      This script works around both issues.  It is a complete hack job but works.

      First: run:
      pkg_add -r minicom
      pkg_add -r screen
      pkg_add -r eject

      Then using "crontab -e" add:
      */1 * * * * /usr/local/bin/screen -d -m /usr/local/bin/php /root/resetmodem.php
      */1 * * * * /bin/pkill minicom

      Then create the file /root/resetmodem.php and add:

      
      exec("/usr/local/sbin/eject -v /dev/cd0"); sleep("10"); 
      $num=0; 
      while ($num <= 6) {
        exec("/usr/local/bin/screen -d -m /usr/local/bin/minicom -D /dev/cuaU0.0");
        sleep("5"); 
        $num++; 
        exec("/bin/pkill minicom"); 
        echo "Trying again"; 
      }
      
      

      Using the above my wireless card always reconnects withing 1 minute 30 seconds.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.