Merge branch 'main' into OSC

This commit is contained in:
Ruledo 2025-02-19 03:22:43 -08:00
commit 6edf85dd0f
38 changed files with 934 additions and 3631 deletions

View file

@ -4,15 +4,19 @@
# Femtofox &nbsp;&nbsp;&nbsp;<sub><sub>The tiny, low power Linux Meshtastic node
**Femtofox is a Linux-based mesh development platform - a Raspberry Pi sized computer with onboard LoRa radio, capable of being run with only 0.3w, making it *ideal* for solar powered nodes.**
The Luckfox Pico Mini is the postage stamp sized heart of the Femtofox - a compact and power efficient Linux board, running a customized version of Ubuntu. Femtofox is an expansion of the Luckfox's capabilities, utilizing a custom PCB with a 30db LoRa radio (over 6x the transmit power of a RAK Wisblock or Heltec V3) to create a power efficient, tiny and highly capable Meshtastic Linux node.
The Luckfox Pico Mini is the postage stamp sized heart of the Femtofox - a compact and power efficient Linux board, running Foxbuntu, our own customized version of Ubuntu. Femtofox is an expansion of the Luckfox's capabilities, utilizing a custom PCB with a 30db LoRa radio (over 6x the transmit power of a RAK Wisblock or Heltec V3) to create a power efficient, tiny and highly capable Meshtastic Linux node.
- [Features](#features)
- Specifications - coming soon
Find out more in the sections below, or in the [Wiki](https://github.com/femtofox/femtofox/wiki).
- [Features](#features) and [Specifications](#Specification)
- [Supported hardware](https://github.com/femtofox/femtofox/wiki/Supported-Hardware)
- [Installation guide](https://github.com/femtofox/femtofox/wiki/Getting-Started)
- How to order - coming soon
- How to order
- [Etsy (USA)](https://www.etsy.com/listing/1861858340/femtofox-pro-v1-kit-compact-arm-linux)
- [Tindie (UK)](https://www.tindie.com/products/edit/femtofox-pro-v1-kit-linux-meshtastic-node/)
- [DIY instructions](https://github.com/femtofox/Femtofox_Community_Hardware)
- [USB configuration tool](https://github.com/femtofox/femtofox/wiki/USB-Config-Tool)
- [USB configuration tool](https://github.com/femtofox/femtofox/wiki/USB-Configuration-Tool)
- [Building your own Foxbuntu image](https://github.com/femtofox/femtofox/wiki/Building-Foxbuntu-%28WSL%29)
### Features
* Tiny size (63x54mm for Femtofox, 65x30mm for the Smol Edition). Equivalent to a standard Raspberry Pi hat and Pi Zero respectively.
@ -23,10 +27,28 @@ The Luckfox Pico Mini is the postage stamp sized heart of the Femtofox - a compa
* USB wifi support
* RTC support for timekeeping
### Specification
| Feature | Specification |
| ------------ | ------------------------------------------------------- |
| Processor | Rockchip RV1103, Cortex A7 \@1.1GHz |
| Memory | 64MB DDR2 |
| OS | Foxbuntu (based on Ubuntu 22.04.5 LTS Jammy) |
| Connectivity | USB 2.0 Host/Device |
| Network | RJ45 Ethernet with filtering<br> |
| | WiFi ready |
| GPIO | 17x GPIO pins (of which 8 are required for Lora module) |
| IO | 2x I2C JST PH |
| | 1x UART JST PH |
| Debug | 1x CH340 USB to serial adapter (Pro only) |
| Mesh | 30dB LoRa Radio 868-915MHz |
| Storage | Micro-SD slot |
| Power | 3.3-5V.dc via JST PH or USB-C |
| Dimensions | 63 x 54 x 19mm |
**Accomplished:**
- [x] Meshtastic native client controlling a LoRa radio (see [supported hardware](supported_hardware.md))
- [x] WIFI over USB (see [supported hardware](supported_hardware.md))
- [x] Ethernet over USB (see [supported hardware](supported_hardware.md))
- [x] Ethernet over pins (see *Networking* below and wiring diagram at bottom of page)
- [x] UART communications with Meshtastic nodes (2 pin pairs) such as RAK Wisblock
- [x] USB serial communications with Meshtastic nodes (see [supported hardware](supported_hardware.md))

View file

@ -23,7 +23,7 @@ ln -sf /usr/share/zoneinfo/UTC /etc/localtime
echo "Installing packages..."
apt update
DEBIAN_FRONTEND=noninteractive apt install -y --option Dpkg::Options::="--force-confold" linux-firmware wireless-tools git python3.10-venv libgpiod-dev libyaml-cpp-dev libbluetooth-dev openssl libssl-dev libulfius-dev liborcania-dev evtest screen avahi-daemon protobuf-compiler telnet fonts-noto-color-emoji ninja-build chrony qrencode software-properties-common python-is-python3 python3.10-venv lsof spi-tools python3-luma.oled samba
DEBIAN_FRONTEND=noninteractive apt install -y --option Dpkg::Options::="--force-confold" linux-firmware wireless-tools git python3.10-venv libgpiod-dev libyaml-cpp-dev libbluetooth-dev openssl libssl-dev libulfius-dev liborcania-dev evtest screen avahi-daemon protobuf-compiler telnet fonts-noto-color-emoji ninja-build chrony qrencode software-properties-common python-is-python3 python3.10-venv lsof spi-tools python3-luma.oled samba vim mtd-utils jq rsync
if [[ $? -eq 2 ]]; then echo "Error, step failed..."; fi
DEBIAN_FRONTEND=noninteractive apt upgrade -y --option Dpkg::Options::="--force-confold"

View file

@ -1,2 +1 @@
first_boot=true
act_led=enable

View file

@ -1,5 +1,5 @@
major=0
minor=99
major=1
minor=0
patch=0
hotfix=

View file

@ -0,0 +1,11 @@
# this sets the mac address source to eth0, replacing the previous code that derived a seed from the CPU s/n.
# of course, eth0 also has its mac address derived from CPU s/n, but this way meshtastic uses the exact mac address, instead of a bastardized version converted to a 9 digit int with `| bc | tail -c -9`.
General:
MACAddressSource: eth0
# this activates the webserver
Webserver:
Port: 443 # Port for Webserver & Webservices
RootPath: /usr/share/meshtasticd/web # Root Dir of WebServer
SSLKey: /etc/meshtasticd/ssl/private_key.pem # Path to SSL Key, generated if>
SSLCert: /etc/meshtasticd/ssl/certificate.pem # Pa

View file

@ -1,7 +1,7 @@
[Unit]
Description=Boot Complete
After=serial-getty@ttyFIQ0.service
DefaultDependencies=no
After=multi-user.target
[Service]
ExecStart=/usr/local/bin/femto-boot-complete.sh
@ -11,4 +11,4 @@ StandardOutput=journal+console
StandardError=journal+console
[Install]
WantedBy=default.target
WantedBy=default.target

View file

@ -1,6 +1,6 @@
[Unit]
Description=Foxbuntu First Boot
After=meshtasticd.service
After=rc-local.service
Before=serial-getty@ttyFIQ0.service
DefaultDependencies=no

View file

@ -1,6 +1,6 @@
[Unit]
Description=Foxbuntu USB Configuration Tool
After=meshtasticd.service
After=rc-local.service
Before=serial-getty@ttyFIQ0.service
DefaultDependencies=no

View file

@ -1,6 +1,4 @@
[Service]
ExecStart=
ExecStart=/bin/sh -c '/usr/sbin/meshtasticd -h $(sed -n "/Serial/ s/^.*: \\(.*\\)$/\\U\\1/p" /proc/cpuinfo | bc | tail -c 9)'
Nice=-20
[Unit]

View file

@ -0,0 +1,7 @@
[Unit]
After=femto-boot-complete.service multi-user.target
Conflicts=getty.target
Before=getty.target
[Service]
ExecStartPre=/bin/sleep 0.5

View file

@ -12,11 +12,11 @@ if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
fi
[ -r /etc/lsb-release ] && . /etc/lsb-release
foxbuntu_version=$(grep -oP 'major=\K[0-9]+' /etc/foxbuntu-release).$(grep -oP 'minor=\K[0-9]+' /etc/foxbuntu-release)$(output=$(grep -o 'patch=[1-9][0-9]*' /etc/foxbuntu-release | cut -d= -f2) && [ -n "$output" ] && echo ".$output")$(grep -oP 'hotfix=\K[a-z]+' /etc/foxbuntu-release)
spaces=$((11 - ${#foxbuntu_version}))
foxbuntu_version=$(femto-utils.sh -v)
spaces=$((21 - ${#foxbuntu_version}))
printf " For settings, run \`\033[0;31msudo femto-config\033[0m\`\n"
printf " Made for Femtofox https://www.femtofox.com\n"
printf " Foxbuntu v$foxbuntu_version%*s%s(%s)\n\n" $spaces "" "$DISTRIB_DESCRIPTION" "$(uname -r)"
printf " $foxbuntu_version%*s%s(%s)\n\n" $spaces "" "$DISTRIB_DESCRIPTION" "$(uname -r)"
printf "IP address: $(hostname -I | sed 's/ / /g') Uptime:$(uptime -p | awk '{$1=""; print $0}' | sed -e 's/ day\b/d/g' -e 's/ hour\b/h/g' -e 's/ hours\b/h/g' -e 's/ minute\b/m/g' -e 's/ minutes\b/m/g' | sed 's/,//g')\n"

View file

@ -27,7 +27,7 @@ form_text_color = (WHITE,CYAN,ON)
form_item_readonly_color = (BLUE,WHITE,ON)
# Item help-text color
itemhelp_color = (BLACK,BLUE,OFF)
itemhelp_color = (WHITE,BLUE,OFF)
# Selected tag color (menu items)
tag_selected_color = (WHITE,BLUE,ON)

View file

@ -1,6 +1,6 @@
#!/bin/bash
if grep -qE '^first_boot=true' /etc/femto.conf; then
log_message "First boot, skipping \`boot complete\` tasks."
echo "First boot, skipping \`boot complete\` tasks."
exit 0
fi

View file

@ -21,7 +21,7 @@ loading() {
}
## function to pull data from various femto scripts and convert it to the contents of a read only dialog --form
# ingest_data() { # usage: `ingest_data "command.sh -argument" key_width value_width`
# ingest_form_data() { # usage: `ingest_form_data "command.sh -argument" key_width value_width`
# unset output_array #debug code, delete me
# declare -a output_array
# # Read the output from femto-meshtasticd-config.sh and store it in the array
@ -42,7 +42,7 @@ loading() {
# echo "$form_contents" | sed 's/\x1b\[[0-9;]*m//g'
# }
## CODE TO USE THIS FUNCTION:
# eval "$(echo -e "dialog --no-collapse --no-cancel --form \"Meshtastic node info\" 0 0 0 $(ingest_data "femto-meshtasticd-config.sh -i" 18 0) 2>/dev/null")"
# eval "$(echo -e "dialog --no-collapse --no-cancel --form \"Meshtastic node info\" 0 0 0 $(ingest_form_data "femto-meshtasticd-config.sh -i" 18 0) 2>/dev/null")"
# function to pull data from various femto scripts and convert it a simple text string, with dialog colors
@ -62,10 +62,16 @@ ingest_data() { # usage: `ingest_data "command.sh -argument" key_width`
}
check_meshtasticd_running() {
if echo $(femto-utils.sh -C "meshtasticd") | grep -q "not running"; then
if ! echo $(femto-utils.sh -C "meshtasticd") | sed 's/\x1b\[[0-9;]*m//g' | grep -q ", running"; then
dialog --no-collapse --title "Meshtasticd service" --yesno "Meshtasticd service is not running but is required.\n\nStart service?" 9 50
if [ $? -eq 0 ]; then #unless cancel/no
femto-meshtasticd-config.sh -s
echo "Waiting for meshtasticd service to start..."
sleep 3
if ! echo $(femto-utils.sh -C "meshtasticd") | sed 's/\x1b\[[0-9;]*m//g' | grep -q ", running"; then
dialog --no-collapse --colors --title "Meshtasticd service" --msgbox "Meshtasticd service ($(femto-utils.sh -R "$(femto-utils.sh -C "meshtasticd")")) failed to run, but is required." 7 50
return 1
fi
return 0
else
return 1
@ -186,7 +192,7 @@ networking_settings() {
if [ $exit_status -eq 1 ]; then # Exit the loop if the user selects "Cancel" or closes the dialog
break
elif [ $exit_status -eq 2 ]; then # Help ("extra") button
dialog --no-collapse --colors --title "Meshtastic wifi sync service help" --msgbox "The Meshtastic wifi sync service synchronizes wifi settings with Meshtastic wifi settings. This allows you to use remote node administration to enable/disable Femtofox wifi.\n\nIn future, this will also allow you to reconfigure SSID and password.\n" 0 0
dialog --no-collapse --colors --title "Meshtastic wifi sync service help" --msgbox "The Meshtastic wifi sync service synchronizes system wifi settings with Meshtastic wifi settings. This allows you to use Meshtastic's remote node administration feature to enable/disable wifi.\n\nIn future, this will also allow you to reconfigure SSID and password.\n" 0 0
else
case $choice in
"View detailed service status")
@ -242,7 +248,7 @@ utilities() {
utilities_choice=$(dialog --no-collapse --cancel-label "Back" --default-item "$utilities_choice" --item-help --menu "$title" 21 50 4 \
1 "View system info" "" \
2 "Set system time" "" \
3 "Kernel modules" "" \
3 "Kernel module manager" "" \
4 "Re-run first-boot script" "" \
5 "Run USB configuration tool" "" \
6 "Run OEM luckfox-config" "" \
@ -260,9 +266,9 @@ utilities() {
sysinfo_choice="" # zero the choice before loading the submenu
while true; do
echo $sysinfo_choice
sysinfo_choice=$(dialog --no-collapse --help-button --cancel-label "Back" --default-item "$sysinfo_choice" --item-help --menu "System info" 17 40 5 \
1 "CPU" "" \
2 "Operating system" "" \
sysinfo_choice=$(dialog --no-collapse --help-button --backtitle "$(femto-utils.sh -v)" --cancel-label "Back" --default-item "$sysinfo_choice" --item-help --menu "System info" 17 40 5 \
1 "Operating system" "" \
2 "CPU" "" \
3 "Storage & memory" "" \
4 "Peripherals & devices" ""\
5 "Networking" "" \
@ -274,17 +280,17 @@ utilities() {
if [ $exit_status -eq 1 ]; then # Exit the loop if the user selects "Cancel" or closes the dialog
break
elif [ $exit_status -eq 2 ]; then # Help ("extra") button
dialog --no-collapse --colors --title "System info help" --msgbox "To get system info in terminal (where it can be copied), enter \`\Zusudo femto-utils.sh -i\Zn\`.\n\nWhen getting Peripherals & Devices (or Complete System Info) without an i2c device connected, it is normal to see error messages on serial console.\n" 0 0
dialog --no-collapse --colors --title "System info help" --msgbox "To get system info in terminal (where it can be copied), enter \`\Zusudo femto-utils.sh -i\Zn\`.\n\nWhen getting Peripherals & Devices Info (or Complete System Info) without an i2c device connected, it is normal to see error messages on serial console.\n" 0 0
else
case $sysinfo_choice in
1) # CPU)
loading "Loading CPU info..."
dialog --no-collapse --colors --title "CPU info" --msgbox "$(ingest_data "femto-utils.sh -c" 15)" 0 0
;;
2) # Operating system)
1) # Operating system)
loading "Loading operating system info..."
dialog --no-collapse --colors --title "Operating system info" --msgbox "$(ingest_data "femto-utils.sh -o" 15)" 0 0
;;
2) # CPU)
loading "Loading CPU info..."
dialog --no-collapse --colors --title "CPU info" --msgbox "$(ingest_data "femto-utils.sh -c" 15)" 0 0
;;
3) # Storage & memory)
loading "Loading storage & memory info..."
dialog --no-collapse --colors --title "Storage & memory info" --msgbox "$(ingest_data "femto-utils.sh -S" 15)" 0 0
@ -314,7 +320,6 @@ utilities() {
;;
2) femto-set-time.sh ;; # set timezone
3) # Kernel modules)
dialog --no-collapse --title "$title" --msgbox "Kernel modules are loadable pieces of code that extend a Linux kernel's functionality without requiring a reboot. Common examples include device drivers, file systems, or system calls.\n\nThis tool will allow you to add pre-compiled modules to the Foxbuntu kernel.\n\nModules currently autostarting at boot: $(modules=$(sed -n '6,$p' /etc/modules | sed ':a;N;$!ba;s/\n/, /g;s/, $//'); [ -z "$modules" ] && echo "none" || echo "$modules")\n\nCurrently active modules: $(lsmod | awk 'NR>1 {print $1}' | tr '\n' ' ')" 18 65
femto-kernel-modules.sh
;;
4) femto-runonce.sh ;; # Re-run first-boot script
@ -380,67 +385,6 @@ utilities() {
done
}
#set lora radio
set_lora_radio() {
choice="" # zero the choice before loading the submenu
while true; do
echo "Checking LoRa radio..."
#Display filename, if exists: $(files=$(ls /etc/meshtasticd/config.d/* 2>/dev/null) && [ -n "$files" ] && echo "\n\nConfiguration files in use:\n$files" | paste -sd, -))
choice=$(dialog --no-collapse --colors --cancel-label "Cancel" --default-item "$choice" --title "Meshtastic LoRa radio" --item-help --menu "Currently configured LoRa radio:\n$(femto-utils.sh -R "$(femto-meshtasticd-config.sh -k)")$(ls -1 /etc/meshtasticd/config.d 2>/dev/null | paste -sd ', ' - | sed 's/^/ (/; s/$/)/; s/,/, /g' | grep -v '^ ()$')" 22 50 10 \
"Radio name:" "Configuration:" "" \
"" "" "" \
"Ebyte e22-900m30s" "(SX1262_TCXO)" "Included in Femtofox Pro" \
"Ebyte e22-900m22s" "(SX1262_TCXO)" "" \
"Ebyte e80-900m22s" "(SX1262_XTAL)" "" \
"Heltec ht-ra62" "(SX1262_TCXO)" "" \
"Seeed wio-sx1262" "(SX1262_TCXO)" "" \
"Waveshare sx126x-xxxm" "(SX1262_XTAL)" "Not recommended due issues with sending longer messages" \
"AI Thinker ra-01sh" "(SX1262_XTAL)" "" \
"LoRa Meshstick 1262" "(meshstick-1262)" "USB based LoRa radio from Mark Birss. https://github.com/markbirss/MESHSTICK" \
"Simulated radio" "(none)" "" \
" " "" "" \
"Skip" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
local radio=""
case $choice in
"Ebyte e22-900m30s")
radio="sx1262_tcxo"
;;
"Ebyte e22-900m22s")
radio="sx1262_tcxo"
;;
"Ebyte e80-900m22s")
radio="sx1262_xtal"
;;
"Heltec ht-ra62")
radio="sx1262_tcxo"
;;
"Seeed wio-sx1262")
radio="sx1262_tcxo"
;;
"Waveshare sx126x-xxxm")
radio="sx1262_xtal"
;;
"AI Thinker ra-01sh")
radio="femto_sx1262_xtal"
;;
"LoRa Meshstick 1262")
radio="lora-meshstick-1262"
;;
"Simulated radio")
radio="none"
;;
"Skip")
return
;;
esac
if [ -n "$radio" ]; then #if a radio was selected
femto-meshtasticd-config.sh -l "$radio" -s # set the radio, then restart meshtasticd
return
fi
done
}
legacy_admin() {
choice="" # zero the choice before loading the submenu
while true; do
@ -482,18 +426,17 @@ meshtastic_settings() {
local title="Meshtastic Settings"
while true; do
echo "Checking Meshtasticd service state..."
meshtastic_choice=$(dialog --no-collapse --colors --title "$title" --cancel-label "Back" --default-item "$meshtastic_choice" --item-help --menu "Meshtasticd service is $(femto-utils.sh -R "$(femto-utils.sh -C "meshtasticd")")$(femto-meshtasticd-config.sh -k | grep -q 'simulated' && echo '\n\Z1Warning: using simulated radio\Zn')" 19 50 4 \
meshtastic_choice=$(dialog --no-collapse --colors --title "$title" --cancel-label "Back" --default-item "$meshtastic_choice" --item-help --menu "Meshtasticd service is $(femto-utils.sh -R "$(femto-utils.sh -C "meshtasticd")")$(femto-meshtasticd-config.sh -k | grep -q 'simulated' && echo '\n\Z1Warning: using simulated radio\Zn')" 18 50 4 \
1 "View node info" "" \
2 "View configuration URL & QR code" "" \
3 "Set new configuration URL" "" \
4 "Set LoRa radio" "" \
5 "Security settings" "" \
6 "Mesh connectivity test" "" \
7 "Manage Meshtasticd service" "" \
8 "Upgrade/install Meshtasticd" "" \
9 "Uninstall Meshtasticd" "" \
3 "LoRa settings" "" \
4 "Security settings" "" \
5 "Mesh connectivity test" "" \
6 "Manage Meshtasticd service" "" \
7 "Upgrade/install Meshtasticd" "" \
8 "Uninstall Meshtasticd" "" \
" " "" "" \
10 "Back to main menu" "" 3>&1 1>&2 2>&3)
9 "Back to main menu" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
case $meshtastic_choice in
1) # view node info)
@ -509,24 +452,10 @@ meshtastic_settings() {
pause
)
;;
3) # set URL)
check_meshtasticd_running && (
newurl=$(dialog --no-collapse --title "Meshtastic URL" --inputbox "New Meshtastic LoRa configuration URL (SHIFT+INS to paste):" 8 60 3>&1 1>&2 2>&3)
if [ -n "$newurl" ]; then #if a URL was entered
dialog --no-collapse --title "$title" --yesno "New Meshtastic LoRa configuration URL:\n$newurl\n\nConfirm?" 15 60
if [ $? -eq 0 ]; then #unless cancel/no
loading "Sending command..."
dialog --no-collapse --colors --title "Meshtastic URL" --msgbox "$(femto-meshtasticd-config.sh -q "$newurl" && echo -e "\n\Z4Command successful!\Zn\n" || echo -e "\n\Z1Command failed.\Zn\n")" 0 0
fi
fi
)
3) # LoRa settings)
femto-meshtasticd-lora-dialogs.sh
;;
4) # set radio)
check_meshtasticd_running && (
set_lora_radio
)
;;
5) # remote admin)
4) # remote admin)
check_meshtasticd_running && (
choice="" # zero the choice before loading the submenu
while true; do
@ -602,7 +531,7 @@ meshtastic_settings() {
done
)
;;
6) #test mesh connectivity)
5) #test mesh connectivity)
check_meshtasticd_running && (
dialog --no-collapse --title "Meshtastic Connectivity Test" --yesno "Will send \"test\" to channel 0 and wait for acknowledgement. Will try up to 3 times.\n\nPerform test?" 10 45
if [ $? -eq 0 ]; then #unless cancel/no
@ -611,7 +540,7 @@ meshtastic_settings() {
fi
)
;;
7) #manage meshtasticd service)
6) #manage meshtasticd service)
choice="" # zero the choice before loading the submenu
while true; do
echo "Checking Meshtasticd service state..."
@ -664,21 +593,21 @@ meshtastic_settings() {
esac
done
;;
8) #Upgrade meshtasticd)
7) #Upgrade meshtasticd)
dialog --no-collapse --title "$title" --yesno "Upgrade Meshtasticd?\nRequires internet connection." 0 0
if [ $? -eq 0 ]; then #unless cancel/no
femto-meshtasticd-config.sh -z
pause
fi
;;
9) #uninstall meshtasticd)
8) #uninstall meshtasticd)
dialog --no-collapse --colors --title "$title" --yesno "Uninstall Meshtasticd?\n\nFoxbuntu was designed with Meshtasticd integration in mind, and may behave unexpectedly if Meshtasticd is removed.\n\nThis will take the node \Zu\Z1OFFLINE\Zn and will not restart!" 0 0
if [ $? -eq 0 ]; then
femto-meshtasticd-config.sh -x
dialog --no-collapse --colors --msgbox "Meshtasticd uninstalled. To purge all remnants, run \`\Zusudo apt purge\Zn\`." 8 40
fi
;;
10)
9)
return
;;
esac
@ -702,7 +631,7 @@ help_menu() {
[ $? -eq 1 ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
case $help_choice in
1) #About Femtofox)
dialog --no-collapse --title "About Femtofox" --default-item "$choice" --backtitle "Foxbuntu $(grep -oP 'major=\K[0-9]+' /etc/foxbuntu-release).$(grep -oP 'minor=\K[0-9]+' /etc/foxbuntu-release).$(grep -oP 'patch=\K[0-9]+' /etc/foxbuntu-release)$(grep -oP 'hotfix=\K[a-z]+' /etc/foxbuntu-release)" --msgbox "$(femto-license.sh -a)" 18 65
dialog --no-collapse --title "About Femtofox" --default-item "$choice" --backtitle "$(femto-utils.sh -v)" --msgbox "$(femto-license.sh -a)" 18 65
;;
2) #Display pinout)
choice="" # zero the choice before loading the submenu
@ -755,14 +684,15 @@ Options are:\n\
-l Set LoRa radio model menu\n\
-L Meshtastic legacy admin menu\n\
-w Set Wi-Fi config menu\
-c Check if Meshtasticd is running and warn the user if not\
"
while getopts ":hlwLi" opt; do
while getopts ":hlLwc" opt; do
case ${opt} in
h) # Option -h (help)
echo -e $help
;;
l) # Option -l (set lora radio)
set_lora_radio
femto-meshtasticd-lora-dialogs.sh # this function has moved
;;
L) # Option -L (Meshtastic legacy admin menu)
legacy_admin
@ -770,6 +700,10 @@ while getopts ":hlwLi" opt; do
w) # Option -w (Wi-Fi config)
wifi_config
;;
c) # Option -c (Check if Meshtasticd is running and warn the user if not)
check_meshtasticd_running
exit $?
;;
\?) # Unknown option)
echo -e "Unknown argument $1.\n$help"
;;
@ -779,7 +713,7 @@ done
# Main menu
while true; do
main_menu_choice=$(dialog --no-collapse --cancel-label "Exit" --backtitle "Foxbuntu v$(grep -oP 'major=\K[0-9]+' /etc/foxbuntu-release).$(grep -oP 'minor=\K[0-9]+' /etc/foxbuntu-release)$(output=$(grep -o 'patch=[1-9][0-9]*' /etc/foxbuntu-release | cut -d= -f2) && [ -n "$output" ] && echo ".$output")$(grep -oP 'hotfix=\K[a-z]+' /etc/foxbuntu-release)" --default-item "$main_menu_choice" --item-help --menu "Femtofox Config" 16 40 5 \
main_menu_choice=$(dialog --no-collapse --cancel-label "Exit" --backtitle "$(femto-utils.sh -v)" --default-item "$main_menu_choice" --item-help --menu "Femtofox Config" 16 40 5 \
1 "Settings wizard" "" \
2 "Networking" "" \
3 "Meshtastic" "" \

View file

@ -33,13 +33,7 @@ wizard() {
dialog --title "$title" --cancel-label "Skip" --yesno "Configure Meshtastic?" 6 40
if [ $? -eq 0 ]; then #unless cancel/no
femto-config -l #set lora radio model
newurl=$(dialog --title "Meshtastic URL" --inputbox "New Meshtasticd URL (SHIFT+INS to paste):" 8 50 3>&1 1>&2 2>&3)
if [ -n "$newurl" ]; then #if a URL was entered
loading "Sending URL..."
dialog --no-collapse --colors --title "Meshtastic URL" --msgbox "$(femto-meshtasticd-config.sh -q "$newurl" && echo -e "\n\Z4Command successful!\Zn\n" || echo -e "\n\Z1Command failed.\Zn\n")" 0 0
fi
femto-meshtasticd-lora-dialogs.sh -w
# public key
loading "Getting current public key..."

View file

@ -1,13 +1,26 @@
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
echo "Try \`sudo femto-config\`."
exit 1
fi
help=$(cat <<EOF
If script is run without arguments, a dialog menu UI will load.
Options are:
-h This message
-b List kernel modules set to load at boot
-a List active kernel modules
-x "kernelmodule" "enable" Set kernel module status (enable/disable)
-z "kernelmodule" "blacklist" Set kernel module blacklist status (blacklist/un-blacklist)
-y Get list of blacklisted kernel modules
EOF
)
module_dir="/lib/modules/5.10.160"
title="Kernel Module Manager"
module_switch() {
if [ $2 = "enable" ]; then
modprobe $1 # Load the selected module
@ -15,76 +28,144 @@ module_switch() {
if ! grep -Fxq "$1" /etc/modules; then # Add the module to /etc/modules if not already present
echo "$1" >> /etc/modules
fi
echo "$1 has been enabled and will be started at boot."
echo -e "\033[4m$1\033[0m has been enabled and will be started at boot.\n\nSome modules are unloaded automatically when not in use."
else
echo -e "Failed to enable \033[4m$1\033[0m."
exit 1
fi
elif [ $2 = "disable" ]; then
rmmod $1 # Disable the module
if [ $? -eq 0 ]; then
sed -i "/^$1$/d" /etc/modules
echo "$1 has been disabled and removed from boot."
else
exit 1
fi
rmmod $1 > /dev/null 2>&1 # Unload the module
sed -i "/^$1$/d" /etc/modules
echo -e "\033[4m$1\033[0m has been disabled and removed from boot.\n\nIt may be automatically loaded if compatible hardware is detected."
else
echo "Invalid argument \"$2\".\n$help"
fi
}
module_blacklist() {
if [ $1 = "list" ]; then
echo -e "$(ls "$module_dir"/*.blacklisted 2>/dev/null | sed -E 's|.*/([^.]*)\..*|\1|' | awk '{for(i=1;i<=NF;i++) {printf "\033[4m%s\033[0m", $i; if(i<NF) printf " ";} printf " ";} END {if (NR == 0) print "\033[4mnone\033[0m"}')"
elif [ $2 = "blacklist" ]; then
mv "$module_dir/$1.ko" "$module_dir/$1.ko.blacklisted" > /dev/null 2>&1
module_switch $1 disable > /dev/null 2>&1 # unload and disable the module
echo -e "$1 is blacklisted. A reboot is sometimes required for blacklisting to fully take effect."
elif [ $2 = "un-blacklist" ]; then
mv "$module_dir/$1.ko.blacklisted" "$module_dir/$1.ko" > /dev/null 2>&1
echo -e "$1 is un-blacklisted. A reboot is sometimes required for un-blacklisting to fully take effect."
else
echo "Invalid argument \"$1 $2\".\n$help"
fi
}
# Parse options
while getopts ":hx" opt; do
while getopts ":hbax:z:y" opt; do
case ${opt} in
h) # Option -l (set lora radio)
echo "$help"
exit 0
;;
b) # kernel modules set to start at boot)
echo -e "$(modules=$(sed -n '6,$p' /etc/modules | awk '{printf "\033[4m%s\033[0m ", $0}'); [ -z "$modules" ] && echo "\033[4mnone\033[0m" || echo "$modules")"
;;
a) # kernel modules currently active)
echo -e "$(modules=$(lsmod | awk 'NR>1 {printf "\033[4m%s\033[0m ", $1}'); [ -z "$modules" ] && echo "none" || echo "$modules")"
;;
x) # Option -x (Set kernel module status (enable/disable))
echo "$(module_switch $2 $3)"
;;
z) # Option -z (Set kernel module blacklist status (blacklist/un-blacklist))
echo "$(module_blacklist $2 $3)"
;;
y) # Option -y (Get list of blacklisted kernel modules)
echo "$(module_blacklist "list")"
;;
esac
done
if [ -n "$1" ]; then # if there are arguments, don't proceed to menu
exit
fi
dialog --infobox "Loading kernel module menu..." 5 45
dialog --no-collapse --colors --title "$title" --yesno "\
Kernel modules are loadable pieces of code that extend a Linux kernel's functionality without requiring a reboot. Common examples include device drivers, file systems, or system calls.\n\
\n\
This tool will allow you to manage kernel modules and add pre-compiled modules to Foxbuntu.\n\
\n\
Boot modules: $(femto-utils.sh -R "$(femto-kernel-modules.sh -b)")\n\
Blacklisted modules: $(femto-utils.sh -R "$(femto-kernel-modules.sh -y)")\n\
Active modules: $(femto-utils.sh -R "$(femto-kernel-modules.sh -a)")\n\
\n\
Continue?
" 0 0
[ ! $? -eq 0 ] && exit 1
modules=()
load_modules() {
dialog --infobox "Loading kernel module menu...\n\nExpected load time: 35 seconds." 6 45
modules=("Module name" "L/D Description" "" "")
# Create a list of modules (filename minus the .ko)
for module in $(ls "/lib/modules/5.10.160"/*.ko); do
module_name=$(basename "$module" .ko)
modules+=("$module_name" "$(modinfo $module_name | grep -i 'description' | cut -d: -f2 | sed 's/^[ \t]*//')")
done
# Create a list of modules (filename minus the .ko)
for module in $(ls $module_dir/*.ko*); do
module_name=$(basename "$module" | sed 's/\([^.]*\).*/\1/')
modules+=("$module_name" "$(lsmod | grep -q "^$module_name " && echo ✅ || echo ❌)$(femto-kernel-modules.sh -b | sed 's/\x1b\[[0-9;]*m//g' | grep -qw "$module_name" && echo ✅ || echo ❌) $(basename "$module" | grep -q "blacklisted" && echo "BLACKLISTED" || modinfo "$module_name" | grep -i 'description' | cut -d: -f2 | sed 's/^[ \t]*//' )")
done
modules_changed="false"
}
load_modules
modules_changed="false"
while true; do
[ $modules_changed = "true" ] && load_modules
# Create the menu options
option=$(dialog --cancel-label "Back" --title "Kernel Modules" --default-item "$selected_module" --menu "" 42 103 8 "${modules[@]}" 3>&1 1>&2 2>&3)
exit_status=$? # Check the exit status of the dialog command
if [ $exit_status -ne 0 ]; then # Exit the loop if the user selects "Cancel" or closes the dialog
selected_module=$(dialog --no-collapse --cancel-label "Return" --ok-label "Open" --title "$title" --no-shadow --default-item "$selected_module" --help-button --menu "" 42 103 8 "${modules[@]}" 3>&1 1>&2 2>&3)
exit_status=$?
if [ $exit_status -eq 1 ]; then # "Return" button
break
fi
# Get the module name from the selection
selected_module=$option
# Get the full modinfo for the module and process it for dialog
modinfo_output=$(modinfo $selected_module | sed ':a;N;$!ba;s/\n/\\n/g') # add \n to module info
# Check if the module is currently enabled
if lsmod | grep -q "^$selected_module "; then
dialog --colors --title "Disable Module" --yesno "The module '$selected_module' is currently \Z4\Zuenabled\Zn.\n\nDo you want to disable it?\n\nFull module info:\n$modinfo_output\n\nNote: Unused dependencies will be removed automatically." 25 0
if [ $? -eq 0 ]; then
dialog --msgbox "$(module_switch $selected_module disable)" 7 60
fi
elif [ $exit_status -eq 2 ]; then # "Help" button
dialog --no-collapse --colors --title "Kernel Module Manager Help" --msgbox "In the kernel module manager menu,\nL=Module is loaded\nB=Module is set to start at boot.\n\nIf module is blacklisted, \`BLACKLISTED\` will show in the description." 0 0
else
dialog --colors --title "Enable Module" --yesno "The module '$selected_module' is currently \Z1disabled\Zn.\n\nDo you want to enable it?\n\nFull module info:\n$modinfo_output\n\nNote: Dependencies will be loaded automatically." 25 0
if [ $? -eq 0 ]; then
dialog --msgbox "$(module_switch $selected_module enable)" 7 60
fi
[ "$selected_module" = "" ] || [ "$selected_module" = "Module name" ] && continue # do nothing if no valid module name is selected
modules_changed="false"
# Get the full modinfo for the module and process it for dialog
while true; do
modinfo_output=$(modinfo $selected_module 2>/dev/null | sed ':a;N;$!ba;s/\n/\\n/g') # add \n to module info
if [ ! -e "$module_dir/$selected_module.ko" ]; then
module_info="\Z1\ZuMODULE BLACKLISTED!\Zn\n\n$selected_module has been blacklisted and will not load on boot.\
$(lsmod | grep -q "^$selected_module " && echo "\n\n$selected_module is currently \Z4\Zuloaded\Zn!\n\
Some modules require reboot for blacklist to take effect if they're in use when blacklisted.")"
else
module_info="Module is currently $(lsmod | grep -q "^$selected_module " && echo "\Z4loaded\Zn" || echo "\Z1unloaded\Zn") and is set $(femto-utils.sh -R "$(femto-kernel-modules.sh -b | sed 's/\x1b\[[0-9;]*m//g' | grep -qw "$selected_module" && echo "\Z4to load at boot\Zn" || echo "\Z1not to load at boot\Zn. It may load automatically if needed")").\n\
\n\
Full module info:\n$modinfo_output\n\nNote: Dependencies are loaded/unloaded automatically."
fi
dialog --colors --yes-label "Return" --no-label "Disable" --extra-button --extra-label "Enable" --help-button --help-label "Blacklist" --title "$selected_module" --yesno "$module_info" 0 0
exit_status=$? # This line checks the exit status of the dialog command
if [ $exit_status -eq 0 ]; then # "Back" button
break
elif [ $exit_status -eq 3 ]; then # "Enable" button
dialog --colors --title "$selected_module" --msgbox "$(femto-utils.sh -R "$(module_switch $selected_module enable)")" 0 0
modules_changed="true"
elif [ $exit_status -eq 1 ]; then # "Disable" button
dialog --colors --title "$selected_module" --msgbox "$(femto-utils.sh -R "$(module_switch $selected_module disable)")" 0 0
modules_changed="true"
elif [ $exit_status -eq 2 ]; then # "Blacklist" button
dialog --no-collapse --colors --title "$selected_module" --yes-label "Return" --no-label "Un-blacklist" --extra-button --extra-label "Blacklist" --yesno "$selected_module is currently $([ -e "$module_dir/$selected_module.ko" ] && echo "\Z4\Zunot blacklisted\Zn" || echo "\Z1\Zublacklisted\Zn").\n\nBlacklisting prevents a kernel module from loading.\n\nWould you like to blacklist $selected_module?" 0 0
exit_status=$?
if [ $exit_status -eq 0 ]; then
continue
elif [ $exit_status -eq 3 ]; then # blacklist
dialog --colors --title "$selected_module" --msgbox "$(femto-utils.sh -R "$(module_blacklist $selected_module blacklist)")" 8 50
modules_changed="true"
else # blacklist
dialog --colors --title "$selected_module" --msgbox "$(femto-utils.sh -R "$(module_blacklist $selected_module un-blacklist)")" 8 50
modules_changed="true"
fi
fi
done
fi
done
exit 0
exit 0

View file

@ -27,7 +27,14 @@ View the long licenses for more information.\n\
Contact us to license Femtofox."
meshtastic_license="\
Meshtastic is a registered trademark of Meshtastic LLC. Meshtastic software components are released under various licenses, see GitHub for details. No warranty is provided - use at your own risk."
The Meshtastic firmware is licensed GPL3.\n\
\n\
Meshtastic is a registered trademark of Meshtastic LLC. Meshtastic software components are released under various licenses, see GitHub for details. No warranty is provided - use at your own risk.\n\
\n\
Some of the verbiage in the help-texts in the menus is sourced from the Meshtastic website, also licensed GPL3.\n\
\n\
For more information about Meshtastic, visit https://www.meshtastic.org\
"
luckfox_license="Luckfox and Luckfox Pico Mini are property of Luckfox Technology. Femtofox does not represent Luckfox Technology in any way, shape or form. Visit their website at https://www.luckfox.com/."

View file

@ -8,6 +8,7 @@ help=$(cat <<EOF
Options are:
-h This message
-i Get important node info
-C "all" Get node configuration, by category. Multiple categories can be selected by comma delineation. \`quiet\`: do not echo to console. Options are \`quiet\`, \`all\`, \`nodeinfo\`, \`settings\`, \`channels\`
-g Gets the current configuration URL and QR code
-k Get current LoRa radio selection
-l "RADIO" Choose LoRa radio model. Options are \`lr1121_tcxo\`, \`sx1262_tcxo\`, \`sx1262_xtal\`, \`none\` (simradio)
@ -45,14 +46,14 @@ meshtastic_update() {
local ref="$3: "
echo "Submitting to Meshtastic..."
for retries in $(seq 1 $attempts); do
local output=$(meshtastic --host $command) #>&2 lets meshtastic's output display on screen
echo $output
local output=$(meshtastic --host $command 2>&1 | tee $(if [ -e /dev/tty ]; then echo /dev/tty; else echo /dev/ttyFIQ0; fi))
logger $output
if echo "$output" | grep -qiE "Abort|invalid|Error|refused|Errno"; then
if [ "$retries" -lt $attempts ]; then
local msg="${ref:+$ref}Meshtastic command failed, retrying ($(($retries + 1))/$attempts)..."
echo "$msg"
logger "$msg"
femto-meshtasticd-config.sh -s
sleep 2 # Add a small delay before retrying
fi
else
@ -67,6 +68,7 @@ meshtastic_update() {
fi
done
if [ -z "$success" ]; then
echo -e "$output"
msg="${ref:+$ref}Meshtastic command FAILED."
echo "$msg"
logger "$msg"
@ -74,53 +76,144 @@ meshtastic_update() {
fi
}
get_meshtastic_settings() {
for retries in $(seq 1 3); do
if meshtastic_info=$(meshtastic --host --info); then # if successful
success="true"
break
else # if failed
if [ "$retries" -lt 3 ]; then # if under 3 retries
echo "Meshtastic command failed, retrying ($(($retries + 1))/3)..."
femto-meshtasticd-config.sh -s
sleep 2 # Add a small delay before retrying
fi
fi
done
if [ -z "$success" ]; then # if failed all retries
echo "Meshtastic command FAILED."
exit 1 # always exit script if failed
fi
if [[ "$1" == *"all"* ]] || [[ "$1" == *"nodeinfo"* ]]; then
# myInfo
eval "myInfo_owner='$(echo "$meshtastic_info" | grep "^Owner: " | sed 's/^Owner: //')'"
[[ "$1" != *"quiet"* ]] && echo "myInfo_owner:$myInfo_owner"
while IFS="=" read -r varname value; do
eval "myInfo_$varname='$value'" # Create a variable with the formatted name
[[ "$1" != *"quiet"* ]] && echo "myInfo_$varname:$value"
done < <(
echo "$(echo "$meshtastic_info" | grep '^My info: ' | sed 's/^My info: //')" |
jq -r 'to_entries[] | "\(.key)=\(.value)"'
)
# metadata
while IFS="=" read -r varname value; do
eval "metadata_$varname='$value'" # Create a variable with the formatted name
[[ "$1" != *"quiet"* ]] && echo "metadata_$varname:$value"
done < <(
echo "$(echo "$meshtastic_info" | grep '^Metadata: ' | sed 's/^Metadata: //')" |
jq -r 'to_entries[] | "\(.key)=\(.value)"'
)
metadata_nodedbCount=$(echo "$meshtastic_info" | grep -oP '"![a-zA-Z0-9]+":\s*\{' | wc -l)
[[ "$1" != *"quiet"* ]] && echo "metadata_nodedbCount:$metadata_nodedbCount"
# nodeinfo
while IFS='=' read -r var value; do
eval "nodeinfo_$var=\"$value\""
[[ "$1" != *"quiet"* ]] && echo "nodeinfo_$var:$value"
done < <(echo "$(echo "$meshtastic_info" | sed -n '/Nodes in mesh:/,$p' | sed '1s/^Nodes in mesh: *//' | sed '/^[[:space:]]*$/q' | jq -r 'to_entries | .[0] | "\(.key)=\(.value)"' | sed 's/^[^=]*=//;s/^[ \t]*}//')" | jq -r '
def recurse:
if type == "object" then
to_entries | .[] | "\(.key)=\(.value | recurse)"
elif type == "array" then
. | tostring
else
.
end;
recurse' | sed '/=/ {s/\(.*\)=\(.*\)=/\1_\2=/; }'
)
fi
if [[ "$1" == *"all"* ]] || [[ "$1" == *"settings"* ]]; then
# settings
while IFS="=" read -r varname value; do
eval "$varname='$value'"
[[ "$1" != *"quiet"* ]] && echo "$varname:$value"
done < <(
echo "$(echo "$meshtastic_info" | sed -n '/Preferences: {/,$p' | sed '1s/.*/{/; /^[[:space:]]*$/q')" |
jq -r 'to_entries[] | select(.value | type == "object") | .key as $block | .value | to_entries[] | "\($block)_\(.key)=\(.value)"'
)
# module settings
while IFS="=" read -r varname value; do
eval "$varname='$value'"
[[ "$1" != *"quiet"* ]] && echo "$varname:$value"
done < <(
echo "$(echo "$meshtastic_info" | sed -n '/Module preferences: {/,$p' | sed '1s/.*/{/; /^[[:space:]]*$/q')" |
jq -r 'to_entries[] | select(.value | type == "object") | .key as $block | .value | to_entries[] | "\($block)_\(.key)=\(.value)"'
)
fi
if [[ "$1" == *"all"* ]] || [[ "$1" == *"channels"* ]]; then
# channels
while read index line; do
channel_type=$(echo "$line" | awk '{print $3}')
psk_type=$(echo "$line" | grep -o 'psk=[^ ]*' | cut -d= -f2)
eval "channel${index}_type='$channel_type'"
[[ "$1" != *"quiet"* ]] && echo "channel${index}_type:$channel_type"
eval "channel${index}_psk_type='$psk_type'"
[[ "$1" != *"quiet"* ]] && echo "channel${index}_psk_type:$psk_type"
# get the json portion of the channel listing
while IFS=":" read -r key value; do
eval "$key='$value'"
[[ "$1" != *"quiet"* ]] && echo "$key:$value"
done < <(
echo "$(echo "$line" | sed 's/.*\({.*\)/\1/')" | jq -r 'to_entries | .[] | "channel'${index}'_\(.key):\(.value)"'
)
done < <(
echo "$meshtastic_info" | awk '/Channels:/ {f=1; next} f && NF {print} f && !NF {exit}' | nl -v 0
)
eval "url_primary_channel='$(echo "$meshtastic_info" | sed -n 's/^Primary channel URL: //p')'"
[[ "$1" != *"quiet"* ]] && echo "url_primary_channel:$url_primary_channel"
eval "url_all_channels='$(echo "$meshtastic_info" | sed -n 's/^Complete URL (includes all channels): //p')'"
[[ "$1" != *"quiet"* ]] && echo "url_all_channels:$url_all_channels"
fi
}
# Parse options
while getopts ":higkl:q:uU:rR:aA:cpo:sM:Stwuxm" opt; do
while getopts ":hiC:gkl:q:uU:rR:aA:cpo:sM:Stwuxm" opt; do
case ${opt} in
h) # Option -h (help)
echo -e "$help"
;;
i) # Option -i (Get important node info)
declare -a output_array
output=$(meshtastic --host --info)
output_array+=("Service=$(femto-meshtasticd-config.sh -S)")
output_array+=("Version=$(echo "$output" | grep -oP '"firmwareVersion":\s*"\K[^"]+' | head -n 1)")
output_array+=("Node name=$(echo "$output" | grep -oP 'Owner:\s*\K.*' | head -n 1)")
output_array+=("NodeID=$(echo "!$(printf "%08x\n" $(echo "$output" | grep -oP '"myNodeNum":\s*\K\d+' | head -n 1))")")
output_array+=("Nodenum=$(echo "$output" | grep -oP '"myNodeNum":\s*\K\d+' | head -n 1)")
output_array+=("TX enabled=$(echo "$output" | grep -oP '"txEnabled":\s*\K\w+')")
use_preset=$(echo "$output" | grep -oP '"usePreset":\s*\K\w+')
output_array+=("Use preset=$use_preset")
if [ "$use_preset" = "true" ]; then # if use-preset is true, then display the preset
output_array+=("Preset=$(echo "$output" | grep -oP '"modemPreset":\s*"\K[^"]+')")
else # otherwise, display the lora settings
output_array+=("Bandwidth=$(echo "$output" | grep -oP '"bandwidth":\s*\K\w+')")
output_array+=("Spread factor=$(echo "$output" | grep -oP '"spreadFactor":\s*\K\w+')")
output_array+=("Coding rate=$(echo "$output" | grep -oP '"codingRate":\s*\K\w+')")
fi
output_array+=("Role=$(echo "$output" | grep -oP '"role":\s*"\K[^"]+' | head -n 1)")
freq_offset=$(echo "$output" | grep -oP '"bandwidth":\s*\K\w+')
if [ "$freq_offset" != 0 ]; then # only display frequency offset if not 0
output_array+=("Freq offset=$freq_offset")
fi
output_array+=("Region=$(echo "$output" | grep -oP '"region":\s*"\K[^"]+')")
output_array+=("Hop limit=$(echo "$output" | grep -oP '"hopLimit":\s*\K\w+')")
freq_slot=$(echo "$output" | grep -oP '"channelNum":\s*\K\d+' | head -n 1)
if [ "$freq_slot" != 0 ]; then # only display frequency slot if not 0
freq_slot+=("Freq slot=$freq_slot")
fi
override_freq=$(echo "$output" | grep -oP '"overrideFrequency":\s*\K[0-9.]+')
if [ "$override_freq" != "0.0" ]; then # only display override frequency if not 0.0
output_array+=("Override freq=$override_freq")
fi
output_array+=("Public key=$(echo "$output" | grep -oP '"publicKey":\s*"\K[^"]+' | head -n 1)")
output_array+=("Nodes in db=$(echo "$output" | grep -oP '"![a-zA-Z0-9]+":\s*\{' | wc -l)")
# now, echo the array
for pair in "${output_array[@]}"; do
key=$(echo "$pair" | cut -d'=' -f1)
value=$(echo "$pair" | cut -d'=' -f2-)
echo "$key:$value"
done
get_meshtastic_settings quiet,nodeinfo,settings
echo -e "\
Service:$(femto-meshtasticd-config.sh -S)
Version:$metadata_firmwareVersion
Node name:$myInfo_owner
NodeID:$nodeinfo_user_id
Nodenum:$myInfo_myNodeNum
TX enabled:$lora_txEnabled
Use preset:$lora_usePreset
Preset:$lora_modemPreset
Bandwidth:$lora_bandwidth
Spread factor:$lora_spreadFactor
Coding rate:$lora_codingRate
Role:$device_role
Freq offset:$lora_frequencyOffset
Region:$lora_region
Hop limit:$lora_hopLimit
Freq slot:$lora_channelNum
Override freq:$lora_overrideFrequency
Public key:$security_publicKey
Nodes in db:$metadata_nodedbCount"
;;
C) # Option -C (Complete node config)
get_meshtastic_settings $OPTARG
;;
g) # Option -g (get config URL)
url=$(meshtastic --host --qr-all | grep -oP '(?<=Complete URL \(includes all channels\): )https://[^ ]+') #add look for errors
@ -130,7 +223,7 @@ while getopts ":higkl:q:uU:rR:aA:cpo:sM:Stwuxm" opt; do
echo $url
;;
k) # Option -k (get current lora radio model)
ls /etc/meshtasticd/config.d 2>/dev/null | xargs -r -n 1 basename | sed 's/^femtofox_//;s/\.yaml$//' | grep . || echo -e "\033[0;31mnone (simulated radio)\033[0m"
ls /etc/meshtasticd/config.d 2>/dev/null | grep '^femtofox_' | xargs -r -n 1 basename | sed 's/^femtofox_//;s/\.yaml$//' | grep . || echo -e "\033[0;31mnone (simulated radio)\033[0m"
;;
l) # Option -l (choose lora radio model)
prepare="rm -f /etc/meshtasticd/config.d/femtofox* && echo \"Radio type $OPTARG selected.\""

View file

@ -0,0 +1,501 @@
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Try \`sudo femto-meshtasticd-config\`."
exit 1
fi
export NCURSES_NO_UTF8_ACS=1
export TERM=xterm-256color
export LANG=C.UTF-8
title="Meshtastic LoRa Settings"
args=$@
send_settings() {
if [ -n "$command" ]; then
set -o pipefail
echo "meshtastic --host $command"
output=$(eval "femto-meshtasticd-config.sh -m '$command' 5 'Save Meshtastic settings'" | tee /dev/tty)
exit_status=$?
set +o pipefail
if [ $exit_status -eq 1 ]; then
dialog --no-collapse --colors --title "$title" --msgbox "$(echo -e "\Z1Command FAILED!\Zn\n\nLog:\n$output")" 0 0
elif [ $exit_status -eq 0 ]; then
dialog --no-collapse --colors --title "$title" --msgbox "$(echo -e "\Z4Command Successful!\Zn\n\nLog:\n$output")" 0 0
fi
fi
[ "$1" = "wizard" ] && [ -z "$args" ] && dialog --no-collapse --title "$title" --colors --msgbox "Meshtastic LoRa Settings Wizard complete!" 6 50 # if in wizard mode AND there are no script arguments, display the message
}
config_url() {
femto-config -c && (
newurl=$(dialog --no-collapse --colors --title "Meshtastic URL" --inputbox "The Meshtastic configuration URL allows for automatic configuration of all Meshtastic LoRa settings and channels.\nEntering a URL may \Z1\ZuOVERWRITE\Zn your LoRa settings and channels!\n\nNew Meshtastic LoRa configuration URL (SHIFT+INS to paste):" 13 63 3>&1 1>&2 2>&3)
if [ -n "$newurl" ]; then #if a URL was entered
command+="--seturl $newurl "
fi
# if we're in wizard mode AND there are no script arguments, then display a message
send_settings $1
)
}
lora_settings_actions() {
if [ "$1" = "set_lora_radio_model" ] || [ "$1" = "wizard" ]; then
choice="" # zero the choice before loading the submenu
while true; do
echo "Checking LoRa radio..."
#Display filename, if exists: $(files=$(ls /etc/meshtasticd/config.d/* 2>/dev/null) && [ -n "$files" ] && echo "\n\nConfiguration files in use:\n$files" | paste -sd, -))
choice=$(dialog --no-collapse --colors --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --default-item "$choice" --title "Meshtastic LoRa radio" --item-help --menu "Currently configured LoRa radio:\n$(femto-utils.sh -R "$(femto-meshtasticd-config.sh -k)")$(ls -1 /etc/meshtasticd/config.d 2>/dev/null | grep -v '^femto_' | paste -sd ', ' - | sed 's/^/ (/; s/$/)/; s/,/, /g' | grep -v '^ ()$')" 22 50 10 \
"Radio name:" "Configuration:" "" \
"" "" "" \
"Ebyte e22-900m30s" "(SX1262_TCXO)" "Included in Femtofox Pro" \
"Ebyte e22-900m22s" "(SX1262_TCXO)" "" \
"Ebyte e80-900m22s" "(SX1262_XTAL)" "" \
"Heltec ht-ra62" "(SX1262_TCXO)" "" \
"Seeed wio-sx1262" "(SX1262_TCXO)" "" \
"Waveshare sx126x-xxxm" "(SX1262_XTAL)" "Not recommended due issues with sending longer messages" \
"AI Thinker ra-01sh" "(SX1262_XTAL)" "" \
"LoRa Meshstick 1262" "(meshstick-1262)" "USB based LoRa radio from Mark Birss. https://github.com/markbirss/MESHSTICK" \
"Simulated radio" "(none)" "" \
" " "" "" \
"$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
local radio=""
case $choice in
"Ebyte e22-900m30s")
radio="sx1262_tcxo"
;;
"Ebyte e22-900m22s")
radio="sx1262_tcxo"
;;
"Ebyte e80-900m22s")
radio="sx1262_xtal"
;;
"Heltec ht-ra62")
radio="sx1262_tcxo"
;;
"Seeed wio-sx1262")
radio="sx1262_tcxo"
;;
"Waveshare sx126x-xxxm")
radio="sx1262_xtal"
;;
"AI Thinker ra-01sh")
radio="femto_sx1262_xtal"
;;
"LoRa Meshstick 1262")
radio="lora-meshstick-1262"
;;
"Simulated radio")
radio="none"
;;
"Skip")
return
;;
esac
if [ -n "$radio" ]; then #if a radio was selected
femto-meshtasticd-config.sh -l "$radio" -s # set the radio, then restart meshtasticd
dialog --no-collapse --colors --title "$title" --msgbox "$(echo -e "Radio \Zu$choice\Zn selected.\nMeshtasticd service restarted.\Zn")" 7 45
break
fi
done
[ "$1" = "set_lora_radio_model" ] && return
fi
if femto-config -c; then
if [ "$1" = "wizard" ]; then
choice="" # zero the choice before loading the submenu
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "Cancel" --default-item "True" --item-help --menu "Meshtastic configuration method" 8 50 0 \
"Automatic configuration with URL" "" "" \
"Manual configuration" "" "" \
" " "" "" \
"Cancel" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] && return # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue #restart loop if no choice made
[ "$choice" == "Manual configuration" ] && break
[ "$choice" == "Automatic configuration with URL" ] && config_url "$1"
return
done
fi
dialog --no-collapse --infobox "Getting current settings from Meshtasticd.\n\nThis can take a minute..." 6 50
while IFS=':' read -r key value; do
eval "${key}=\"${value}\"" # Create a variable with the key name and assign it the value
done < <(sudo femto-meshtasticd-config.sh -C settings)
if [ "$1" = "region" ] || [ "$1" = "wizard" ]; then
options=("UNSET" "US" "EU_433" "EU_868" "CN" "JP" "ANZ" "KR" "TW" "RU" "IN" "NZ_865" "TH" "LORA_24" "UA_433" "UA_868" "MY_433" "MY_919" "SG_923")
menu_items=()
# Create menu options from the array
for i in "${!options[@]}"; do
if [ $i -eq 0 ]; then
menu_items+=("${options[$i]}" "(default)" "") # First item with "(default)"
else
menu_items+=("${options[$i]}" "" "") # Other items without "(default)"
fi
done
menu_items+=("" "" "" "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "")
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --default-item "$lora_region" --item-help --menu "Sets the region for your node. As long as this is not set, the node will display a message and not transmit any packets.\n\nRegion? (current: ${lora_region})" 0 0 0 \
"${menu_items[@]}" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue # Restart loop if no choice made
command+="--set lora.region $choice "
break
done
fi
if [ "$1" = "use_modem_preset" ] || [ "$1" = "wizard" ]; then
choice="" # zero the choice before loading the submenu
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --default-item "${lora_usePreset^}" --item-help --menu "Presets are pre-defined modem settings (Bandwidth, Spread Factor, and Coding Rate) which influence both message speed and range. The vast majority of users use a preset.\n\nUse modem preset? (current: ${lora_usePreset:-unknown})" 0 0 0 \
"True" "(default)" "" \
"False" "" "" \
" " "" "" \
"$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue #restart loop if no choice made
using_preset=$choice
command+="--set lora.use_preset $(echo "$choice" | tr '[:upper:]' '[:lower:]') "
break
done
fi
if [ "$1" = "wizard" ] && [ "$using_preset" = "False" ]; then
dialog --no-collapse --title "$title" --colors --msgbox "Not using preset, so skipping Preset setting." 6 50
else
if [ "$1" = "preset" ] || [ "$1" = "wizard" ]; then
options=("LONG_FAST" "LONG_SLOW" "VERY_LONG_SLOW" "MEDIUM_SLOW" "MEDIUM_FAST" "SHORT_SLOW" "SHORT_FAST" "SHORT_TURBO")
menu_items=()
# Create menu options from the array
for i in "${!options[@]}"; do
if [ $i -eq 0 ]; then
menu_items+=("${options[$i]}" "(default)" "") # First item with "(default)"
else
menu_items+=("${options[$i]}" "" "") # Other items without "(default)"
fi
done
menu_items+=("" "" "" "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "")
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --default-item "${$lora_modemPreset^}" --item-help --menu "The default preset will provide a strong mixture of speed and range, for most users.\n\nPreset? (current: ${lora_modemPreset:-unknown})" 0 0 0 \
"${menu_items[@]}" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue # Restart loop if no choice made
command+="--set lora.modem_preset $choice "
break
done
fi
fi
if [ "$1" = "wizard" ] && [ "$using_preset" = "True" ]; then
dialog --no-collapse --title "$title" --colors --msgbox "Using preset, so skipping Bandwidth, Spread Factor and Coding Rate settings." 7 50
else
if [ "$1" = "bandwidth" ] || [ "$1" = "wizard" ]; then
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --item-help --default-item $lora_bandwidth --menu "Width of the frequency \"band\" used around the calculated center frequency. Only used if modem preset is disabled.\n\nBandwidth? (current: ${lora_bandwidth:-unknown})" 0 0 0 \
0 "(default, automatic)" "" \
31 "" "" \
62 "" "" \
125 "" "" \
250 "" "" \
500 "" "" \
" " "" "" \
"$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue # Restart loop if no choice made
command+="--set lora.bandwidth $choice "
break
done
fi
if [ "$1" = "spread_factor" ] || [ "$1" = "wizard" ]; then
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --item-help --default-item $lora_spreadFactor --menu "Indicates the number of chirps per symbol. Only used if modem preset is disabled.\n\nSpread factor? (current: ${lora_spreadFactor:-unknown})" 0 0 0 \
0 "(default, automatic)" "" \
7 "" "" \
8 "" "" \
9 "" "" \
10 "" "" \
11 "" "" \
12 "" "" \
" " "" "" \
"$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue # Restart loop if no choice made
command+="--set lora.spread_factor $choice "
break
done
fi
if [ "$1" = "coding_rate" ] || [ "$1" = "wizard" ]; then
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --item-help --default-item $lora_codingRate --menu "The proportion of each LoRa transmission that contains actual data - the rest is used for error correction.\n\nCoding rate (only used if modem preset is disabled)? (current: ${lora_codingRate:-unknown})" 0 0 0 \
0 "(default, automatic)" "" \
5 "" "" \
6 "" "" \
7 "" "" \
8 "" "" \
" " "" "" \
"$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue # Restart loop if no choice made
command+="--set lora.coding_rate $choice "
break
done
fi
fi
if [ "$1" = "frequency_offset" ] || [ "$1" = "wizard" ]; then
while true; do
input=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --inputbox "This parameter is for advanced users with advanced test equipment.\n\nFrequency offset (default: 0)" 0 0 ${lora_frequencyOffset:-unknown} 3>&1 1>&2 2>&3)
[[ -z $input || ($input =~ ^([0-9]{1,6})(\.[0-9]+)?$ && $(echo "$input <= 1000000" | bc -l) -eq 1) ]] && break # exit loop if user input a number between 0 and 1000000. Decimals allowed
dialog --no-collapse --title "$title" --msgbox "Must be between 0-1000000. Decimals allowed." 6 50
done
if [ $? -ne 1 ] && [ -n "$input" ]; then
command+="--set lora.frequency_offset $input "
fi
fi
if [ "$1" = "hop_limit" ] || [ "$1" = "wizard" ]; then
while true; do
input=$(dialog --no-collapse --colors --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --inputbox "The maximum number of intermediate nodes between Femtofox and a node it is sending to. Does not impact received messages.\n\n\Z1WARNING:\Zn Excessive hop limit increases congestion!\n\nHop limit. Must be 0-7 (default: 3)" 0 0 ${lora_hopLimit:-unknown} 3>&1 1>&2 2>&3)
[[ -z $input || ($input =~ ^[0-7]$) ]] && break # exit loop if user input an integer between 0 and 7
dialog --no-collapse --title "$title" --msgbox "Must be an integer between 0 and 7." 6 50
done
if [ $? -ne 1 ] && [ -n "$input" ]; then
command+="--set lora.hop_limit $input "
fi
fi
if [ "$1" = "tx_enabled" ] || [ "$1" = "wizard" ]; then
choice="" # zero the choice before loading the submenu
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --default-item "${lora_txEnabled^}" --item-help --menu "Enables/disables the radio chip. Useful for hot-swapping antennas.\n\nEnable TX? (current: ${lora_txEnabled:-unknown})" 0 0 0 \
"True" "(default)" "" \
"False" "" "" \
" " "" "" \
"$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue #restart loop if no choice made
command+="--set lora.tx_enabled $(echo "$choice" | tr '[:upper:]' '[:lower:]') "
break
done
fi
if [ "$1" = "tx_power" ] || [ "$1" = "wizard" ]; then
while true; do
input=$(dialog --no-collapse --colors --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --inputbox "\
\Z1\ZuWARNING!\Zn\n\
Setting a 33db radio above 8db will \Zupermanently\Zn damage it.\n\
ERP above 27db violates EU law.\n\
ERP above 36db violates US (unlicensed) law.\n\
\n\
If 0, will use the maximum continuous power legal in your region.
\n\
\n\
TX power in dBm. Must be 0-30 (0 for automatic)" 0 0 ${lora_txPower:-unknown} 3>&1 1>&2 2>&3)
[[ -z $input || $input =~ ^([12]?[0-9]|30)$ ]] && break # exit loop if user input an integer between 0 and 30
dialog --no-collapse --title "$title" --msgbox "Must be an integer between 0 and 30." 6 50
done
if [ $? -ne 1 ] && [ -n "$input" ]; then
command+="--set lora.tx_power $input "
fi
fi
if [ "$1" = "frequency_slot" ] || [ "$1" = "wizard" ]; then
while true; do
input=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --inputbox "Determines the exact frequency the radio transmits and receives. If unset or set to 0, determined automatically by the primary channel name.\n\nFrequency slot (0 for automatic)" 0 0 ${lora_channelNum:-unknown} 3>&1 1>&2 2>&3)
[[ -z $input || ($input =~ ^[0-9]+$) ]] && break # exit loop if user input an integer 0 or higher
dialog --no-collapse --title "$title" --msgbox "Must be an integer 0 or higher." 6 50
done
if [ $? -ne 1 ] && [ -n "$input" ]; then
command+="--set lora.channel_num $input "
fi
fi
if [ "$1" = "override_duty_cycle" ] || [ "$1" = "wizard" ]; then
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --default-item "$(echo "${lora_overrideDutyCycle:-False}" | sed 's/^./\U&/')" --item-help --menu "May have legal ramifications.\n\nOverride duty cycle? (current: ${lora_overrideDutyCycle:-unknown})" 0 0 0 \
"True" "" "" \
"False" "(default)" "" \
" " "" "" \
"$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue #restart loop if no choice made
command+="--set lora.override_duty_cycle $(echo "$choice" | tr '[:upper:]' '[:lower:]') "
break
done
fi
if [ "$1" = "sx126x_rx_boosted_gain" ] || [ "$1" = "wizard" ]; then
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --default-item "$(echo "${lora_sx126xRxBoostedGain:-True}" | sed 's/^./\U&/')" --item-help --menu "This is an option specific to the SX126x chip series which allows the chip to consume a small amount of additional power to increase RX (receive) sensitivity.\n\nEnable SX126X RX boosted gain? (current: ${lora_sx126xRxBoostedGain:-unknown})" 0 0 0 \
"True" "(default)" "" \
"False" "" "" \
" " "" "" \
"$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue #restart loop if no choice made
command+="--set lora.sx126x_rx_boosted_gain $(echo "$choice" | tr '[:upper:]' '[:lower:]') "
break
done
fi
if [ "$1" = "override_frequency" ] || [ "$1" = "wizard" ]; then
while true; do
input=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --inputbox "Overrides frequency slot. May have legal ramifications.\n\nOverride frequency in MHz (0 for none)." 0 0 ${lora_overrideFrequency:-unknown} 3>&1 1>&2 2>&3)
[[ -z $input || ($input =~ ^[0-9]+(\.[0-9]+)?$) ]] && break # exit loop if user input a number 0 or higher (decimals allowed)
dialog --no-collapse --title "$title" --msgbox "Must be a number 0 or higher. Decimals allowed." 6 53
done
if [ $? -ne 1 ] && [ -n "$input" ]; then
command+="--set lora.override_frequency $input "
fi
fi
if [ "$1" = "ignore_mqtt" ] || [ "$1" = "wizard" ]; then
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --default-item "$(echo "${lora_ignoreMqtt:-unknown}" | sed 's/^./\U&/')" --item-help --menu "Ignores any messages it receives via LoRa that came via MQTT somewhere along the path towards the device.\n\nIgnore MQTT? (current: ${lora_ignoreMqtt:-unknown})" 0 0 0 \
"True" "" "" \
"False" "(default)" "" \
" " "" "" \
"$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue #restart loop if no choice made
command+="--set lora.ignore_mqtt $(echo "$choice" | tr '[:upper:]' '[:lower:]') "
break
done
fi
if [ "$1" = "ok_to_mqtt" ] || [ "$1" = "wizard" ]; then
while true; do
choice=$(dialog --no-collapse --title "$title" --cancel-label "$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" --default-item "$(echo "${lora_configOkToMqtt:-unknown}" | sed 's/^./\U&/')" --item-help --menu "Indicates that the user approves their packets to be uplinked to MQTT brokers.\n\nOK to MQTT? (current: ${lora_configOkToMqtt:-unknown})" 0 0 0 \
"True" "" "" \
"False" "(default)" "" \
" " "" "" \
"$([[ "$1" == "wizard" ]] && echo "Skip" || echo "Cancel")" "" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] || [ "$choice" == "Cancel" ] || [ "$choice" == "Skip" ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
[ "$choice" == "" ] && continue #restart loop if no choice made
command+="--set lora.config_ok_to_mqtt $(echo "$choice" | tr '[:upper:]' '[:lower:]') "
break
done
fi
send_settings $1
fi
}
# Parse options
help="If script is run without arguments, menu will load.\n\
Options are:\n\
-h This message\n\
-w Wizard mode (skips main menu)\
"
while getopts ":hw" opt; do
case ${opt} in
h) # Option -h (help)
echo -e $help
;;
w) # Option -w (Wizard mode)
lora_settings_actions "wizard"
;;
\?) # Unknown option)
echo -e "Unknown argument $1.\n$help"
;;
esac
done
[ -n "$1" ] && exit # if there were arguments, exit before loading the menu
command="" # initialize command
LoRa_menu_choice="" # zero the choice before loading the submenu
while true; do
command="" # initialize command
LoRa_menu_choice=$(dialog --no-collapse --title "Meshtastic LoRa Settings" --default-item "$LoRa_menu_choice" --cancel-label "Back" --item-help --menu "Select a LoRa setting or run the wizard" 30 50 20 \
1 "Wizard (set all)" "" \
2 "Set LoRa radio model" "" \
3 "Configure automatically with URL" "" \
4 "Region" "" \
5 "Use modem preset" "" \
6 "Preset" "" \
7 "Bandwidth" "" \
8 "Spread factor" "" \
9 "Coding rate" "" \
10 "Frequency offset" "" \
11 "Hop limit" "" \
12 "Enable/disable TX" "" \
13 "TX power" "" \
14 "Frequency slot" "" \
15 "Override duty cycle" "" \
16 "SX126X RX boosted gain " "" \
17 "Override frequency" "" \
18 "Ignore MQTT" "" \
19 "OK to MQTT" "" \
" " "" "" \
20 "Back to Meshtastic Menu" "" 3>&1 1>&2 2>&3)
[ $? -eq 1 ] && break # Exit the loop if the user selects "Cancel" or closes the dialog
case $LoRa_menu_choice in
1) # Wizard (set all)
lora_settings_actions "wizard"
;;
2) # Set LoRa radio model)
lora_settings_actions "set_lora_radio_model"
;;
3) # Configure automatically with URL)
config_url
;;
4) # Region)
lora_settings_actions "region"
;;
5) # Use modem preset)
lora_settings_actions "use_modem_preset"
;;
6) # Preset)
lora_settings_actions "preset"
;;
7) # Bandwidth)
lora_settings_actions "bandwidth"
;;
8) # Spread factor)
lora_settings_actions "spread_factor"
;;
9) # Coding rate)
lora_settings_actions "coding_rate"
;;
10) # Frequency offset)
lora_settings_actions "frequency_offset"
;;
11) # Hop limit)
lora_settings_actions "hop_limit"
;;
12) # Enable/disable TX)
lora_settings_actions "tx_enabled"
;;
13) # TX power)
lora_settings_actions "tx_power"
;;
14) # Frequency slot)
lora_settings_actions "frequency_slot"
;;
15) # Override duty cycle)
lora_settings_actions "override_duty_cycle"
;;
16) # SX126X RX boosted gain)
lora_settings_actions "sx126x_rx_boosted_gain"
;;
17) # Override frequency)
lora_settings_actions "override_frequency"
;;
18) # Ignore MQTT)
lora_settings_actions "ignore_mqtt"
;;
19) # OK to MQTT)
lora_settings_actions "ok_to_mqtt"
;;
20) break ;;
esac
done

View file

@ -103,7 +103,7 @@ MAC address:$(ifconfig wlan0 | grep ether | awk '{print $2}')"
Wi-Fi status:\033[4m\033[0;34menabled\033[0m\n\
Connected to:$(iwconfig 2>/dev/null | grep -i 'ESSID' | awk -F 'ESSID:"' '{print $2}' | awk -F '"' '{print $1}' | sed 's/^$/none/')\n\
Sig. strength:$(iwconfig 2>/dev/null | grep -i 'Signal level' | awk -F 'Signal level=' '{print $2}' | awk '{print $1}')\n\
Current IP:$(hostname -I | awk '{print $1}')\n
Current IP:$(ip addr show wlan0 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)\n
Hostname:$(hostname).local\n\
$mac_address_line"
else
@ -147,11 +147,12 @@ $wifi_settings"
updated_wifi="true"
;;
n) # Option -n (set hostname)
old_hostname=$(hostname)
sed -i "s/$(hostname)/$OPTARG/g" /etc/hosts
hostnamectl set-hostname "$OPTARG"
systemctl restart avahi-daemon
echo "Regenerating web terminal ssl keys..."
/usr/local/bin/packages/ttyd.sh -k
[ "$OPTARG" != "$old_hostname" ] && /usr/local/bin/packages/ttyd.sh -k
;;
\?) # Invalid option)
echo "Invalid option: -$OPTARG"

View file

@ -3,7 +3,8 @@ log_message() {
echo -e "\e[32mFirst boot\e[0m: $1" # Echo to the screen
logger "First boot: $1" # Log to the system log
}
if ! grep -qE '^first_boot=true' /etc/femto.conf; then # if not the first boot
if ! systemctl is-enabled femto-runonce &>/dev/null; then # if not the first boot
who | grep -q . || exit 0 # if not logged in, exit script. May not deal well with future web UI
@ -23,12 +24,13 @@ Re-running this script will:\n\
* Add terminal type to user femto's .bashrc\n\
* Add a shortcut \`sfc\` to user femto's .bashrc\n\
* Enable the meshtasticd service\n\
* Add compiler support\n\
\n\
Finally, the Femtofox will reboot.\n\
\n\
Re-running this script after first boot should not cause any harm, but may not work as expected.\n\
\n\
Proceed?" 22 60
Proceed?" 24 60
if [ $? -eq 1 ]; then #if cancel/no
exit 0
fi
@ -66,14 +68,6 @@ else
log_message "Swap file already allocated, skipping"
fi
#generate SSH keys
log_message "Generating new SSH encryption keys. This can take a minute..."
femto-utils.sh -E
#generate ttyd SSL keys
log_message "Generating new Web Terminal SSL encryption keys. This can take a minute..."
/usr/local/bin/packages/ttyd.sh -k
# prevent randomized mac address for eth0. If `eth0`` is already present in /etc/network/interfaces, skip
mac="$(awk '/Serial/ {print $3}' /proc/cpuinfo | tail -c 11 | sed 's/^\(.*\)/a2\1/' | sed 's/\(..\)/\1:/g;s/:$//')"
file="/etc/network/interfaces"
@ -100,8 +94,8 @@ else
fi
# Fix Compiler
log_message "Fixing Compiler."
cp /usr/lib/arm-linux-gnueabihf/libc_nonshared.a.keep /usr/lib/arm-linux-gnueabihf/libc_nonshared.a
log_message "Added compiler support"
# Add a cheeky alias to .bash_aliases
if ! grep -Fxq "alias sfc='sudo femto-config'" /home/femto/.bashrc; then # Check if the lines are already in .bash_aliases
@ -114,8 +108,16 @@ fi
log_message "Enabling meshtasticd service"
systemctl enable meshtasticd
#generate SSH keys
log_message "Generating new SSH encryption keys. This can take a couple minutes..."
#femto-utils.sh -E
#generate ttyd SSL keys
log_message "Generating new Web Terminal (ttyd) SSL encryption keys. This can take a couple minutes..."
/usr/local/bin/packages/ttyd.sh -k
# remove first boot flag
sed -i -E 's/^first_boot=.*/first_boot=false/' /etc/femto.conf
log_message "Removing first boot flag and rebooting in 5 seconds..."
systemctl disable femto-runonce
log_message "Disabled first boot service and rebooting in 5 seconds..."
sleep 5
reboot

View file

@ -32,7 +32,7 @@ for i in {1..5}; do
echo "Time Zone updated to:\n$(timedatectl show --property=Timezone --value) $(date +%Z) (UTC$(date +%:z))\nSystem time updated to:\n$(date)\n\nNew time successfully saved to RTC.\nTime & date are also set automatically from internet, if connected."
return 0
else
echo "System time updated to:\n$(date) ($(date +"UTC%z" | sed -E 's/GMT([+-])0?([0-9]{1,2})00/GMT\1\2/'))\n\nUnable to communicate with RTC module. An RTC module can remember system time between reboots/power outages.\nTime & date are also set automatically from internet, if connected."
echo "System time updated to:\n$(date +"%B %d, %Y %H:%M:%S") $(timedatectl show --property=Timezone --value) ($(date +"UTC%z" | sed -E 's/GMT([+-])0?([0-9]{1,2})00/GMT\1\2/'))\n\nUnable to communicate with RTC module. An RTC module can remember system time between reboots/power outages.\nTime & date are also set automatically from internet, if connected."
return 0
fi
fi
@ -59,7 +59,12 @@ done
if [ $arg_count -eq 0 ]; then # if the script was launched with no arguments, then load the UI.
echo "Loading current time settings..."
current_timezone=$(timedatectl show --property=Timezone --value)
dialog --no-collapse --title "System time" --yesno "Current system time: $(date +"%H:%M:%S")\nCurrent time zone: $current_timezone ($(date +"UTC%z" | sed -E 's/GMT([+-])0?([0-9]{1,2})00/GMT\1\2/'))\n$(hwclock >/dev/null 2>&1 && echo "RTC module found!" || echo "RTC module not found.")\n\nSet new time and timezone?" 10 60
dialog --no-collapse --title "System time" --yesno "\
Current system time:\n\
$(date +"%B %d, %Y %H:%M:%S") $(timedatectl show --property=Timezone --value) ($(date +"UTC%z" | sed -E 's/GMT([+-])0?([0-9]{1,2})00/GMT\1\2/'))\n\
$(hwclock >/dev/null 2>&1 && echo "RTC module found!" || echo "RTC module not found.")\n\
\n\
Set new time and timezone?" 10 50
if [ $? -eq 1 ]; then #unless cancel/no
exit 0
fi
@ -78,7 +83,7 @@ if [ $arg_count -eq 0 ]; then # if the script was launched with no arguments, th
# Show timezone selection menu with preselection of current timezone
selected_timezone=$(dialog --title "Set Time Zone" \
--default-item "$current_timezone" \
--menu "Current time zone: $current_timezone (UTC$(date +%z))" 20 60 10 \
--menu "Current time zone: $current_timezone (UTC$(date +%z))" 20 50 10 \
$(printf "%s " "${options[@]}") 3>&1 1>&2 2>&3)
exit_status=$?
if [[ $exit_status -eq 0 && -n "$selected_timezone" ]]; then

View file

@ -4,13 +4,20 @@ title="Software Manager"
package_dir="/usr/local/bin/packages"
install() {
dialog --no-collapse --title "Install $($package_dir/$1.sh -N)" --yesno "\nInstallation requires internet connectivity.\n\nProceed?" 10 40
dialog --no-collapse --title "Install $($package_dir/$1.sh -N)" --yesno "\nInstallation requires internet connectivity.\n\nInstall $($package_dir/$1.sh -N)?" 10 40
[ $? -eq 1 ] && return 1 #if cancel/no
echo "Installing $($package_dir/$1.sh -N)..."
# Run the installation script, capturing the output and displaying it in real time
output=$($package_dir/$1.sh -i)
output=$($package_dir/$1.sh -i | tee /dev/tty)
install_status=$? # Capture the exit status of the eval command
if [ ${#output} -gt 2048 ]; then # Truncate to 2048 characters and append ellipsis and note if necessary
truncated_output="${output:0:2000}...\nLOG TRUNCATED"
if [[ "$output" =~ user_message: ]]; then # preserve user_message by adding to end of string
truncated_output="$truncated_output\n$(echo "$output" | sed -n 's/.*\(user_message:.*\)/\1/p')"
fi
output="$truncated_output"
fi
user_message=$(echo "$output" | awk '/user_message: / {found=1; split($0, arr, "user_message: "); print arr[2]; next} found {print}' | sed '/^$/q') # grab the user_message, if present
output=$(echo -e "$output" | sed '/user_message: /,$d') # remove the user message from the detailed output
@ -22,7 +29,7 @@ install() {
}
uninstall() {
dialog --no-collapse --title "Uninstall $($package_dir/$1.sh -N)" --yesno "\nReinstallation will require internet connectivity.\n\nProceed?" 10 40
dialog --no-collapse --title "Uninstall $($package_dir/$1.sh -N)" --yesno "\nNote: reinstallation will require internet connectivity.\n\nUninstall $($package_dir/$1.sh -N)?" 10 40
[ $? -eq 1 ] && return 1 #if cancel/no
echo "Uninstalling $($package_dir/$1.sh -N)..."
output=$(eval "$package_dir/$1.sh -u 2>&1 | tee /dev/tty")
@ -37,7 +44,7 @@ uninstall() {
}
initialize() {
dialog --no-collapse --title "$title" --yesno "\nIntialize $($package_dir/$1.sh -N)\n\nInitialization runs commands that require user interaction and so can only be run from terminal.\n\nProceed?" 13 50
dialog --no-collapse --title "$title" --yesno "\nIntialize $($package_dir/$1.sh -N)\n\nInitialization runs commands that require user interaction and so can only be run from terminal.\n\nInitialize $($package_dir/$1.sh -N)?" 13 50
[ $? -eq 1 ] && return 1 #if cancel/no
clear
echo "Initializing $($package_dir/$1.sh -N)..."
@ -50,7 +57,7 @@ initialize() {
}
upgrade() {
dialog --no-collapse --title "Upgrade $($package_dir/$1.sh -N)" --yesno "\nUpgrade requires internet connectivity.\n\nProceed?" 10 40
dialog --no-collapse --title "Upgrade $($package_dir/$1.sh -N)" --yesno "\nUpgrade requires internet connectivity.\n\nUpgrade $($package_dir/$1.sh -N)?" 10 40
[ $? -eq 1 ] && return 1 #if cancel/no
echo "Upgrading $($package_dir/$1.sh -N)..."
output=$(eval "$package_dir/$1.sh -g 2>&1 | tee /dev/tty")
@ -92,8 +99,9 @@ package_menu() {
if $package_dir/$1.sh -O | grep -q 'G' && $package_dir/$1.sh -I; then license_button="--help-button --help-label License"; fi
# for each line, check if it's supported by the package, display it if the current install state of the package is appropriate (example: don't display "install" if the package is already installed, don't display "stop service" for a package with no services)
if $package_dir/$1.sh -I; then service_state=$(femto-utils.sh -C "$($package_dir/$1.sh -E)"); fi
# Removed from menu list until can be fixed - contact does not launch. When returned to list, should be first entry
# $(if $package_dir/$1.sh -O | grep -q 'l' && $package_dir/$1.sh -I; then echo "Run software x"; fi) \
menu_list="\
$(if $package_dir/$1.sh -O | grep -q 'l' && $package_dir/$1.sh -I; then echo "Run software x"; fi) \
$(if $package_dir/$1.sh -O | grep -q 'i' && ! $package_dir/$1.sh -I; then echo "Install x"; fi) \
$(if $package_dir/$1.sh -O | grep -q 'u' && $package_dir/$1.sh -I; then echo "Uninstall x"; fi) \
$(if $package_dir/$1.sh -O | grep -q 'a' && $package_dir/$1.sh -I; then echo "Initialize x"; fi) \
@ -104,7 +112,11 @@ package_menu() {
$(if $package_dir/$1.sh -O | grep -q 'e' && $package_dir/$1.sh -I; then echo "Start/restart service x"; fi) \
$(if $package_dir/$1.sh -O | grep -q 'S' && $package_dir/$1.sh -I; then echo "Detailed service status x"; fi)"
menu_count=$(( $(echo "$menu_list" | grep -o " x" | wc -l) $(if $package_dir/$1.sh -O | grep -q 'e' && $package_dir/$1.sh -I; then echo "+1"; fi) )) # count the number of menu items by counting how many times " x" shows up, +1 if there's a service. This is a stupid way to do this, but because each menu item only contains one space (the rest being space-sized invisible chars) it works. It's late at night, OKAY?!
choice=$(dialog --no-collapse --colors --title "$($package_dir/$1.sh -N)" $license_button --cancel-label "Back" --default-item "$choice" --menu "$(if $package_dir/$1.sh -O | grep -q 'S' && $package_dir/$1.sh -I; then echo "Service status: $(femto-utils.sh -R "$service_state")"; fi)" $(( menu_count + 9 )) 45 $(( menu_count + 3 )) \
if $package_dir/$1.sh -O | grep -q 'e' && [ "$($package_dir/$1.sh -E | wc -w)" -gt 1 ]; then
multiple_services_note="\nService will appear as \"running\" if any of the services are active."
menu_count=$((menu_count + 2))
fi
choice=$(dialog --no-collapse --colors --title "$($package_dir/$1.sh -N)" $license_button --cancel-label "Back" --default-item "$choice" --menu "$(if $package_dir/$1.sh -O | grep -q 'S' && $package_dir/$1.sh -I; then echo "Service status: $(femto-utils.sh -R "$service_state")"; fi)$multiple_services_note" $(( menu_count + 9 )) 45 $(( menu_count + 3 )) \
$menu_list \
" " "" \
"Back to software manager" "" 3>&1 1>&2 2>&3)

View file

@ -22,6 +22,7 @@ Options are:
-E Generate/overwrite SSH encryption keys
-C "service" Check if service is enabled, disabled, running
-R "command" Replace colors for dialog menus
-v Get Foxbuntu version
EOF
)
@ -219,7 +220,7 @@ replace_colors() {
echo "$input"
}
while getopts ":harsl:ipcnoSEC:R:" opt; do
while getopts ":harsl:ipcnoSEC:R:v" opt; do
case ${opt} in
h) # Option -h (help)
echo -e "$help"
@ -255,34 +256,37 @@ while getopts ":harsl:ipcnoSEC:R:" opt; do
;;
C) # Option -C (Check service status)
if systemctl is-enabled $OPTARG &>/dev/null; then
state_message="\033[0;34m\033[4menabled\e[39m, "
state_message="\033[0;34m\033[4menabled\033[0m, "
else
state_message="\033[0;31m\033[4mdisabled\e[39m, "
state_message="\033[0;31m\033[4mdisabled\033[0m, "
fi
full_status=$(systemctl status $OPTARG)
if echo $full_status | grep -q "active (running)"; then
state_message+="\033[0;34mrunning\e[0m"
state_message+="\033[4m\033[0;34mrunning\033[0m"
exit_state=0
elif echo $full_status | grep -q "inactive (dead)"; then
state_message+="\033[0;31mnot running\e[0m"
state_message+="\033[4m\033[0;31mnot running\033[0m"
exit_state=1
elif echo $full_status | grep -q "failed"; then
state_message+="\033[0;31mfailed\e[0m"
state_message+="\033[4m\033[0;31mfailed\033[0m"
exit_state=1
elif echo $full_status | grep -q "activating"; then
state_message+="activating\e[0m"
state_message+="\033[4mactivating\033[0m"
exit_state=2
else
state_message+="unknown\e[0m"
state_message+="\033[4munknown\033[0m"
exit_state=2
fi
echo -e "$state_message"
exit $exit_state
;;
R)
R) # replace colors)
replace_colors "$OPTARG"
;;
\?) # Unknown option)
v) # get foxbuntu version)
echo "Foxbuntu v$(grep -oP 'major=\K[0-9]+' /etc/foxbuntu-release).$(grep -oP 'minor=\K[0-9]+' /etc/foxbuntu-release).$(grep -oP 'patch=\K[0-9]+' /etc/foxbuntu-release)$(grep -oP 'hotfix=\K[a-z]+' /etc/foxbuntu-release)"
;;
\?) # Unknown argument)
echo -e "Unknown argument $1.\n$help"
;;
esac

View file

@ -13,9 +13,9 @@ name="Meshing Around" # software name
author="Spud" # software author - OPTIONAL
description="Meshing Around is a feature-rich bot designed to enhance your Meshtastic network experience with a variety of powerful tools and fun features. Connectivity and utility through text-based message delivery. Whether you're looking to perform network tests, send messages, or even play games, mesh_bot.py has you covered." # software description - OPTIONAL (but strongly recommended!)
URL="https://github.com/SpudGunMan/meshing-around" # software URL. Can contain multiple URLs - OPTIONAL
options="xiuagedsrNADUOSELGTCI" # script options in use by software package. For example, for a package with no service, exclude `edsr`
options="xiugedsrNADUOSELGTCI" # script options in use by software package. For example, for a package with no service, exclude `edsr`
launch="" # command to launch software, if applicable
service_name="mesh_bot pong_bot mesh_bot_reporting" # the name of the service, such as `chrony`. REQUIRED if service options are in use. If multiple services, separate by spaces "service1 service2"
service_name="mesh_bot" # the name of the service, such as `chrony`. REQUIRED if service options are in use. If multiple services, separate by spaces "service1 service2"
location="/opt/meshing-around" # install location REQUIRED if not apt installed. Generally, we use `/opt/software-name`
license="$location/LICENSE" # file to cat to display license
license_name="GPL3" # license name, such as MIT, GPL3, custom, whatever. short text string
@ -29,7 +29,9 @@ install() {
fi
pip install -r $location/requirements.txt
if [ "$interactive" = "true" ]; then #interactive install
interactive_init
"$location/install.sh" | tee /dev/tty
echo "user_message: To change settings, run \`sudo nano $location/config.ini\`"
exit 0
else
echo "user_message: IMPORTANT: To complete installation, run \`sudo $location/install.sh\`\nTo change settings, run \`sudo nano $location/config.ini\`"
exit 0
@ -59,8 +61,6 @@ uninstall() {
# code that must be run to initialize the installation prior to use, but can only be run from terminal
interactive_init() {
"$location/install.sh" | tee /dev/tty
echo "user_message: To change settings, run \`sudo nano $location/config.ini\`"
exit 0
}

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 100 55" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(0.802386,0,0,0.460028,-421.748,-122.127)">
<g transform="matrix(0.579082,0,0,1.01004,460.975,-39.6867)">
<path d="M250.908,330.267L193.126,415.005L180.938,406.694L244.802,313.037C246.174,311.024 248.453,309.819 250.889,309.816C253.326,309.814 255.606,311.015 256.982,313.026L320.994,406.536L308.821,414.869L250.908,330.267Z"/>
</g>
<g transform="matrix(0.582378,0,0,1.01579,485.019,-211.182)">
<path d="M87.642,581.398L154.757,482.977L142.638,474.713L75.523,573.134L87.642,581.398Z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1 KiB

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 100 55" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(0.802386,0,0,0.460028,-421.748,-122.127)">
<g transform="matrix(0.579082,0,0,1.01004,460.975,-39.6867)">
<path d="M250.908,330.267L193.126,415.005L180.938,406.694L244.802,313.037C246.174,311.024 248.453,309.819 250.889,309.816C253.326,309.814 255.606,311.015 256.982,313.026L320.994,406.536L308.821,414.869L250.908,330.267Z" style="fill:white;"/>
</g>
<g transform="matrix(0.582378,0,0,1.01579,485.019,-211.182)">
<path d="M87.642,581.398L154.757,482.977L142.638,474.713L75.523,573.134L87.642,581.398Z" style="fill:white;"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="512" height="512" viewBox="0 0 512 512" xml:space="preserve">
<desc>Created with Fabric.js 4.6.0</desc>
<defs>
</defs>
<g transform="matrix(1 0 0 1 256 256)" id="xYQ9Gk9Jwpgj_HMOXB3F_" >
<path style="stroke: rgb(213,130,139); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(103,234,148); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-256, -256)" d="M 0 0 L 512 0 L 512 512 L 0 512 z" stroke-linecap="round" />
</g>
<g transform="matrix(1.79 0 0 1.79 313.74 258.36)" id="1xBsk2n9FZp60Rz1O-ceJ" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: round; stroke-miterlimit: 2; fill: rgb(44,45,60); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-250.97, -362.41)" d="M 250.908 330.267 L 193.126 415.005 L 180.938 406.694 L 244.802 313.037 C 246.174 311.024 248.453 309.819 250.889 309.816 C 253.326 309.814 255.606 311.015 256.982 313.026 L 320.994 406.536 L 308.821 414.869 L 250.908 330.267 Z" stroke-linecap="round" />
</g>
<g transform="matrix(1.81 0 0 1.81 145 256.15)" id="KxN7E9YpbyPgz0S4z4Cl6" >
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: round; stroke-miterlimit: 2; fill: rgb(44,45,60); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-115.14, -528.06)" d="M 87.642 581.398 L 154.757 482.977 L 142.638 474.713 L 75.523 573.134 L 87.642 581.398 Z" stroke-linecap="round" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

File diff suppressed because one or more lines are too long

View file

@ -1,30 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
<link rel="icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" />
<link rel="manifest" href="site.webmanifest" />
<link rel="mask-icon" href="Logo_Black.svg" color="#67ea94" />
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@xz/fonts@1/serve/cascadia-code.min.css"
/>
<meta name="theme-color" content="#67ea94" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0"
/>
<meta name="description" content="Meshtastic Web App" />
<title>Meshtastic Web</title>
<script type="module" crossorigin src="/index-b9vwykds.js"></script>
<link rel="stylesheet" crossorigin href="/index-wV0rbIjU.css">
</head>
<body>
<div id="root"></div>
<noscript>You need to enable JavaScript to run this app.</noscript>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -1,16 +0,0 @@
{
"name": "Meshtastic",
"short_name": "Meshtastic",
"start_url": ".",
"description": "Meshtastic web app",
"icons": [
{
"src": "/icon.svg",
"sizes": "any",
"type": "image/svg+xml"
}
],
"theme_color": "#67ea94",
"background_color": "#67ea94",
"display": "standalone"
}