Thanks! I was able to move the commands to a separate file and add /etc/config/modem-init.sh &
in rc.local, sleeping for at least 60 seconds to hangup and connect with the API.
Here is the diagnostic file I used, adding a few more API calls for diags and the Openwrt API token.
#!/bin/bash
/usr/bin/gl_led both_flash fast
sleep 65
#Get GL.Inet API Token
echo $(curl -k http://127.0.0.1/cgi-bin/api/router/login -d 'pwd=goodlife') > /var/tmp/routerapi
#Get OpenWRT Luci API Token
curl -X POST http://127.0.0.1/cgi-bin/luci/rpc/auth --data ' { "id": 1, "method": "login", "params": ["root", "goodlife"] }' > /var/tmp/wrtapi
#Filter API Token To File
sed 's/.*"token":"\{0,1\}\([^,"]*\)"\{0,1\}.*/\1/' /var/tmp/routerapi > /var/tmp/routertoken
sed 's/.*"result":"\{0,1\}\([^,"]*\)"\{0,1\}.*/\1/' /var/tmp/wrtapi > /var/tmp/wrttoken
#Add Token To GL Modem Commands
echo "curl -k http://127.0.0.1/cgi-bin/api/modem/enable -H 'Authorization: $(cat /var/tmp/routertoken)' -d 'bus=1-1&modem_id=3&disable=true'" > /var/tmp/routerhangup.gl
echo "curl -k http://127.0.0.1/cgi-bin/api/modem/info -H 'Authorization: $(cat /var/tmp/routertoken)'" > /var/tmp/routerinfo.gl
echo "curl -k http://127.0.0.1/cgi-bin/api/modem/get -H 'Authorization: $(cat /var/tmp/routertoken)' -d 'bus=1-1&modem_id=3'" > /var/tmp/routermodemget.gl
echo "curl -k http://127.0.0.1/cgi-bin/api/router/network/state -H 'Authorization: $(cat /var/tmp/routertoken)'" > /var/tmp/routernetworkstate.gl
echo "curl -k http://127.0.0.1/cgi-bin/api/router/status -H 'Authorization: $(cat /var/tmp/routertoken)'" > /var/tmp/routerstatus.gl
echo "curl -k http://127.0.0.1/cgi-bin/api/modem/set -H 'Authorization:$(cat /var/tmp/routertoken)' -d 'bus=1-1&modem_id=3&device=%2Fdev%2FttyUSB3&service=umts&apn=VSBLINTERNET&pincode=&ath=NONE&dianum=&username=&password=&proto=3g&ttl=&mtu=1428&operator=Visible'" > /var/tmp/routerconnect.gl
#Make Modem Command Executable
chmod +x /var/tmp/*.gl
#Hangup Modem
/var/tmp/routerhangup.gl
/usr/bin/gl_led blue_flash fast
sleep 5
#Connect Modem
#gl_modem -B 1-1 connect serial /dev/ttyUSB3 fdd_lte VSBLINTERNET
/var/tmp/routerconnect.gl
/usr/bin/gl_led white_flash fast
sleep 10
#OpenWRT Luci API Calls
curl -X POST http://127.0.0.1/cgi-bin/luci/rpc/uci?auth=$(cat /var/tmp/wrttoken) -d ' { "id": "1", "method": "get_all", "params": ["network"] }' > /var/tmp/network.txt
exit 0
I did install beta 4.1.1 beta1 on the Opal for a day, but the GL API gave a 403 error using the same login, even on a uboot flash. The modem had the same symptoms and required clicking Abort>Manual Settings>Apply. Even a soft reboot of the modem did not connect successfully under modem tools. Also, I saw more light activity going from blue breath to white when the modem auto-reconnected. The beta firmware reconnected fine, but it happened frequently, where firmware 3.215 fixed all of the problems with visible and stays connected for hours with a solid white light. The modem was not as reliable under the beta.
The reboot graphics on the beta also need to be changed to the blue theme colors, but I liked the many changes in the UI for the beta. The additional options are nice.
I would recommend adding a 3-place toggle switch for (auto connect on | auto connect off | auto soft connect) in the modem GUI for ease of use. The API /modem/set/ command looks like it creates a new interface every use, resetting all interface defaults on modem_1_1. Having the soft connect option use the “gl_modem connect” command or use the manual settings exclusively to keep interface customizations in place between reboots would be convenient.
Thanks again! The API script does hangup and connect normally, making the Opal plug-n-play with LTE connections, just like the X750 Spitz. Firmwares before 3.215 had many problems resolved by your fixes on both routers with Visible. Instead of a bunch of AT commands to configure, 3.215 is just updating the APN to connect. I just plug it in and it works over LTE!