meshtastic/docs/settings/wifi.md

335 lines
9.3 KiB
Markdown
Raw Normal View History

2021-04-20 12:28:55 -07:00
---
id: wifi
title: WiFi Settings
sidebar_label: WiFi
---
2021-05-05 09:18:44 -07:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2021-04-20 12:28:55 -07:00
## Overview
The ESP32 based devices have the ability to connect to WiFi as a client and also are able to create a software based access point (SoftAP). See below for more details.
2021-04-20 12:28:55 -07:00
:::note
The device can be either a WiFi client or a software access point. It **cannot** operate as both at the same time.
:::
:::info
The first time your device restarts after enabling the WiFi access point, it will take an additional 20-30 seconds to boot. This is to generate self-signed SSL keys. The keys will be saved for future reuse.
:::
2021-04-20 12:28:55 -07:00
## Settings
2021-05-03 13:31:11 -07:00
| Setting | Acceptable Values | Default |
| :-----: | :---------------: | :-----: |
| wifi_ap_mode | `true`, `false` | `false` |
| wifi_password | string | `""` |
| wifi_ssid | string | `""` |
2021-04-20 12:28:55 -07:00
:::note
`wifi_ssid` & `wifi_password` are both **case sensitive** values.
:::
2021-04-20 12:28:55 -07:00
2021-05-03 13:31:11 -07:00
### wifi_ap_mode
A boolean value that toggles the [Software Access Point](#software-access-point)
#### Enable/Disable Software Access Point
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
```bash title="Enable SoftAP"
meshtastic --set wifi_ap_mode true
```
```bash title="Disable SoftAP"
meshtastic --set wifi_ap_mode false
```
</TabItem>
<TabItem value="android">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
</Tabs>
2021-05-03 13:31:11 -07:00
### wifi_password
In [SoftAP](#software-access-point) mode, this is the password to access your device's WiFi. In [Client](#wifi-client) mode, this is your WiFi Networks password. This string is case sensitive.
2021-05-03 13:31:11 -07:00
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
```bash title="Set WiFi password"
meshtastic --set wifi_password mypassword
```
```bash title="Set WiFi password (with spaces)"
meshtastic --set wifi_password "my password"
```
</TabItem>
<TabItem value="android">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
</Tabs>
2021-05-03 13:31:11 -07:00
### wifi_ssid
In [SoftAP](#software-access-point) mode, this is the SSID broadcast to access your device's WiFi. In [Client](#wifi-client) mode, this is your WiFi Networks SSID. This string is case sensitive.
2021-05-03 13:31:11 -07:00
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
]}>
<TabItem value="cli">
```bash title="Set WiFi network"
meshtastic --set wifi_ssid mynetwork
```
```bash title="Set WiFi network (with spaces)"
meshtastic --set wifi_ssid "my network"
```
</TabItem>
<TabItem value="android">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
</Tabs>
2021-04-20 12:28:55 -07:00
## Details
### Software Access Point
With the SoftAP enabled, a DNS server will run on the device. The DNS server will respond to all DNS requests with the IP address of your device. This will simplify device discovery because you will not have to remember the device's IP any unencrypted HTTP request will direct you to the right location.
#### Force SoftAP
You can also enable the SoftAP by following these directions:
* Hold down the user button
* Press and release the reset button
* Count to two
* Let go of the user button
This will reboot the device with the SSID set to `meshtasticAdmin` and the password set to `12345678`. Using the Force SoftAP method, once you reboot, the SoftAP will be turned off.
### WiFi Client
With `wifi_ssid` & `wifi_password` populated, the device will now to connect to your network. Make sure you are in range of your WiFi. If you have a single device on your local network it's easy to connect to your device `http://meshtastic.local`. If you have multiple devices you will need to connect using their respective IP addresses.
2021-04-20 12:28:55 -07:00
To disable WiFi completely, set `wifi_ap_mode` to `false`, and both `wifi_ssid` & `wifi_password` to an empty string `""`.
2021-05-05 09:18:44 -07:00
## Examples
### Enable WiFi (as client)
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
2021-05-05 09:18:44 -07:00
]}>
<TabItem value="cli">
```bash title="Enabling WiFi Client"
meshtastic --set wifi_ap_mode false --set wifi_ssid mywifissid --set wifi_password mywifipassword
```
:::note
If your `wifi_ssid` or `wifi_password` contain spaces, be sure to put quotation marks around the whole thing:
```bash title="Example with spaces"
meshtastic --set wifi_ssid "my wifi ssid" --set wifi_password "my wifi password"
2021-04-20 12:28:55 -07:00
```
2021-05-05 09:18:44 -07:00
:::
</TabItem>
<TabItem value="android">
2022-02-02 12:01:32 -08:00
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2021-05-05 09:18:44 -07:00
</TabItem>
</Tabs>
2021-04-20 12:28:55 -07:00
In the above example, the device will join a network with the SSID `mywifissid` and the password `mywifipassword`.
2021-05-05 09:18:44 -07:00
### Enable WiFi (as SoftAP)
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
2021-05-05 09:18:44 -07:00
]}>
<TabItem value="cli">
2021-05-04 06:41:51 -07:00
2021-05-05 09:18:44 -07:00
```bash title="Software Access Point Example"
meshtastic --set wifi_ap_mode true --set wifi_ssid mywifissid --set wifi_password mywifipassword
```
:::note
If your `wifi_ssid` or `wifi_password` contain spaces, be sure to put quotation marks around the whole thing:
```bash title="Example with spaces"
meshtastic --set wifi_ssid "my wifi ssid" --set wifi_password "my wifi password"
2021-05-04 06:41:51 -07:00
```
2021-05-05 09:18:44 -07:00
:::
</TabItem>
<TabItem value="android">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2021-05-05 09:18:44 -07:00
</TabItem>
</Tabs>
2021-05-04 06:41:51 -07:00
In the above example, the device will broadcast a network with the SSID `mywifissid` and the password `mywifipassword`.
2021-05-05 09:18:44 -07:00
### Disable WiFi Completely
<Tabs
groupId="settings"
defaultValue="cli"
values={[
{label: 'CLI', value: 'cli'},
{label: 'Android', value: 'android'},
{label: 'iOS', value: 'iOS'},
{label: 'Web', value: 'web'},
2021-05-05 09:18:44 -07:00
]}>
<TabItem value="cli">
```bash title="Example - Disabling WiFi"
meshtastic --set wifi_ap_mode false --set wifi_ssid "" --set wifi_password ""
```
</TabItem>
<TabItem value="android">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="iOS">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
</TabItem>
<TabItem value="web">
:::info
Configuring this setting is not yet available for the selected platform. If this is incorrect please update the documentation for this page.
:::
2021-05-05 09:18:44 -07:00
</TabItem>
</Tabs>