Merge pull request #257 from jfirwin/add-wifi-bluetooth-annotation

Add wifi bluetooth annotation
This commit is contained in:
Sacha Weatherstone 2022-02-25 15:22:02 +11:00 committed by GitHub
commit d92b95c274
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 162 deletions

View file

@ -6,9 +6,13 @@ sidebar_label: WiFi
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
:::info
Enabling WiFi will disable bluetooth. Only one method will work at a time.
:::
## 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.
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). WiFi can be configured in either mode with the settings below. 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.
:::note
The device can be either a WiFi client or a software access point. It **cannot** operate as both at the same time.
@ -174,6 +178,18 @@ Configuring this setting is not yet available for the selected platform. If this
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:
@ -185,10 +201,36 @@ You can also enable the SoftAP by following these directions:
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

View file

@ -1,117 +0,0 @@
---
id: device-wifi
title: WiFi on ESP32 devices
sidebar_label: WiFi
---
:::note
Enabling WiFi will disable Bluetooth. Only one method will work at a time.
:::
The ESP32 based devices have the ability to connect to WiFi and also are able to create a software based access point. The WiFi can be set up through the python API. The WiFi can also be set to AP mode by rebooting the device with the program switch depressed.
## Setting up WiFi in host mode
To enable WiFi access to an existing access point, you need to set two preferences:
* `wifi_ssid`
* `wifi_password`
This can be done using the python CLI
```bash title="Expected output"
$ meshtastic --set wifi_ssid dogsRuleCatsDrool --set wifi_password butDogsFearCats
Connected to radio
Set wifi_ssid to dogsRuleCatsDrool
Set wifi_password to butDogsFearCats
Writing modified preferences to device
```
Once connected, if you have a screen attached to your device, the final page will display something similar to the following:
```
WiFi: Connected RSSI-63
IP: 192.168.1.89
SSID: dogsRuleCatsDrool
http://meshtastic.local
* * * * *
```
You should then be able to connect to the node using either the displayed IP address or the HTTP link.
To disable the WiFi, set the preferences to empty strings.
```bash title="Expected output"
$ meshtastic --set wifi_ssid "" --set wifi_password ""
Connected to radio
Set wifi_ssid to
Set wifi_password to
Writing modified preferences to device
```
## Setting up WiFi in AP mode
The device can also be set up in access point mode and is capable of hosting up to four connected devices. The access point is enabled by setting the following preferences:
* `wifi_ap_mode`
* `wifi_ssid`
* `wifi_password`
### Setting up the AP using the python CLI
Use the following command to set the preferences:
```bash title="Expected output"
$ meshtastic --set wifi_ssid dogsRuleCatsDrool --set wifi_password butDogsFearCats --set wifi_ap_mode true
Connected to radio
Set wifi_ssid to dogsRuleCatsDrool
Set wifi_password to butDogsFearCats
Set wifi_ap_mode to true
Writing modified preferences to device
```
Once set, if you 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: dogsRuleCatsDrool - alternating with - PWD: butDogsFearCats
http://meshtastic.local
* * * * *
```
:::note
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.
:::
To disable the WiFi access point, set the preferences to empty strings and the `wifi_ap_mode` to `false`
```bash title="Expected output"
$ meshtastic --set wifi_ssid "" --set wifi_password "" --set wifi_ap_mode false
Connected to radio
Set wifi_ssid to
Set wifi_password to
Set wifi_ap_mode to false
Writing modified preferences to device
```
### Setting up the AP using the admin mode
This allows you to set up the access point mode without needing to use a computer to set the preferences. This is the easiest way to turn on the device WiFi. Do the following after the device has been powered on:
* Hold down the user button
* Press and release the reset button
* Count to 2
* Let go of the user button
On reboot, 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 - alternating with - PWD: 12345678
http://meshtastic.local
* * * * *
```
To disable the WiFi access point, simply reboot your device.

View file

@ -10,29 +10,7 @@ Pre-requisite: You have Meshtastic Device firmware between version 1.0.32 - 1.1.
We do realize this installation method is not "easy" and are exploring ways to simplify this in the future, ideally rolling it out as part of the device firmware.
Once you have your device loaded with the Meshtastic Device firmware you need to connect to it's Wifi and then manually upload the web interface files.
### Connect to device Wifi
The easiest way to turn on the device Wifi is to do the following after the device has been powered on:
* Hold down the user button
* Press and release the reset button
* Count to 2
* Let go of the user button
:::note
Some devices call this the “prog” button. On devices with two buttons where one is a reset button — its usually the other one. On T-beam devices it is the middle button.
:::
The device will now go into WiFi SoftAP Admin Mode. In this mode, your device will broadcast the following credentials on a built in Access Point:
* SSID: meshtasticAdmin
* Password: 12345678
:::note
The first time your device restarts after enabling WiFi, 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.
:::
Once you have your device loaded with the Meshtastic Device firmware you need to connect to it's Wifi and then manually upload the web interface files.
### Upload web interface files
@ -40,27 +18,14 @@ The first time your device restarts after enabling WiFi, it will take an additio
### Wifi configuration
To enable WiFi to access the web interface, you must at minimum set two preferences:
:::info
Enabling WiFi will disable bluetooth. Only one method will work at a time.
:::
`wifi_ssid`
`wifi_password`
For the Wifi features to be enabled, those two properties must be set.
To turn it off, either preference must be set as an empty string, that is a pair of double quotes each:
`wifi_ssid ""`
`wifi_password ""`
Alternatively, you can enable the internal Soft Access Point:
`wifi_ap_mode true`
With that enabled, we will broadcast a new Wifi network with the SSID and password you set. In AP mode, your device will act as a Captive Portal with a built in DNS server that resolves all name requests back to the device. Additionally, Apple Captive Portal Assistant is implemented -- if you're on an Apple device, the web interface will pop up automagically.
To turn it off, simply reboot the device.
Right now, the only way to set those preference is through the Meshtastic-python command line tool. At some point, we will be able to configure this from your mobile phone over Bluetooth.
WiFi configuration is required to use the web interface. Any method of set up will work:
- [Device as a client](/docs/settings/wifi#enable-wifi-as-client)
- [Device as an access point](/docs/settings/wifi#enable-wifi-as-softap)
- [Force SoftAP (admin)](/docs/settings/wifi#force-softap)
:::note
The first time your device restarts after enabling WiFi, 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.

View file

@ -8,7 +8,6 @@ module.exports = {
"software/device/device-channels",
"software/device/device-remote-admin",
"software/device/remote-hardware-service",
"software/device/device-wifi",
"software/device/device-power",
"software/device/critical-error-codes",
"software/device/ham",