diff --git a/README.md b/README.md index 5a33c4b..4a61dd0 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ The Luckfox Pico Mini is the postage stamp sized heart of the Femtofox - a compa - [x] USB mass storage - [x] Real time clock (RTC) support (see [supported hardware](supported_hardware.md)) - [x] Activity LED disabled. User LED will blink for 5 seconds when boot is complete -- [x] Pressing the "BOOT" button triggers reboot +- [x] Short pressing the "BOOT" button toggles wifi, 2-5 second press triggers reboot, 5+ second press shuts system down - [x] Ability to reconfigure wifi via USB flash drive - [x] Meshtasticd to run LoRa radio over SPI (accomplished, updated image and instructions coming soon) - [x] Allow editing of config files by plugging in thumb drive @@ -79,4 +79,4 @@ In Meshtasticd's config.yaml we use GPIO bank 1, and subtract 32 from the pin nu > 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. \ No newline at end of file +--> diff --git a/environment-setup/femtofox.chroot b/environment-setup/femtofox.chroot index e2a3a4e..6168a8c 100644 --- a/environment-setup/femtofox.chroot +++ b/environment-setup/femtofox.chroot @@ -27,14 +27,14 @@ 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 +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 if [[ $? -eq 2 ]]; then echo "Error, step failed..."; fi DEBIAN_FRONTEND=noninteractive apt upgrade -y --option Dpkg::Options::="--force-confold" # Tempfix for SEGFAULT wget https://github.com/meshtastic/firmware/releases/download/v2.5.11.8e2a3e5/meshtasticd_2.5.11.8e2a3e5_armhf.deb DEBIAN_FRONTEND=noninteractive apt install -y --option Dpkg::Options::="--force-confold" ./meshtasticd_2.5.11.8e2a3e5_armhf.deb - +rm ./meshtasticd_2.5.11.8e2a3e5_armhf.deb echo "Installing dependencies for meshing-around and meshtastic cli..." #pip config set global.extra-index-url https://www.piwheels.org/simple diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/avahi/services/meshtasticd.service b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/avahi/services/meshtasticd.service index ec56664..e0e3ece 100644 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/avahi/services/meshtasticd.service +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/avahi/services/meshtasticd.service @@ -3,7 +3,7 @@ Meshtastic - _http._tcp - 80 + _meshtastic._tcp + 4403 \ No newline at end of file diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh index 7c75d94..ac32818 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-software.sh @@ -121,7 +121,7 @@ title="$title" option="" option=$(dialog --cancel-label "Back" --menu "$title" 0 0 6 \ 1 "The Comms Channel BBS, TC²BBS" \ - 2 "Curses Client for Meshtastic" \ + 2 "Contact (Meshtastic client)" \ 3 "Meshing Around by Spud" \ 4 "Mosquitto MQTT Broker" \ 5 "Mosquitto MQTT Client" \ @@ -135,7 +135,7 @@ title="$title" case $option in 1) package_intro "tc2_bbs" ;; - 2) package_intro "curses_client" ;; + 2) package_intro "contact_client" ;; 3) package_intro "meshing_around" ;; 4) package_intro "mosquitto_mqtt_broker" ;; 5) package_intro "mosquitto_mqtt_client" ;; @@ -150,4 +150,4 @@ exit 0 # 5 "GPS and Telemetry" \ # 4) mosquitto ;; - # 5) gpsd ;; \ No newline at end of file + # 5) gpsd ;; diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/curses_client.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/contact_client.sh similarity index 83% rename from foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/curses_client.sh rename to foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/contact_client.sh index 137cb00..4e18dd0 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/curses_client.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/packages/contact_client.sh @@ -44,14 +44,14 @@ EOF # Everything following `user_message: ` will be displayed prominently to the user, so it must the last thing echoed -name="Curses Client for Meshtastic" # software name +name="Contact" # software name author="pdxlocations" # software author - OPTIONAL -description="Command line client using the curses library, powered by Meshtastic.org.\nAfter install, run \`curses\` to launch." # software description - OPTIONAL (but strongly recommended!) -URL="https://github.com/pdxlocations/curses-client-for-meshtastic/" # software URL. Can contain multiple URLs - OPTIONAL +description="A Text-Based Console UI for Meshtastic Nodes.\nAfter install, run \`contact\` to launch." # software description - OPTIONAL (but strongly recommended!) +URL="https://github.com/pdxlocations/contact/" # software URL. Can contain multiple URLs - OPTIONAL options="xiuglNADUOLIto" # script options in use by software package. For example, for a package with no service, exclude `edsr` -launch="python /opt/curses-client-for-meshtastic/main.py --host" # command to launch software, if applicable +launch="python /opt/contact/main.py --host" # command to launch software, if applicable service_name="" # the name of the service/s, such as `chrony`. REQUIRED if service options are in use. If multiple services, separate by spaces "service1 service2" -location="/opt/curses-client-for-meshtastic" # install location REQUIRED if not apt installed. Generally, we use `/opt/software-name` +location="/opt/contact" # install location REQUIRED if not apt installed. Generally, we use `/opt/software-name` conflicts="" # comma delineated plain-text list of packages with which this package conflicts. Blank if none. Use the name as it appears in the $name field of the other package. Extra plaintext is allowed, such as "packageA, packageB, any other software that uses the Meshtastic CLI" @@ -64,20 +64,20 @@ fi # install script install() { - if ! git clone https://github.com/pdxlocations/curses-client-for-meshtastic.git /opt/curses-client-for-meshtastic; then + if ! git clone https://github.com/pdxlocations/contact.git /opt/contact; then echo "user_message: Git clone failed. Is internet connected?" exit 1 fi chown -R femto $location #give ownership of installation directory to $user git config --global --add safe.directory $location # prevents git error when updating - echo "Creating \`curses\` shortcut." + echo "Creating \`contact\` shortcut." echo -e "#!/bin/bash\n\ export NCURSES_NO_UTF8_ACS=1\n\ export TERM=xterm-256color\n\ export LANG=C.UTF-8\n\ -$launch" | sudo tee /usr/local/bin/curses > /dev/null - chmod +x /usr/local/bin/curses - echo "user_message: To launch, run \`curses\`." +$launch" | sudo tee /usr/local/bin/contact > /dev/null + chmod +x /usr/local/bin/contact + echo "user_message: To launch, run \`contact\`." exit 0 # should be `exit 1` if the installation failed } @@ -85,7 +85,7 @@ $launch" | sudo tee /usr/local/bin/curses > /dev/null # uninstall script uninstall() { rm -rf $location - rm /usr/local/bin/curses + rm /usr/local/bin/contact echo "user_message: All files removed." exit 0 # should be `exit 1` if the installation failed } diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/wifi-mesh-control.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/wifi-mesh-control.sh index 4757a4f..0ff79a6 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/wifi-mesh-control.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/wifi-mesh-control.sh @@ -53,7 +53,7 @@ sync_states() { log "Synced mobile Wi-Fi state to $text_state." fi - current_wlan_state=$(ip link show wlan0 | grep -q 'state UP' && echo "up" || echo "down") + current_wlan_state=$(cat /sys/class/net/wlan0/operstate) if [[ "$text_state" != "$current_wlan_state" ]]; then set_wlan_state "$text_state" log "Synced wlan0 state to $text_state." @@ -63,7 +63,7 @@ sync_states() { monitor_changes() { local previous_mobile_state previous_wlan_state previous_mobile_state=$(get_mobile_wifi_state) - previous_wlan_state=$(ip link show wlan0 | grep -q 'state UP' && echo "up" || echo "down") + previous_wlan_state=$(cat /sys/class/net/wlan0/operstate) while true; do PID=$(ps -C meshtasticd -o pid= | tr -d ' ') @@ -71,7 +71,7 @@ monitor_changes() { #if sudo lsof /dev/spidev0.0 | grep -q "meshtasticd"; then local current_mobile_state current_wlan_state current_mobile_state=$(get_mobile_wifi_state) - current_wlan_state=$(ip link show wlan0 | grep -q 'state UP' && echo "up" || echo "down") + current_wlan_state=$(cat /sys/class/net/wlan0/operstate) if [[ "$current_mobile_state" != "$previous_mobile_state" ]]; then log "Detected mobile Wi-Fi state change: $previous_mobile_state -> $current_mobile_state" diff --git a/foxbuntu_install.md b/foxbuntu_install.md index 0807a58..a2f3d22 100644 --- a/foxbuntu_install.md +++ b/foxbuntu_install.md @@ -20,4 +20,9 @@ To install Foxbuntu, you'll need the following: 8. The Femtofox will perform its first boot. This can take up to 5 minutes (subsequent boots ~40 seconds). When boot is complete, the USR LED will blink 5 times, 1/2 a second each. At this point, Meshtastic should be running and if you plug in a wifi adapter it should work. 9. To connect to your Femtofox via SSH, open [PuTTY](https://www.putty.org/) or your favorite SSH client and connect to your Femtofox via `femtofox.local` or its IP (check your router). * Username: `femto` - * Password: `fox` + * Password: `femto` + +You will be prompted to change this on first login. + \ No newline at end of file