ConnectivityLedStatus.SetsNetworkStatus (connectivity_led_status v0.1.2)

Checks to see if there's an IP address assigned to wlan0 every 5 seconds and:

  • if it is not set flashes the onboard LED rapdily
  • if it is set to 192.168.0.1 (or otherwise configured) then assume that this is an access point as part of the configuration process, and flash slowly
  • if it is set to something else and VintageNet reports that Internet connection is established, then flash heartbeat
  • If connection is all ok, then the LED is turned off

This could have be done with subscribing to VintageNet but that gets complicated to test the different states and may not deal well with any VintageNet bugs.

Optionally you can configure the IP that indiciates VintageNetWizard to another value at compile time

eg

import Config

config :connectivity_led_status, Configuration, vintage_net_wizard_hotspot: {10, 20, 0, 1}

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec start_link(any()) :: :ignore | {:error, any()} | {:ok, pid()}