Awesome @Lazar-Demin! I never thought to mess around with Firewall. I was trying to do everything through Network but this is awesome because the connection stays active but no traffic can pass through it. This means I can maintain a cellular connection but disallow traffic through it. This is perfect! Thanks so much for looking into this. I'll be sure to let you know how it works for me. Also I'll be putting together a python script to monitor internet connectivity through the interfaces and enable/disable them so I'll be sure to share that script for others.
Best posts made by IOTrav
-
RE: Looking for input managing network connection interfaces
-
RE: Connect to WiFi and install OPKG package with AutoRun example
Thank you @crispyoz,
I actually finally got it working this morning just the way I wanted. Here's a simple example based on what I did:
printf "%s" "Connecting to WiFi" wifisetup add -ssid Network-SSID -encr wpa2 -password XXXXXXXX printf "%s" "Waiting for Internet" while ! ping -c 1 -n -w 1 www.google.com &> /dev/null do printf "%c" "." done printf "\n%s\n" "Internet Connected" opkg update
Seems to be running great. It waits indefinitely but I don't want it to proceed until Internet connection is there so I didn't figure there was any reason to have a retry count. I'm using an on board RGB LED to indicate when the script starts, when it connects to wifi and begins installing OPKG packages, and when it is complete. This will be used for configuring a group of Onion modules prior to installation in our product. AutoRun is fantastic!
-
Connect to WiFi and install OPKG package with AutoRun example
I have been reviewing the Autorun documentation here:
https://onion.io/usb-autorun/It seems fairly straightforward, however I do not write shell scripts that often. One of the suggestions is to write a script that connects to WiFi and then installs some packages via OPKG. That is exactly what I'm looking to do. However all methods of connecting to WiFi networks appear to be Asynchronous, my issue with that is I need to write a script that connects to a WiFi network, waits for that connection to be established and then install a package via OPKG. Thus I either need a blocking call to connect to WiFi, or I need to write a while block into the script that waits for valid wifi connection using something link ping. Would it be possible to get a super simple .sh example for this?