mirror of
https://github.com/femtofox/femtofox.git
synced 2026-10-26 02:49:05 -04:00
Merge branch 'femtofox:main' into main
This commit is contained in:
commit
5708e79c91
5 changed files with 108 additions and 74 deletions
|
|
@ -1,7 +1,11 @@
|
|||
|
||||
|
||||
<img src="assets/images/KSE_side_shot.png" width="750">
|
||||
|
||||
|
||||
# Femtofox <sub><sub>The tiny, low power Linux Meshtastic node
|
||||
### [Click here for the Femtofox store](https://www.etsy.com/listing/1861858340/femtofox-pro-v1-kit-compact-arm-linux)
|
||||
|
||||
**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 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.
|
||||
|
|
@ -14,6 +18,7 @@ Find out more in the sections below, or in the [Wiki](https://github.com/femtofo
|
|||
- 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/nomdetom/femtofox-pro-v1-kit-linux-meshtastic-node/)
|
||||
- [Etsy (UK)](https://www.etsy.com/uk/listing/1866094154/femtofox-pro-v1-kit-linux-meshtastic)
|
||||
- [DIY instructions](https://github.com/femtofox/Femtofox_Community_Hardware)
|
||||
- [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)
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ clone_repos() {
|
|||
fi
|
||||
}
|
||||
|
||||
clone_with_retries "https://github.com/LuckfoxTECH/luckfox-pico.git" || return 1
|
||||
#clone_with_retries "https://github.com/LuckfoxTECH/luckfox-pico.git" || return 1
|
||||
clone_with_retries "https://github.com/Ruledo/luckfox-pico.git" || return 1
|
||||
clone_with_retries "https://github.com/femtofox/femtofox.git" || return 1
|
||||
|
||||
return 0
|
||||
|
|
|
|||
|
|
@ -79,6 +79,71 @@ check_meshtasticd_running() {
|
|||
fi
|
||||
}
|
||||
|
||||
service_manager() {
|
||||
choice="" # zero the choice before loading the submenu
|
||||
while true; do
|
||||
local service_name=$1
|
||||
local readable_name=$2
|
||||
local help=$3
|
||||
echo "Checking $readable_name service state..."
|
||||
local service_state="$(femto-utils.sh -R "$(femto-utils.sh -C "$service_name")")"
|
||||
choice=$(dialog --no-collapse --colors --help-button --cancel-label "Back" --title "$readable_name Service" --default-item "$choice" --menu "Avahi-Daemon service is $service_state" 16 60 5 \
|
||||
"View detailed service status" "x" \
|
||||
" " "" \
|
||||
"Start/restart service" "x" \
|
||||
$(if ! echo "$service_state" | grep -q 'not running'; then echo "Stop service x"; fi) \
|
||||
" " "" \
|
||||
$(if echo "$service_state" | grep -q 'disabled'; then echo "Enable service x"; fi) \
|
||||
$(if echo "$service_state" | grep -q 'enabled'; then echo "Disable service x"; fi) \
|
||||
" " "" \
|
||||
"Back to previous menu" "x" 3>&1 1>&2 2>&3)
|
||||
exit_status=$? # This line checks the exit status of the dialog command
|
||||
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 "$readable_name service help" --msgbox "$3" 0 0
|
||||
else
|
||||
case $choice in
|
||||
"View detailed service status")
|
||||
echo "Getting $readable_name service status..."
|
||||
dialog --no-collapse --title "$readable_name service status" --msgbox "$(systemctl status $service_name)" 0 0
|
||||
;;
|
||||
"Start/restart service")
|
||||
dialog --no-collapse --title "$title" --yesno "Start/restart $readable_name service?" 7 45
|
||||
if [ $? -eq 0 ]; then #unless cancel/no
|
||||
systemctl restart $service_name
|
||||
dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl restart $service_name\Zn\` command to system.\n\n$readable_name should be running." 10 60
|
||||
fi
|
||||
;;
|
||||
"Stop service")
|
||||
dialog --no-collapse --colors --title "$title" --yesno "Stop $readable_name service?\n\nThis will take the node \Zu\Z1OFFLINE\Zn.\n\n$readable_name will automatically restart on boot service if enabled." 11 50
|
||||
if [ $? -eq 0 ]; then #unless cancel/no
|
||||
systemctl stop $service_name
|
||||
dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl stop $service_name\Zn\` command to system.\n\n$readable_name should be stopped." 9 60
|
||||
fi
|
||||
;;
|
||||
"Enable service")
|
||||
dialog --no-collapse --title "$title" --yesno "Enable $readable_name service?" 6 45
|
||||
if [ $? -eq 0 ]; then #unless cancel/no
|
||||
systemctl enable $service_name
|
||||
systemctl start $service_name
|
||||
dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl enable $service_name\Zn\` and \`\Zusystemctl start $service_name\Zn\` commands to system.\n\n$readable_name should be running." 10 60
|
||||
fi
|
||||
;;
|
||||
"Disable service")
|
||||
dialog --no-collapse --colors --title "$title" --yesno "Disable $readable_name service?\n\nThis will take the node \Zu\Z1OFFLINE\Zn and will not restart!" 9 50
|
||||
if [ $? -eq 0 ]; then #unless cancel/no
|
||||
systemctl disable $service_name
|
||||
systemctl stop $service_name
|
||||
dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl disable $service_name\Zn\` and \`\Zusystemctl stop $service_name\Zn\` commands to system.\n\n$readable_name should be disabled and stopped." 10 60
|
||||
fi
|
||||
;;
|
||||
"Back to previous menu") break ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
wifi_config() {
|
||||
local title2="Wi-Fi (wlan0) Settings"
|
||||
local config=$(dialog --no-collapse --title "$title2" --form "↑ ↓ to navigate, [ESC] to cancel." 10 45 0 \
|
||||
|
|
@ -122,8 +187,9 @@ networking_settings() {
|
|||
6 "Set hostname" "" \
|
||||
7 "Test internet connection" "" \
|
||||
8 "Manage Meshtastic wifi sync" "" \
|
||||
9 "Manage Avahi-Daemon service" "" \
|
||||
" " "" "" \
|
||||
9 "Back to main menu" "" 3>&1 1>&2 2>&3)
|
||||
10 "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 $networking_choice in
|
||||
1) # Turn Wi-Fi on/off)
|
||||
|
|
@ -174,67 +240,12 @@ networking_settings() {
|
|||
dialog --no-collapse --title "Internet connectivity test" --colors --msgbox "$(femto-utils.sh -R "$(femto-network-config.sh -t)")" 9 40
|
||||
;;
|
||||
8) # Manage Meshtastic wifi sync)
|
||||
choice="" # zero the choice before loading the submenu
|
||||
while true; do
|
||||
echo "Checking Meshtastic wifi sync service state..."
|
||||
local service_state="$(femto-utils.sh -R "$(femto-utils.sh -C "femto-wifi-mesh-control")")"
|
||||
choice=$(dialog --no-collapse --colors --help-button --cancel-label "Back" --title "Meshtastic wifi sync Service" --default-item "$choice" --menu "Meshtastic wifi sync service is $service_state" 16 60 5 \
|
||||
"View detailed service status" "x" \
|
||||
" " "" \
|
||||
"Start/restart service" "x" \
|
||||
$(if ! echo "$service_state" | grep -q 'not running'; then echo "Stop service x"; fi) \
|
||||
" " "" \
|
||||
$(if echo "$service_state" | grep -q 'disabled'; then echo "Enable service x"; fi) \
|
||||
$(if echo "$service_state" | grep -q 'enabled'; then echo "Disable service x"; fi) \
|
||||
" " "" \
|
||||
"Back to previous menu" "x" 3>&1 1>&2 2>&3)
|
||||
exit_status=$? # This line checks the exit status of the dialog command
|
||||
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 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")
|
||||
echo "Getting Meshtastic wifi sync service status..."
|
||||
dialog --no-collapse --title "Meshtastic wifi sync service status" --msgbox "$(systemctl status femto-wifi-mesh-control)" 0 0
|
||||
;;
|
||||
"Start/restart service")
|
||||
dialog --no-collapse --title "$title" --yesno "Start/restart Meshtastic wifi sync service?" 7 45
|
||||
if [ $? -eq 0 ]; then #unless cancel/no
|
||||
systemctl restart femto-wifi-mesh-control
|
||||
dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl restart femto-wifi-mesh-control wifi sync\Zn\` command to system.\n\nMeshtastic wifi sync should be running." 10 60
|
||||
fi
|
||||
;;
|
||||
"Stop service")
|
||||
dialog --no-collapse --colors --title "$title" --yesno "Stop Meshtastic wifi sync service?\n\nThis will take the node \Zu\Z1OFFLINE\Zn.\n\nMeshtastic wifi sync will automatically restart on boot service if enabled." 11 50
|
||||
if [ $? -eq 0 ]; then #unless cancel/no
|
||||
systemctl stop femto-wifi-mesh-control
|
||||
dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl stop femto-wifi-mesh-control\Zn\` command to system.\n\nMeshtastic wifi sync should be stopped." 9 60
|
||||
fi
|
||||
;;
|
||||
"Enable service")
|
||||
dialog --no-collapse --title "$title" --yesno "Enable Meshtastic wifi sync service?" 6 45
|
||||
if [ $? -eq 0 ]; then #unless cancel/no
|
||||
systemctl enable femto-wifi-mesh-control
|
||||
systemctl start femto-wifi-mesh-control
|
||||
dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl enable femto-wifi-mesh-control\Zn\` and \`\Zusystemctl start femto-wifi-mesh-control\Zn\` commands to system.\n\nMeshtastic wifi sync should be running." 10 60
|
||||
fi
|
||||
;;
|
||||
"Disable service")
|
||||
dialog --no-collapse --colors --title "$title" --yesno "Disable Meshtastic wifi sync service?\n\nThis will take the node \Zu\Z1OFFLINE\Zn and will not restart!" 9 50
|
||||
if [ $? -eq 0 ]; then #unless cancel/no
|
||||
systemctl disable femto-wifi-mesh-control
|
||||
systemctl stop femto-wifi-mesh-control
|
||||
dialog --no-collapse --colors --msgbox "Sent \`\Zusystemctl disable femto-wifi-mesh-control\Zn\` and \`\Zusystemctl stop femto-wifi-mesh-control\Zn\` commands to system.\n\nMeshtastic wifi sync should be disabled and stopped." 10 60
|
||||
fi
|
||||
;;
|
||||
"Back to previous menu") break ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
service_manager "femto-wifi-mesh-control" "Meshtastic wifi sync" "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"
|
||||
;;
|
||||
9)
|
||||
9) # Manage avahi)
|
||||
service_manager "avahi-daemon" "Avahi Daemon" "The Avahi-Daemon service advertises the Meshtastic node on the local LAN (often called a Bonjour service), allowing the Android app to detect it. Without Avahi, you will need to manually enter the Femtofox's IP address in the app to connect.\n"
|
||||
;;
|
||||
10)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ log_message "Resizing filesystem..."
|
|||
resize2fs /dev/mmcblk1p5
|
||||
resize2fs /dev/mmcblk1p6
|
||||
resize2fs /dev/mmcblk1p7
|
||||
log_message "Resizing filesystem complete"
|
||||
log_message "Resizing filesystem complete."
|
||||
|
||||
# allocate swap file
|
||||
if [ ! -f /swapfile ]; then # check if swap file already exists
|
||||
|
|
@ -65,21 +65,21 @@ if [ ! -f /swapfile ]; then # check if swap file already exists
|
|||
echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab > /dev/null
|
||||
log_message "Swap file allocated."
|
||||
else
|
||||
log_message "Swap file already allocated, skipping"
|
||||
log_message "Swap file already allocated, skipping..."
|
||||
fi
|
||||
|
||||
# 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"
|
||||
if ! grep -q " hwaddress ether $mac" "$file"; then
|
||||
log_message "Setting eth0 MAC address to $mac (derivative of CPU s/n)"
|
||||
log_message "Setting eth0 MAC address to $mac (derivative of CPU s/n)..."
|
||||
awk -v mac="$mac" '
|
||||
{ print }
|
||||
/allow-hotplug eth0/ { count=5 }
|
||||
count && --count == 0 { print " hwaddress ether " mac }
|
||||
' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
|
||||
else
|
||||
log_message "eth0 mac address already set in /etc/network/interfaces, skipping"
|
||||
log_message "eth0 mac address already set in /etc/network/interfaces, skipping..."
|
||||
fi
|
||||
|
||||
# Add term stuff to .bashrc
|
||||
|
|
@ -87,25 +87,25 @@ lines="export NCURSES_NO_UTF8_ACS=1
|
|||
export TERM=xterm-256color
|
||||
export LANG=C.UTF-8"
|
||||
if ! grep -Fxq "$lines" /home/femto/.bashrc; then # Check if the lines are already in .bashrc
|
||||
log_message "Adding TERM, LANG and NCURSES_NO_UTF8_ACS to .bashrc..."
|
||||
echo "$lines" >> /home/femto/.bashrc
|
||||
log_message "Added TERM, LANG and NCURSES_NO_UTF8_ACS to .bashrc"
|
||||
else
|
||||
log_message "TERM, LANG and NCURSES_NO_UTF8_ACS already present in .bashrc, skipping"
|
||||
log_message "TERM, LANG and NCURSES_NO_UTF8_ACS already present in .bashrc, skipping..."
|
||||
fi
|
||||
|
||||
# Fix Compiler
|
||||
log_message "Adding compiler support..."
|
||||
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
|
||||
echo "alias sfc='sudo femto-config'" >> /home/femto/.bashrc
|
||||
log_message "Added \`alias sfc='sudo femto-config'\` to .bashrc"
|
||||
else
|
||||
log_message "\`alias sfc='sudo femto-config'\` already present in .bashrc, skipping"
|
||||
log_message "\`alias sfc='sudo femto-config'\` already present in .bashrc, skipping..."
|
||||
fi
|
||||
|
||||
log_message "Enabling meshtasticd service"
|
||||
log_message "Enabling meshtasticd service..."
|
||||
systemctl enable meshtasticd
|
||||
|
||||
#generate SSH keys
|
||||
|
|
|
|||
|
|
@ -1326,8 +1326,6 @@ CONFIG_SCSI_LOWLEVEL=y
|
|||
# CONFIG_SCSI_MPT2SAS is not set
|
||||
# CONFIG_SCSI_SMARTPQI is not set
|
||||
CONFIG_SCSI_UFSHCD=y
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_TUN=m
|
||||
# CONFIG_SCSI_UFSHCD_PCI is not set
|
||||
# CONFIG_SCSI_UFSHCD_PLATFORM is not set
|
||||
# CONFIG_SCSI_UFS_BSG is not set
|
||||
|
|
@ -1370,7 +1368,25 @@ CONFIG_TUN=m
|
|||
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_MII=y
|
||||
# CONFIG_NET_CORE is not set
|
||||
CONFIG_NET_CORE=y
|
||||
# CONFIG_BONDING is not set
|
||||
# CONFIG_DUMMY is not set
|
||||
# CONFIG_WIREGUARD is not set
|
||||
# CONFIG_EQUALIZER is not set
|
||||
# CONFIG_NET_FC is not set
|
||||
# CONFIG_NET_TEAM is not set
|
||||
# CONFIG_MACVLAN is not set
|
||||
# CONFIG_IPVLAN is not set
|
||||
# CONFIG_VXLAN is not set
|
||||
# CONFIG_GENEVE is not set
|
||||
# CONFIG_BAREUDP is not set
|
||||
# CONFIG_GTP is not set
|
||||
# CONFIG_MACSEC is not set
|
||||
# CONFIG_NETCONSOLE is not set
|
||||
CONFIG_TUN=m
|
||||
# CONFIG_TUN_VNET_CROSS_LE is not set
|
||||
# CONFIG_VETH is not set
|
||||
# CONFIG_NLMON is not set
|
||||
# CONFIG_ARCNET is not set
|
||||
|
||||
#
|
||||
|
|
@ -2988,6 +3004,7 @@ CONFIG_VIDEO_RK_IRCUT=y
|
|||
# CONFIG_VIDEO_VS6624 is not set
|
||||
# CONFIG_VIDEO_MIS2031 is not set
|
||||
# CONFIG_VIDEO_MIS4001 is not set
|
||||
# CONFIG_VIDEO_MIS5001 is not set
|
||||
# CONFIG_VIDEO_MT9M001 is not set
|
||||
# CONFIG_VIDEO_MT9M032 is not set
|
||||
# CONFIG_VIDEO_MT9M111 is not set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue