View Single Post
Old 04-12-2021, 12:33 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,099
Originally Posted by tdubsley View Post
I'm getting an 'Init Sequence Failed' error when trying to connect to either of my predefined test sessions. I was able to switch back to TAPI and connect successfully. Any suggestions?
The "Init Sequence Failed" error message is coming from this block within the script code:
    ' Send a generic modem init string: You may need
    ' to modify this to meet your specific needs.
    crt.Screen.Send "AT&A3&B1&D0&K0&M4&N3&U3&R1" & vbcr
    If Not crt.Screen.WaitForString("OK", 3) Then
        crt.Dialog.MessageBox _
            "Init sequence failed.", _
        Exit Sub
    End If
As indicated in the comments, "You may need to modify this to meet your specific needs". In other words, the init string that is being sent to your modem within the script code may not be generic enough for your specific model of modem.

You may want to turn on modem logging within Windows, dial with TAPI, and then take a look at the modem log file Windows wrote to and see what specific init string is being sent to the modem when Windows' TAPI is doing the dialing -- then you'll have an init string that you know would likely work for you when talking to the modem directly via its serial port.
How do you turn on modem logging in Windows? That's typically done within Windows (outside of SecureCRT entirely) - check your control panel's Phone and Modem settings, select the "Modems" tab, select your modem and press the "Properties" button; select the Diagnostics tab and you should see a "Logging" section that you can enable.

Once you find the modem init string that Windows is using when it talks to your modem, you'll tell the script to use that same init string by replacing the value within ""s below:
    crt.Screen.Send "AT&A3&B1&D0&K0&M4&N3&U3&R1" & vbcr
It's also possible that the init string is OK, but the modem is slow to reply with the expected OK (within 3 seconds).
    If Not crt.Screen.WaitForString("OK", 3) Then
Another approach you could take is to increase the timeout to, say, 5 seconds and see if you get a reply. If you're seeing evidence in SecureCRT's terminal window that the modem isn't accepting the init string (producing some error text, perhaps?), then clearly it's the appropriate init string you'll need to discover. Consult the manufacturer of your modem to find out what common init string values are supported and can be used, then adjust the script code to send only supported values.

Does that help explain where you need to go next?
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel:
Reply With Quote