You will find an approach in this thread that may solve the problem. The OP uses a script called every 5 minutes by crontab to check if the network is connected and reconnect if not.
I use a variation that is called once by the autostart file. The main script, called keepup saved in the home directory, is:
#!/usr/bin/bash
log="/storage/log_keep_network_up"
address="1.1.1.1"
echo "***--- $(date) ---*** " >> $log
echo "" >> $log
while :; do
sleep "$(( 299 - $(date +%s) % 300 )).$(( 1000000000 - $((10#$(date +%N))) ))"
if ! nc -w15 -z $address 80 ; then
echo -n "*** $(date +%H:%M:%S.%N | head -c 12) *** " >> $log
if ! nc -w15 -z $address 80 ; then
echo -n "twice so reconnect" >> $log
systemctl restart connman.service
sleep 2
systemctl restart wpa_supplicant.service
fi
echo >> $log
fi
done
It is called by the following line in the file /storage/.config/autostart.sh
:
/storage/keepup &