Skip to content

Initial Setup

Calin Crisan edited this page Jul 23, 2020 · 8 revisions

Setup Mode

Access Point

When the device is flashed with espQToggle firmware (or after a factory reset), it starts its internal Wi-Fi access point mode with the following parameters:

  • SSID (network name): esp-XXXXXXXX, where XXXXXXXX is the device serial number
  • PSK (network key): empty, open network
  • IP network: 192.168.5.0/24
  • own IP address: 192.168.5.1

This access point will be used to configure the device's network settings in one of the following methods.

Adoption

Devices running espQToggle normally expose the qToggle API; and APIs are intended to be used by programs, not users. You will most likely want to use a hub running qToggleServer to adopt your device and then to manage and use it via the hub's app.

Unless you already have a qToggleServer setup, the Getting Started page will help you install one.

Adopting your device on the hub should be as easy as using the Devices > Add Device > Discover page, in the qToggleServer app. However, you'll need to make sure that:

  • the device is in setup mode
  • the device is close enough to the hub so that the (temporary) Wi-Fi connection between them can be established
  • the hub has been properly configured to be able to discover devices (running qToggleOS offers the best out-of-the-box experience)

Behind the scenes, while in setup mode, the device will continuously try to connect to the Wi-Fi AP with the SSID (network name) qToggleSetup and no PSK (network key). The hub will start a temporary AP with these parameters and will wait for devices in setup mode to connect. It will then configure and adopt them.

Manual Network Configuration

While the access point is active on the ESP device, it will act as a captive portal for connected clients, presenting a configuration interface when accessed using a web browser. You can use your smart phone to connect to it provide the details necessary for its real network connection.

You'll have to choose/input the Wi-Fi network name (and network key) to which you want your device to connect. Optionally, you can set a manual IP configuration (address, netmask, gateway and DNS server) to your device. Otherwise, it will use DHCP.

After applying the settings, your device will restart in Wi-Fi client mode and will attempt to connect to the configured network. Once connected, since you manually configured its network settings (as opposed to automatically adopting by on a hub), you'll need to find its IP address and add it to the hub. Here are some methods to do that:

  • smart phone apps like Fing to scan your network
  • looking through your router's DHCP leases
  • accessing esp-XXXXXXXX.local may work on your local network

Once you have its IP address, just use the Devices > Add Device page in the qToggleServer app to add it. Don't be tempted to visit its IP address with a browser, unless you're prepared to see some non-user-friendly JSON.

Provisioning

If you have flashed the firmware yourself onto your device, it will boot up as a generic, not-useful-at-all device. That is, it won't export any ports and will basically be useless unless you teach it what it has to do. This is what we mean by provisioning.

The easiest way to provision your new device is to use the qToggleServer app and visit its page in the Devices section. There, you'll need to look for the Configuration Name attribute and choose one of the available (well-known) device configurations. The device will then automatically know what its role is and will function accordingly. ⚠️ Be sure though to choose the correct configuration; choosing a wrong configuration may render your device unusable (unless reflashed).

For other provisioning methods, or for more details on this matter, see Provisioning.

Troubleshooting

Entering Setup Mode

If you can't reach your device in your network or you simply want to reconfigure its network settings, you can switch it to setup mode.

Just press and hold the device button for about 5 seconds, until the status LED starts blinking fast (for devices that have such a LED). If device has more than one button, try all of them, in turn.

To exit setup mode, readopt it, complete the network configuration or press and hold the button for another at least 5 seconds, until the status LED stops blinking.

Status LED

Most devices are equipped with a LED that indicates the Wi-Fi connection status, as follows:

  • the LED will blink fast while in setup mode
  • when the LED blinks slowly, the device attempts to connect to the Wi-Fi network
  • when the LED is off, the device is connected to the network

Factory Reset

If you misconfigured your device and you need to bring it back to factory defaults, you can do that by pressing and holding the device button for 20 seconds. The factory defaults will not really be identical to those when you first unboxed your device, though; following data will be kept on your device:

After a factory reset, the device will automatically enter setup mode and you can start over with the configuration.