mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-22 11:17:49 +10:00
fix: update PiWebServer docs for macOS and add explicit cstring include
Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/3ce82582-23e0-4afe-b22f-b24f81721488 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com>
This commit is contained in:
co-authored by
thebentern
parent
ca1d4172db
commit
51f6168a76
@@ -1,22 +1,32 @@
|
|||||||
/*
|
/*
|
||||||
Adds a WebServer and WebService callbacks to meshtastic as Linux Version. The WebServer & Webservices
|
Adds a WebServer and WebService callbacks to meshtastic via the Portduino/native target (Linux and
|
||||||
runs in a real linux thread beside the portdunio threading emulation. It replaces the complete ESP32
|
macOS). The WebServer & Webservices run in a real host thread beside the Portduino threading
|
||||||
Webserver libs including generation of SSL certifcicates, because the use ESP specific details in
|
emulation. It replaces the complete ESP32 Webserver libs including generation of SSL certificates,
|
||||||
the lib that can't be emulated.
|
because those libs use ESP-specific details that can't be emulated.
|
||||||
|
|
||||||
The WebServices adapt to the two major phoneapi functions "handleAPIv1FromRadio,handleAPIv1ToRadio"
|
The WebServices adapt to the two major phoneapi functions "handleAPIv1FromRadio,handleAPIv1ToRadio"
|
||||||
The WebServer just adds basaic support to deliver WebContent, so it can be used to
|
The WebServer just adds basic support to deliver WebContent, so it can be used to
|
||||||
deliver the WebGui definded by the WebClient Project.
|
deliver the WebGui defined by the WebClient Project.
|
||||||
|
|
||||||
Steps to get it running:
|
Steps to get it running:
|
||||||
1.) Add these Linux Libs to the compile and target machine:
|
|
||||||
|
Linux (apt):
|
||||||
|
1.) Add these libs to the compile and target machine:
|
||||||
|
|
||||||
sudo apt update && \
|
sudo apt update && \
|
||||||
apt -y install openssl libssl-dev libopenssl libsdl2-dev \
|
apt -y install openssl libssl-dev libopenssl libsdl2-dev \
|
||||||
libulfius-dev liborcania-dev
|
libulfius-dev liborcania-dev
|
||||||
|
|
||||||
|
macOS (Homebrew):
|
||||||
|
1.) Install prerequisites via Homebrew:
|
||||||
|
|
||||||
|
brew install ulfius openssl
|
||||||
|
|
||||||
|
The PlatformIO env (native-macos) picks up compiler/linker flags automatically
|
||||||
|
via `pkg-config` for ulfius, liborcania, libyder, and openssl.
|
||||||
|
|
||||||
2.) Configure the root directory of the web Content in the config.yaml file.
|
2.) Configure the root directory of the web Content in the config.yaml file.
|
||||||
The followinng tags should be included and set at your needs
|
The following tags should be included and set at your needs
|
||||||
|
|
||||||
Example entry in the config.yaml
|
Example entry in the config.yaml
|
||||||
Webserver:
|
Webserver:
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
// Used by getMacAddr()'s macOS fallback to read the en0 link-layer address.
|
// Used by getMacAddr()'s macOS fallback to read the en0 link-layer address.
|
||||||
// `getifaddrs()` is the BSD-portable way; `<net/if_dl.h>` provides the
|
// `getifaddrs()` is the BSD-portable way; `<net/if_dl.h>` provides the
|
||||||
// `sockaddr_dl` cast and the `LLADDR()` macro that points at the 6-byte MAC.
|
// `sockaddr_dl` cast and the `LLADDR()` macro that points at the 6-byte MAC.
|
||||||
|
#include <cstring> // strcmp, memcpy
|
||||||
#include <ifaddrs.h>
|
#include <ifaddrs.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <net/if_dl.h>
|
#include <net/if_dl.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user