Merge branch 'master' into python-cli-guide

This commit is contained in:
rcarteraz 2023-07-28 14:17:06 -07:00 committed by GitHub
commit b54231cd57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 151 deletions

View file

@ -1,10 +0,0 @@
---
id: building
title: Building
sidebar_label: Building
---
Releases are automatically generated for every commit as per out [CI](https://github.com/meshtastic/web/blob/master/.github/workflows/main.yml). This performs two actions:
1. Generates a perpetually updated [GitHub release](https://github.com/meshtastic/web/releases/tag/latest) with an accompanying `build.tar` that a automatically get's pulled by the firmware CI at build time.
2. A hosted version is deployed to [client.meshtastic.org](https://client.meshtastic.org).

View file

@ -1,100 +1,66 @@
---
id: web-interface
title: Development Overview of the Web Interface
sidebar_label: Web Interface
title: Web Client Development
sidebar_label: Web Client
sidebar_position: 4
---
## Considerations
## Overview
We have a total of 458,752 bytes (448KB) available on the SPIFFS (Serial Peripheral Interface Flash File System) -- the on-board storage of the ESP32. Of that space, let's not use more than half of that (224KB) in order to leave space for other uses.
The Meshtastic web interface can be hosted or served from a node.
Right now, the Meshtastic Device Preferences as well as SSL keys use that space. We can imagine other future uses as well, such as logging chat messages and possibly saving received signal strength with GPS coordinates to create coverage heat maps.
The official hosted version can be found at [https://client.meshtastic.org](https://client.meshtastic.org).
## Static Files
The version served from a node can be accessed by first [connecting your node to your network](/docs/settings/config/network) and then navigating to http://meshtastic.local (or your_node_ip.local).
Static files can be placed in the /data folder. All files should be compressed in the .gz format with a .gz extension regardless of the file type.
As an example, this would mean we will have files such as:
## Development & Building
- style.css.gz
- meshtastic.js.gz
- meshtasticlogo.png.gz
### Development
Unless otherwise stated, files in the `/data` folder of the source code will be stored in `/static` on the device.
Clone the [Meshtastic Web Repo](https://github.com/meshtastic/web) repository
```shell
git clone https://github.com/meshtastic/web.git
cd web
```
## Application Interface
Install the dependencies.
We make extensive use of [Meshtastic.js](https://github.com/meshtastic/meshtastic.js).
```bash
pnpm i
```
### Building
## Embedded Server
Build the project:
### Root
```bash
pnpm build
```
When requesting to the root of the web server, the either /static/index.html or /static/index.html.gz will be fetched from the file system and served to the client. We require that the file is in the gzip format. Serving an uncompressed file is not supported. If both index.html and index.html.gz are on the filesystem, index.html will be served and index.html.gz will be ignored.
Start the development server:
### /static
```bash
pnpm dev
```
All files stored in /data/static in the Meshtastic source code will be available in /static on the Meshtastic device.
### Packaging
If a file is uploaded in a .gz format, the .gz extension will be stripped prior to being served to the client. Keep your filenames as short as possible. Short filenames work better than long file names.
Build the project:
An experimental file system browser with upload and delete capability is available by going to either:
```bash
pnpm build
```
- http://meshtastic.local/static
- https://meshtastic.local/static
GZip the output:
There are known issues with uploading files with large file sizes.
```bash
pnpm package
```
The current preferred method to upload data is through PlatformIO and the file system browser is provided without guarantees.
### /restart
## Releases
A post to this location will cause the device to restart.
Releases are automatically generated for every commit as per out [CI](https://github.com/meshtastic/web/blob/master/.github/workflows/main.yml). This performs two actions:
### /favicon.ico
The Meshtastic logo in .ico format.
### /hotspot-detect.html
Used by the Apple Captive Portal Assistant.
### /upload
Endpoint to upload files. Used by the file manager.
### /json/report
Return a report of airtime statistics and current status.
Formula to calculate when the current time period will roll over:
`data.airtime.seconds_per_period - (data.airtime.seconds_since_boot % data.airtime.seconds_per_period)`
### /json/scanNetworks
Returns a json data structure of WiFi networks in the area. It's recommended to call this at least 2 or 3 times and combine the results.
We purposely exclude open (insecure) networks from the list.
### /json/spiffs/browse/static
Returns a json data structure with the contents of /static.
If a filename includes a '.gz' extension, will also return a modified version of the filename with the extension stripped. This is to support the functionality in /static (see above).
### /json/spiffs/delete/static
Delete file specified by the parameter "delete". Use the method "DELETE".
eg: /json/spiffs/delete/static?delete=static/something.txt
### Performance
As a general guide, the ESP32 will return HTTP requests significantly faster than HTTPS requests. For responses of 1kb or less, expect the following for real world performance:
HTTP - 3.0 requests / sec
HTTPS - 0.4 requests / sec
The bottleneck of HTTPS is with the SSL handshake. We will get better performance serving one large file rather than multiple small files.
1. Generates a perpetually updated [GitHub release](https://github.com/meshtastic/web/releases/tag/latest) with an accompanying `build.tar` that a automatically get's pulled by the firmware CI at build time.
2. A hosted version is deployed to [client.meshtastic.org](https://client.meshtastic.org).

View file

@ -1,67 +0,0 @@
---
id: esp32-partitions
title: Managing ESP32 partitions
sidebar_label: ESP32 partitions
---
:::caution
It has been reported that some of this information is out of date.
FIXME - Investigate and rewrite document to reflect the current ESP32 Partition mitigation.
:::
## Insufficient space to upload web interface files
This problem seems to occur when your board has the partitioning structure set incorrectly. This typically occurs when the board has had a firmware other than Meshtastic on it previously. In this situation, the file upload page on the device typically shows a free space of around 48,000 bytes, rather than the ~300,000 bytes that it should have free.
![Meshtastic.local's upload page showing insufficient storage space](/img/insufficient-space.png)
There are a number of methods that essentially involve erasing the flash and then re-uploading the Meshtastic firmware.
## Install Script
The most reliable way to fix this problem is to use the install script that is included in the meshtastic firmware zip. If that doesnt work, these other methods may work:
## Alternative methods
### Using the Arduino IDE:
https://meshtastic.discourse.group/t/solved-help-installing-with-other-than-esphome-flasher/2214/9
### Using Pio in Windows
```powershell
pio run --target erase --environment tbeam
```
Then re-install the firmware ie using ESPHome Flasher.
Requires: [Python](https://www.python.org), [Pio](https://pypi.org/project/pio), command to be run in the root directory of the firmware project once youve cloned it (this last requirement is an assumption based on pio not knowing what a tbeam is, may also require Visual Studio Code and PlatformIO as these were installed during use).
### Esptool.py
@1984 posted another method using the python based esptool.py to erase and re-flash the firmware:
```shell
esptool.py --baud 921600 erase_flash
esptool.py --baud 921600 write_flash 0x1000 system-info.bin
esptool.py --baud 921600 write_flash 0x00390000 spiffs-*.bin
esptool.py --baud 921600 write_flash 0x10000 firmware-tbeam-EU865-1.1.42.bin
```
Requires: [Python](https://www.python.org) and [esptool.py](https://github.com/espressif/esptool)
### Visual Studio & PlatformIO
There is also the method of using the Visual Studio IDE. This requires having Visual Studio and PlatformIO installed, along with having cloned the firmware code as per the [build instructions](/docs/development/firmware/build). After loading the project in Visual Studio, select the PlatformIO alien icon, then find the appropriate device, and then click the Erase Flash command.
![Erasing the flash using PlatformIO in Visual Studio Code](/img/platformio-erase.png)
https://meshtastic.discourse.group/t/configuring-channel-via-python-api/1948/17
Requires: [Visual Studio Code](https://code.visualstudio.com), [PlatformIO](https://platformio.org), cloned copy of the Meshtastic Firmware project
## How do I know it's worked?
Once it has been successfully erased and re-flashed, visiting https://192.168.42.1/static should leave you with free space on the order of 300,000 bytes, rather than the ~48,000 bytes you currently have. You can then upload the files from the meshtastic web release.
Occasionally, this may glitch may appear when uploading the larger app.js.gz file, but a further erase and flash typically solves this.

View file

@ -21,7 +21,7 @@ values={[
<TabItem value="android">
:::info
As of this writing, the current Android release of the nRF DFU app (v2.3.0) is not compatible with Meshtastic firmware updates.
As of this writing, the current Android release of the nRF DFU app (v2.3.0) is not compatible with Meshtastic firmware updates. Please use the instructions below for updating via OTA with the nRF Connect App.
:::
OTA firmware updates are available for Android using an older release of the more advanced nRF Connect App __version 4.24.3__ which is available for download from the [Nordic Semiconductor GitHub page](https://github.com/NordicSemiconductor/Android-nRF-Connect/releases/tag/v4.24.3).