GL-X3000 / Spitz AX - Execute AT Commands based on Sim 1 or Sim 2

Hello! I have the GL-X3000 / Spitz AX. I would like to execute specific AT / shell commands when I switch to Sim 1 or to Sim 2. I know how to SSH into my router and find the scripts / files / etc via SSH. Could someone from GL-iNet tell me if there is a particular script that gets executed when a Sim switch occurs?

Basically something like:

  1. Sim switch occurs in router interface or via automated switching.
  2. Execute something like:
    if SIM1
    then
    gl_modem -D AT ‘AT+BLAHBLAHBLAH’
    gl_modem -D AT ‘AT+BLAHBLAHBLAH’
    elif SIM2
    then
    gl_modem -D AT ‘AT+BLAHBLAHBLAH2’
    gl_modem -D AT ‘AT+BLAHBLAHBLAH2’
    fi

Thank you!

1 Like

Any help here? Thank you!

Hey @yuxin.zou any chance I could get a hand on this thread? Thank you!

@lizh please answer the question, thanks.

1 Like

Can’t you use either AT+QCCID or AT+CIMI to get an idea of what SIM is being used?

Can’t test right now, but I think those 2 commands will differ.

1 Like

Thanks! Actually, looks like the easiest way to tell is here:

cat /tmp/run/dual_sim/modem_0001/current_sim

1 Like

@datumly did you find a way to trigger your script from a SIM switch?

I haven’t configured mine yet, but this would be the place to do it:

You can modify it temporarily in this script: ‘/usr/bin/switch_sim_slot’