mirror of
https://github.com/meshtastic/meshtastic.git
synced 2024-11-13 17:14:25 -08:00
336 lines
9.2 KiB
Plaintext
336 lines
9.2 KiB
Plaintext
---
|
||
id: wifi
|
||
title: WiFi Configuration
|
||
sidebar_label: WiFi
|
||
---
|
||
|
||
import Tabs from '@theme/Tabs';
|
||
import TabItem from '@theme/TabItem';
|
||
|
||
The WiFi config options are: AP Mode, Hidden AP, SSID and Password. WiFi config uses an admin message sending a `Config.WiFi` protobuf.
|
||
|
||
:::info
|
||
Enabling WiFi will disable bluetooth. Only one connection method will work at a time.
|
||
:::
|
||
|
||
ESP32 devices have the ability to connect to WiFi as a client and also are able to create a software based access point (SoftAP). WiFi can be configured in either mode.
|
||
|
||
:::note
|
||
The device can be either a WiFi client or a software access point. It **cannot** operate as both at the same time.
|
||
:::
|
||
|
||
You can [force the device to boot into SoftAP mode](#software-access-point) by rebooting the device with the program switch depressed. If forced into AP mode, it will revert to previous settings after a reboot.
|
||
|
||
## WiFi Config Values
|
||
|
||
### Software Access Point (AP)
|
||
|
||
A boolean value that toggles the [Software Access Point](#software-access-point)
|
||
|
||
Acceptable values are `true` or `false`
|
||
|
||
### Hidden Access Point (AP)
|
||
|
||
A boolean value that toggles the hidden access point
|
||
|
||
Acceptable values are `true` or `false`
|
||
|
||
If set, the node AP will broadcast as a hidden SSID
|
||
|
||
### 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.
|
||
|
||
### 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.
|
||
|
||
:::tip
|
||
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.
|
||
:::
|
||
|
||
## WiFi Config Client Availability
|
||
|
||
<Tabs
|
||
groupId="settings"
|
||
defaultValue="flasher"
|
||
values={[
|
||
{label: 'Android', value: 'android'},
|
||
{label: 'Apple', value: 'apple'},
|
||
{label: 'Command Line', value: 'cli'},
|
||
{label: 'Flasher', value: 'flasher'},
|
||
{label: 'Web', value: 'web'},
|
||
]}>
|
||
<TabItem value="android">
|
||
|
||
:::info
|
||
WiFi config is not available for Android.
|
||
:::
|
||
|
||
</TabItem>
|
||
<TabItem value="apple">
|
||
|
||
:::info
|
||
|
||
WiFi config is not available on Apple OS's.
|
||
:::
|
||
|
||
</TabItem>
|
||
<TabItem value="cli">
|
||
|
||
All WiFi config options are available in the python CLI.
|
||
|
||
| Setting | Acceptable Values | Default |
|
||
| :-----------: | :---------------: | :-----: |
|
||
| wifi_ap_mode | `true`, `false` | `false` |
|
||
| wifi_ap_hidden | `true`, `false` | `false` |
|
||
| wifi_password | string | `""` |
|
||
| wifi_ssid | string | `""` |
|
||
|
||
```shell title="Enable / Disable SoftAP"
|
||
meshtastic --set wifi_ap_mode true
|
||
meshtastic --set wifi_ap_mode false
|
||
```
|
||
|
||
```shell title="Make Access Point Hidden"
|
||
meshtastic --set wifi_ap_hidden false
|
||
```
|
||
|
||
```shell title="Set WiFi SSID"
|
||
|
||
meshtastic --set wifi_ssid mynetwork
|
||
// With spaces
|
||
meshtastic --set wifi_ssid "my network"
|
||
```
|
||
|
||
```shell title="Set WiFi password"
|
||
meshtastic --set wifi_password mypassword
|
||
// With spaces
|
||
meshtastic --set wifi_password "my password"
|
||
```
|
||
|
||
</TabItem>
|
||
<TabItem value="flasher">
|
||
|
||
:::info
|
||
Available in the flasher.
|
||
:::
|
||
|
||
</TabItem>
|
||
<TabItem value="web">
|
||
|
||
:::info
|
||
Available in the web ui.
|
||
:::
|
||
|
||
</TabItem>
|
||
</Tabs>
|
||
|
||
## 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.
|
||
|
||
If you set your SoftAP up using a client like the CLI and have a screen attached to your device, the final page will display something similar to the following:
|
||
|
||
```
|
||
WiFi: Software AP
|
||
IP: 192.168.42.1 (0/4)
|
||
SSID: myNetwork / PWD: myPassword (alternating)
|
||
http://meshtastic.local
|
||
* * * * *
|
||
```
|
||
|
||
You should then be able to connect to the node using either the displayed IP address or the HTTP link.
|
||
|
||
#### 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.
|
||
|
||
If you have a screen attached to your device, the final page will display something similar to the following:
|
||
|
||
```
|
||
WiFi: Software AP (Admin)
|
||
IP: 192.168.42.1 (0/4)
|
||
SSID: meshtasticAdmin / PWD: 12345678 (alternating)
|
||
http://meshtastic.local
|
||
* * * * *
|
||
```
|
||
|
||
You should then be able to connect to the node using either the displayed IP address or the HTTP link.
|
||
|
||
### 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.
|
||
|
||
If you have a screen attached to your device, the final page will display something similar to the following:
|
||
|
||
```
|
||
WiFi: Software AP (Admin)
|
||
IP: 192.168.42.1 (0/4)
|
||
SSID: myNetwork
|
||
http://meshtastic.local
|
||
* * * * *
|
||
```
|
||
|
||
You should then be able to connect to the node using either the displayed IP address or the HTTP link.
|
||
|
||
### Disable WiFi
|
||
|
||
To disable WiFi completely, set `wifi_ap_mode` to `false`, and both `wifi_ssid` & `wifi_password` to an empty string `""`.
|
||
|
||
## 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'},
|
||
]}>
|
||
<TabItem value="cli">
|
||
|
||
```shell 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:
|
||
|
||
```shell title="Example with spaces"
|
||
meshtastic --set wifi_ssid "my wifi ssid" --set wifi_password "my 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.
|
||
:::
|
||
|
||
</TabItem>
|
||
</Tabs>
|
||
|
||
In the above example, the device will join a network with the SSID `mywifissid` and the password `mywifipassword`.
|
||
|
||
### 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'},
|
||
]}>
|
||
<TabItem value="cli">
|
||
|
||
```shell 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:
|
||
|
||
```shell title="Example with spaces"
|
||
meshtastic --set wifi_ssid "my wifi ssid" --set wifi_password "my 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.
|
||
:::
|
||
|
||
</TabItem>
|
||
</Tabs>
|
||
|
||
In the above example, the device will broadcast a network with the SSID `mywifissid` and the password `mywifipassword`.
|
||
|
||
### 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'},
|
||
]}>
|
||
<TabItem value="cli">
|
||
|
||
```shell 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.
|
||
:::
|
||
|
||
</TabItem>
|
||
</Tabs>
|