meshtastic/docs/settings/config/network.mdx

177 lines
4.8 KiB
Plaintext
Raw Normal View History

2022-06-24 19:42:37 -07:00
---
2022-09-22 14:17:02 -07:00
id: network
title: Network Configuration
sidebar_label: Network
2022-06-24 19:42:37 -07:00
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2022-09-22 14:17:02 -07:00
The Network config options are: WiFi Enabled, WiFi Mode, WiFi SSID, WiFi PSK, and NTP Server. Network config uses an admin message sending a `Config.Network` protobuf.
2022-06-24 19:42:37 -07:00
:::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.
2022-08-02 22:29:52 -07:00
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. The device can be either a WiFi client or a software access point. It **cannot** operate as both at the same time.
2022-06-24 19:42:37 -07:00
2022-09-22 14:17:02 -07:00
## Network Config Values
### NTP Server
2022-09-23 10:43:46 -07:00
The NTP server used if IP networking is available.
2022-09-22 14:17:02 -07:00
2022-09-23 10:43:46 -07:00
Set to `0.pool.ntp.org` by default. (Max Length: 33)
2022-06-24 19:42:37 -07:00
2022-10-05 06:25:07 -07:00
### WiFi Enabled
2022-08-08 16:56:18 -07:00
2022-09-23 10:43:46 -07:00
Enables or Disables WiFi.
2022-09-22 14:17:02 -07:00
2022-09-23 10:43:46 -07:00
Set to `false` (Disabled) by default.
2022-08-08 16:56:18 -07:00
2022-08-02 22:29:52 -07:00
### WiFi SSID
2022-09-22 14:17:02 -07:00
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.
2022-08-02 22:29:52 -07:00
2022-09-23 10:43:46 -07:00
Empty `""` by default. (Case Sensitive, Max Length: 33)
2022-09-22 14:17:02 -07:00
2022-09-23 10:43:46 -07:00
### WiFi PSK
2022-09-22 14:17:02 -07:00
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.
2022-08-02 22:29:52 -07:00
2022-09-23 10:43:46 -07:00
Empty `""` by default. (Case Sensitive, Max Length: 64)
2022-08-08 16:56:18 -07:00
### WiFi Mode
2022-06-24 19:42:37 -07:00
2022-10-19 19:23:37 -07:00
Used to set WiFi mode.
2022-09-22 14:17:02 -07:00
2022-10-19 19:23:37 -07:00
Set to [`CLIENT`](#wifi-client) by default.
2022-09-22 14:17:02 -07:00
2022-08-08 16:56:18 -07:00
#### Acceptable values
2022-06-24 19:42:37 -07:00
2022-08-08 16:56:18 -07:00
| Value | Description |
| :-------: | :--------------------------: |
2022-09-22 14:17:02 -07:00
| `CLIENT` | Client |
2022-09-23 10:43:46 -07:00
| `ACCESS_POINT` | (SoftAP) [Software Access Point](#software-access-point) |
| `ACCESS_POINT_HIDDEN` | (SoftAP) Software Access Point (Hidden) |
2022-06-24 19:42:37 -07:00
:::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.
:::
2022-09-22 14:17:02 -07:00
## Network Config Client Availability
2022-06-24 19:42:37 -07:00
<Tabs
groupId="settings"
defaultValue="flasher"
values={[
{label: 'Android', value: 'android'},
{label: 'Apple', value: 'apple'},
2022-06-29 22:33:26 -07:00
{label: 'CLI', value: 'cli'},
2022-06-24 19:42:37 -07:00
{label: 'Flasher', value: 'flasher'},
{label: 'Web', value: 'web'},
]}>
2022-09-22 14:17:02 -07:00
2022-06-24 19:42:37 -07:00
<TabItem value="android">
:::info
2022-09-22 14:17:02 -07:00
Network config is not available for Android.
2022-06-24 19:42:37 -07:00
:::
</TabItem>
2022-09-22 14:17:02 -07:00
2022-06-24 19:42:37 -07:00
<TabItem value="apple">
:::info
2022-09-22 14:17:02 -07:00
Network config is not available on Apple OS's.
2022-06-24 19:42:37 -07:00
:::
</TabItem>
2022-09-22 14:17:02 -07:00
2022-06-24 19:42:37 -07:00
<TabItem value="cli">
2022-09-22 14:17:02 -07:00
All Network config options are available in the python CLI.
2022-06-24 19:42:37 -07:00
| Setting | Acceptable Values | Default |
| :-----------: | :---------------: | :-----: |
2022-09-22 14:17:02 -07:00
| network.ntp_server | string | `0.pool.ntp.org` |
| network.wifi_enabled | `true`, `false` | `false` |
| network.wifi_psk | string | `""` |
| network.wifi_ssid | string | `""` |
| network.wifi_mode | `CLIENT`, `ACCESS_POINT`, `ACCESS_POINT_HIDDEN` | `CLIENT` |
```shell title="Set NTP Server"
meshtastic --set network.ntp_server "0.pool.ntp.org"
```
2022-06-24 19:42:37 -07:00
2022-08-08 16:56:18 -07:00
```shell title="Enable / Disable WiFi"
2022-09-22 14:17:02 -07:00
meshtastic --set network.wifi_enabled true
meshtastic --set network.wifi_enabled false
2022-06-24 19:42:37 -07:00
```
```shell title="Make Access Point Hidden"
2022-09-22 14:17:02 -07:00
meshtastic --set network.wifi_mode ACCESS_POINT_HIDDEN
2022-06-24 19:42:37 -07:00
```
```shell title="Set WiFi SSID"
2022-06-24 19:42:37 -07:00
2022-09-22 14:17:02 -07:00
meshtastic --set network.wifi_ssid mynetwork
// With spaces
2022-09-22 14:17:02 -07:00
meshtastic --set network.wifi_ssid "my network"
2022-06-24 19:42:37 -07:00
```
```shell title="Set WiFi password"
2022-09-22 14:17:02 -07:00
meshtastic --set network.wifi_psk mypassword
// With spaces
2022-09-22 14:17:02 -07:00
meshtastic --set network.wifi_psk "my password"
2022-06-24 19:42:37 -07:00
```
</TabItem>
2022-09-22 14:17:02 -07:00
2022-06-24 19:42:37 -07:00
<TabItem value="flasher">
:::info
2022-09-22 14:17:02 -07:00
All Network config options are available in the Flasher.
2022-06-24 19:42:37 -07:00
:::
2022-09-22 14:17:02 -07:00
</TabItem>
<TabItem value="web">
2022-06-24 19:42:37 -07:00
:::info
2022-09-22 14:17:02 -07:00
All Network config options are available in the Web UI.
2022-06-24 19:42:37 -07:00
:::
2022-09-22 14:17:02 -07:00
</TabItem>
2022-06-24 19:42:37 -07:00
</Tabs>
2022-08-02 22:29:52 -07:00
## Examples
2022-06-24 19:42:37 -07:00
### WiFi Client
2022-09-23 10:43:46 -07:00
With `network.wifi_ssid` & `network.wifi_psk` populated, the device will know to connect to your network. Make sure you are in range of your WiFi. If you have a single Meshtastic device on your local network it's easy to connect to your device with DNS `http://meshtastic.local`. If you have multiple Meshtastic devices you will need to connect using their respective IP addresses.
2022-06-24 19:42:37 -07:00
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
2022-09-22 14:17:02 -07:00
To disable WiFi completely, set `network.wifi_enabled` to `false`.