How to automatically connect to WiFi once ethernet stops working - automation

So my problem is fairly easy:
The wired ethernet connection stops working from time to time but stays connected.
What I want to do is keep the WiFi turned off, or at least disconnected, as long as the ethernet is working and provides an active connection to the internet.
Once the ethernet loses connection, so e.g. a timeout to DNS or something similar the WiFi-Adapter should be turned on/ connect to the network.
The ethernet cable stays connected, just no uplink.
The Wifi would connect to a different network. The wired network is connected to a hardware-firewall, while the WiFi would connect to a private hotspot from a fritzbox.
Are there any working solutions to this day?

Related

how to setup to internet connections in one wifi

I have adsl internet connection run on dlink modem and has wifi with getway 192.168.1.1 and fiber internet run on Huawei with getway 192.168.100.1. Both modems have wifi and I have two wifis in home. Any body knows how to connect them and use one wifi and select between internets with changing gateway?
Thanks in advance

3G USB modem switches back to storage mode after connection is lost

I configured a 3G modem (Novatel Wireless U679 (Ovation MC679)) on a Raspberry Pi running Raspian OS. To switch the modem from storage mode (1410:5059) to modem mode (1410:7031), I use the following command:
sudo eject /dev/sr0
I then use Sakis3G script to establish the connection with:
sudo /usr/local/bin/sakis3g/sakis3g connect OTHER="USBMODEM"
USBMODEM="1410:7031" USBINTERFACE="0" APN="crstat.bell.ca" APN_USER="0"
APN_PASS="0" USBDRIVER="option"
I also use UMTSkeeper to keep the connection alive if this one drops.
The 3G connection lasted 2 days before dropping for the first time and then never reconnected. When I tried to reconnect manually by reissuing the above sakis3g command, I got the following answer:
Already selected value USBMODEM="1410:7031". Is not valid.
So I typed 'lsusb' at the command line, I saw that the modem product ID was back to storage mode (1410:5059). If I try to switch it again to modem mode using the command 'eject', this time the modem disappear from the 'lsusb' list.
Here are my questions:
1 - Why the product ID switches back to storage mode after a connection drop?
2 - How can I switch it again to modem mode after a connection drop?
3 - How does these steps integrates with UMTSkeeper so that it reconnects automatically?
i am not sure what exactly is the problem.. but i too had this issue. In my case the raspberry pi doesn't switch automatically so i had to use a command to switch it. the command i used was :
" sudo ./sakis3g swithonly "
it switches the dongle from storage mode to modem mode and i don't face any problem like that of yours. my dongle remains in modem mode even if disconnect the connection. it goes back to storage mode only if i unplug and then re-plug.
Hope this helpful!

iPhone: open also a 3G socket when WiFi is active

When the device is connected via WiFi, is there a way in iOS 6+ to open a socket in 3G?
For example, if the quality of the WiFi is not too good and I want to establish a connection via 3G network, even if I already have an open WiFi socket.

GCDAsyncUdpSocket UDP communication over internet

I have a problem using GCDAsyncUdpSocket over internet. Everything works fine when I am doing test on my local computer.
I try to to send UDP message between a computer connected to internet with a 3G key and an Ipod connected through wifi. Unfortunately the message are not transmitted. I tried to do the same test with the example of GCDAsyncUdpSocket : UdpEchoClient and UdpEchoServer, and it is also not working.
To know the address IP of my computer with the 3G key, I looked on system preferences -> network, I also looked on http://whatismyipaddress.com/ , I saw that the adresses were different. With both it is not working.
My Ipod connected through wifi is behind a NAT/Firewall, but according to this website : https://www.gotroot.com/blogpost4-Why-your-should-never-forward-UDP-out-of-your-firewall It shouldnt be a problem.
Is it possible to send message between 2 devices without opening any port?
Why do you have two different IP addresses on my computer with 3G?

If possible, how to connect iPhone to an external device and a router programmatically, both WiFi

I would like to create an application that connects to the internet by using WiFi. That's easy, but i also want to connect the iOS device to a standalone WiFi device. (Device is classified)
So basically i want to connect programmatically to two devices at once using a single WiFi chip
Is this even possible (couldn't find anything that proves so on internet). And if possible, how do i do it?
iOS device can't be connected to two different wireless networks at the same time.
Even more: you can't programmatically switch between the two networks - user has
to do it trough the settings application.
So: if the device is on the same wireless network as your router (gateway to internet) then you'll have no problems connecting iOS to internet and to your classified device.
However: if classified device is on a seperate (possibly AdHoc) network then user will have to switch between connection to internet and connection to classified devices's wireless network.
If you're the designer of classified device it would be best if you can manage the connection trough wireless access point. This would be the only way to connect iOS device to your classified device and internet at the same time.