KyleBenson / scale_client

The Python-based SCALE Client software for acquiring data from various sensors (i.e. via Raspberry Pi platform), processing it, and sharing it through multiple networks and data exchange protocols.
http://scale.ics.uci.edu/
Other
4 stars 8 forks source link

InternetManager to determine if we have internet access #23

Closed KyleBenson closed 9 years ago

KyleBenson commented 9 years ago

Since many different components in the SCALE client system care about the status of the network connection, we should monitor this in some way (pinging some server? listening for disconnected sockets in MQTT, etc.?) and locally publish a network_(dis)connected event when the status changes so that other components can react accordingly. For example, the MQTTEventSink should always return "False" when asked check_available() so that the EventReporter doesn't block the entire client waiting for the Sink to time out while trying to reconnect.

bfrggit commented 9 years ago

I wrote an InternetAccessVirtualSensor that pings 8.8.4.4. MQTTEventSink now listen to Internet access status events and returns False when there's no Internet connection.