diff --git a/README.md b/README.md index 4a61dd0..fabacd4 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,3 @@ In Meshtasticd's config.yaml we use GPIO bank 1, and subtract 32 from the pin nu > [!NOTE] > The information on this page is given without warranty or guarantee. Links to vendors of products are for informational purposes only. > 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. - diff --git a/environment-setup/foxbuntu-builder.sh b/environment-setup/foxbuntu-builder.sh index 0843777..3229318 100644 --- a/environment-setup/foxbuntu-builder.sh +++ b/environment-setup/foxbuntu-builder.sh @@ -62,7 +62,7 @@ clone_repos() { } clone_with_retries "https://github.com/LuckfoxTECH/luckfox-pico.git" || return 1 - clone_with_retries "https://github.com/noon92/femtofox.git" || return 1 + clone_with_retries "https://github.com/femtofox/femtofox.git" || return 1 return 0 } diff --git a/foxbuntu_install.md b/foxbuntu_install.md index a2f3d22..add4de2 100644 --- a/foxbuntu_install.md +++ b/foxbuntu_install.md @@ -1,28 +1,25 @@ + ## Foxbuntu Installation Guide ### Requirements for installing Foxbuntu To install Foxbuntu, you'll need the following: -1. microSD card. You can select one from [supported hardware](supported_hardware.md), but any card over 8gb and supporting UHS-I *should* work. -2. microSD card reader for your PC. -3. USB OTG adapter (USB-C to USB-A). -4. USB flash drive. -5. A Femtofox. +1. microSD card. You can select one from [supported hardware](supported_hardware.md), but any card over 8gb and supporting UHS-I *should* work + 2. microSD card reader for your computer + 3. A method to configure the Fox: + * USB OTG adapter (USB-C to USB-A) and a USB flash drive, OR + * USB-C cable to connect the Fox to your computer (Femtofox Pro only), OR + * USB UART serial adapter connected to UART2 (serial debug pins), OR + * An ethernet cable (models with ethernet port) +4. A Femtofox (duh!) ### Installation instructions 1. Download the latest stable [Foxbuntu release](https://github.com/noon92/femtofox/releases). At the bottom of the release, click the .7z file to download. 2. Flash the image your MicroSD card using [Balena Etcher](https://etcher.balena.io/) or your favorite flashing program. You will likely get a warning that the image appears to be invalid or has no partition table. This is normal. 3. Insert the microSD card into the Luckfox Pico Mini. The microSD slot is on the back of the board. -4. Following the instructions on the [USB Configuration Tool](usb_config.md) page, prepare your USB flash drive with your desired settings. -5. Using a USB OTG adapter, plug the USB flash drive into the *data* USB port. -> [!TIP] -> Optional: attach a USB to serial adapter to the Femtofox via the TX2 and RX2 pins for debug console. Remember to bridge the grounds! -> Optional: plug an RJ45 cable in to the ethernet port, if you have one installed. -7. Connect the Femtofox to power, either via the *power* USB-C port (on the same side as the ethernet port) or via the 3.3v or the 5v JST power plugs. -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: `femto` - -You will be prompted to change this on first login. - \ No newline at end of file +4. Configure the Femtofox using one of the following methods: + * For USB config, following the instructions on the [USB Configuration Tool](usb_config.md) page, prepare your USB flash drive with your desired settings. Using a USB OTG adapter, plug the USB flash drive into the *data* USB port (the port on the Luckfox. + * On Femtofox Pro, connect the *Power USB-C port* to your PC with a cable, and open a serial console application such as PuTTY for windows. Select your the Femtofox's COM port (find the correct COM port in Windows hitting WIN+R and entering `cmd /k wmic path Win32_SerialPort get DeviceID, Description && pause`. The port should be named "USB-SERIAL CH340". + * Use a USB UART serial adapter to connect to UART2 (serial debug pins). + * Use an ethernet cable and SSH in. Femtofox's default hostname is femtofox.local. +5. Connect the Femtofox to power, either via the *power USB-C port* (Pro model only, on the same side as the ethernet port) or via the power-in JST power plug. Using the USB-C port on the Luckfox is possible, but will prevent usage of USB peripherals. +6. 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. +7. Default username and password is `femto`:`femto`. You are required to change the password on first login. diff --git a/usb_config.md b/usb_config.md index 887b5b3..1ace2d6 100644 --- a/usb_config.md +++ b/usb_config.md @@ -1,79 +1,88 @@ + ## USB Configuration Tool To configure some Femtofox settings such as wifi, you can insert a USB flash drive containing a configuration file. On boot, the system will automatically recognize, mount and implement the settings you specify. The tool can also be run from the `femto-config` tool, in the `Utilities` menu. Configurable settings are: - - Wifi SSID - - Wifi PSK (password) - - Wifi country - - Timezone - - Meshtastic: - - LoRa radio model - - [URL](https://meshtastic.org/docs/software/python/cli/#--seturl-seturl) (used to configure LoRa settings and channels) - - Security: Add Admin Key - - Security: Clear Admin Key List - - Security: [Legacy Admin Channel](https://meshtastic.org/docs/configuration/radio/security/#admin-channel-enabled) enable/disable +- Wifi SSID +- Wifi PSK (password) +- Wifi country +- Timezone +- Activity LED (blinky light - disable for minor power savings) +- Meshtastic: + - [LoRa radio model](https://github.com/femtofox/femtofox/blob/main/supported_hardware.md) + - [URL](https://meshtastic.org/docs/software/python/cli/#--seturl-seturl) (used to configure LoRa settings/channels and generate the QR code) + - Security: [public key](https://meshtastic.org/docs/configuration/radio/security/#public-key) + - Security: [private key](https://meshtastic.org/docs/configuration/radio/security/#private-key) + - Security: Add [Admin Key](https://meshtastic.org/docs/configuration/radio/security/#admin-key) + - Security: Clear Admin Key List + - Security: [Legacy Admin Channel](https://meshtastic.org/docs/configuration/radio/security/#admin-channel-enabled) enable/disable ### Instructions The USB drive must be formatted with a single FAT32, exFAT, NTFS (read only - log will not be saved to drive) or ext4 partition. Add a file named `femtofox-config.txt` and whichever settings you would like to change (CaSe sEnSiTiVe). -     **[Get an example USB configuration file here](assets/femtofox-config.txt)** +[Get an example USB configuration file here](assets/femtofox-config.txt) ``` wifi_ssid="Your SSID name" wifi_psk="wifipassword" wifi_country="US" timezone="America/New_York" +act_led="enable" meshtastic_lora_radio="ebyte-e22-900m30s" meshtastic_url="https://meshtastic.org/e/#CgMSAQESCAgBOAFAA0gB" -meshtastic_admin_key="T/b8EGvi/Nqi6GyGefJt/jOQr+5uWHHZuBavkNcUwWQ=" +#meshtastic_public_key="XX=" +#meshtastic_private_key="XX=" +meshtastic_admin_key="XX=" meshtastic_legacy_admin="true" dont_run_if_log_exists="true" ``` > [!NOTE] > Enter as many or as few settings as you like. -> +> > For `wifi_country`, insert your country's [ISO/IEC alpha2 two letter country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) (such as US, GB, DE, IN, etc.) in capital letters. -> +> > Use a timezone as it appears in [the tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). > ->   **Meshtastic** +>   **Meshtastic** > For `meshtastic_lora_radio`, choose your radio from the supported hardware list. -> Options are: -> * `ebyte-e22-900m30s` -> * `ebyte-e22-900m22s` -> * `ebyte-e80-900m22s` *(experimental)* -> * `heltec-ht-ra62` -> * `seeed-wio-sx1262` -> * `waveshare-sx126x-xxxm` -> * `ai-thinker-ra-01sh` -> * `sx1262_tcxo` *(for Ebyte E22-900M30SM, Ebyte E22-900M22S, Heltec HT-RA62, Seeed Wio SX1262)* -> * `sx1262_xtal` *(for AiThinker RA01SH, and Waveshare Pi hat)* -> * `lr1121_tcxo` *(experimental, for Ebyte E80-900M2213S)* -> * `none` *(for simulated radio)* +> Options are: +> `ebyte-e22-900m30s` +> `ebyte-e22-900m22s` +> `ebyte-e80-900m22s` (experimental) +> - `heltec-ht-ra62` +> `seeed-wio-sx1262` +> `waveshare-sx126x-xxxm` +> `ai-thinker-ra-01sh` +> `sx1262_tcxo` (for Ebyte E22-900M30SM, Ebyte E22-900M22S, Heltec HT-RA62, Seeed Wio SX1262) +> - `sx1262_xtal` (for AiThinker RA01SH, and Waveshare Pi hat) +> - `lr1121_tcxo` (experimental, for Ebyte E80-900M2213S) +> - `none` _(for simulated radio) > -> Clearing the `meshtastic_admin_key` list: The admin key list can contain up to three keys - *if more are added they will be ignored*. The USB configuration tool supports clearing the admin key list, after which you will need to re-add your admin key/s in a second operation. To clear the admin key list, enter `meshtastic_admin_key="clear"`. +> Clearing the `meshtastic_admin_key` list: The admin key list can contain up to three keys - if more are added they will be ignored. The USB configuration tool supports clearing the admin key list, after which you will need to re-add your admin key/s in a second operation. To clear the admin key list, enter `meshtastic_admin_key="clear"`. > [!NOTE] > `dont_run_if_log_exists="true"` will prevent the USB configuration tool from working if there's a log present on the USB drive, indicating it has already been run. There is also an LED boot code for this, described below. -**To apply your configuration, reboot the Femtofox with the USB drive plugged in. No other USB drives can be plugged in at the same time.** +**To apply your configuration, reboot the Femtofox with the USB drive plugged in, or run `sudo femto-config` - `Utilites` - `Run USB configuration tool`. No other USB drives can be plugged in at the same time.** A log (`femtofox-config.log`) is saved to `/home/femto` and the USB drive (except on NTFS, which is read only).
### Boot codes When the Femtofox is finished booting, it will blink its User LED (see below) in a pattern which can be used to gather info on its status or help diagnose issues. ![LEDs](assets/images/leds.png) -| LED blink pattern | Meaning | Possible causes | Solutions | +| LED blink pattern | Meaning | Possible causes | Solutions | |--|--|--|--| -|
⚠️
________________
1 very long blink, lasting 5 seconds| Failed to mount USB drive. Ignoring.|
  • Invalid filesystem
  • Corrupted partition table
  • Defective USB drive
  • Defective USB OTG adapter |
  • Use a supported partition (FAT32, exFAT, NTFS, ext4)
  • Repair partition table
  • Try another USB drive
  • Try another USB OTG adapter | -|
    ⚠️
    \_\_\_\_\_  \_\_\_\_\_
    2 long blinks, each lasting 1.5 seconds | femtofox-config.txt is configured to skip if log exists. | USB drive mounted successfully but femtofox-config.txt contains `dont_run_if_log_exists="true"` and a log is present on the USB drive. Ignoring. | Remove log from USB drive or remove `dont_run_if_log_exists` line from femtofox-config.txt | -|
    ⚠️
    \_\_\_\_\_  \_\_\_\_\_  \_\_\_\_\_
    3 long blinks, each lasting 1.5 seconds | USB drive mounted successfully but femtofox-config.txt was not found. Ignoring.| Config file missing. | Create configuration file as described above. | -|
    ⚠️
    \_\_\_\_\_  \_\_\_\_\_  \_\_\_\_\_  \_\_\_\_\_  \_\_\_\_\_
    5 long blinks, each lasting 1.5 seconds | USB drive mounted successfully and femtofox-config.txt was found but did not contain readable configuration data. Ignoring.| Configuration file improperly formatted or contains no data. | Check configuration file contents as described above. | -|
    ⚠️
    \_\_\_  \_\_\_  \_  \_  \_\_\_  \_\_\_  \_  \_
    2 long blinks, each lasting 1 second, then 2 short blinks, each lasting 1/4 of a second. Repeats twice | Error while trying to implement a Meshtastic setting after 3 attempts. Some settings may have been implemented successfully.|
  • The error may be transient.
  • Configuration file may contain improper data. |
  • Try again.
  • Check configuration file contents as described above.
  • Check the log.

    This pattern may flash before other patterns. The pattern will repeat once for each failed setting.| -|
    ✅
    . . . . . . . . . .
    10 very fast blinks, each lasting 1/8th of a second | USB drive mounted successfully, and femtofox-config.txt was found and contained configuration data which was sent for deployment. Any affected services will now restart. You can disconnect the USB drive. | This does not mean that the information in the config file is correct - only that it was readable.
    Note that the "success" boot code will flash if at least one setting is successfully read - even if the setting was not implemented successfully.| -|
    ✅
    \_\_  \_\_  \_\_  \_\_  \_\_
    5 medium blinks, each lasting 0.5 seconds | Boot complete. Appears on every successful boot and always appears last.| | | - -> [!NOTE] +|

    ⚠️
    **──────────**
    1 very long blink, lasting 5 seconds

    | Failed to mount USB drive. Ignoring. | • Invalid filesystem
    • Corrupted partition table
    • Defective USB drive
    • Defective USB OTG adapter | • Use a supported partition (FAT32, exFAT, NTFS, ext4)
    • Repair partition table
    • Try another USB drive
    • Try another USB OTG adapter | +|

    ⚠️
    **───   ───**
    2 long blinks, each lasting 1.5 seconds

    | femtofox-config.txt is configured to skip if log exists. | USB drive mounted successfully but femtofox-config.txt contains `dont_run_if_log_exists="true"` and a log is present on the USB drive. Ignoring. | Remove log from USB drive or remove `dont_run_if_log_exists` line from femtofox-config.txt | +|

    ⚠️
    **───   ───   ───**
    3 long blinks, each lasting 1.5 seconds

  • | USB drive mounted successfully but femtofox-config.txt was not found. Ignoring. | Config file missing. | Create configuration file as described above. | +|

    ⚠️
    **───   ───   ───   ───   ───**
    5 long blinks, each lasting 1.5 seconds

    | USB drive mounted successfully and femtofox-config.txt was found but did not contain readable configuration data. Ignoring. | Configuration file improperly formatted or contains no data. | Check configuration file contents as described above. | +|

    ⚠️
    **──   ──   -   -**
    2 long blinks, each lasting 1 second, then 2 short blinks, each lasting 1/4 of a second. Repeats twice | Error while trying to implement a Meshtastic setting after 3 attempts. Some settings may have been implemented successfully. | • The error may be transient.
    • Configuration file may contain improper data. | • Try again.
    • Check configuration file contents as described above.
    • Check the log.

    This pattern may flash before other patterns. The pattern will repeat once for each failed setting. | +|

    ✅
    **·   ·   ·   ·   ·   ·   ·   ·   ·   ·**
    10 very fast blinks, each lasting 1/8th of a second

    | USB drive mounted successfully, and femtofox-config.txt was found and contained configuration data which was sent for deployment. Any affected services will now restart. You can disconnect the USB drive. | This does not mean that the information in the config file is correct - only that it was readable.
    Note that the "success" boot code will flash if at least one setting is successfully read - even if the setting was not implemented successfully. | | +|

    ✅
    **─   ─   ─   ─   ─**
    5 medium blinks, each lasting 0.5 seconds

    | Boot complete. Appears on every successful boot and always appears last.| | Hooray! | +> \[!NOTE\] > Boot codes can appear in sequence - for example: one long (4 second) blink, followed by 5 medium (half second) blinks means the USB drive failed to mount, and that the boot sequence is complete. \ No newline at end of file +eyJoaXN0b3J5IjpbLTE5OTAxODA3OSwtMjYyOTMyNDldfQ== + + +> \[!NOTE\] +> Boot codes can appear in sequence - for example: one long (4 second) blink, followed by 5 medium (half second) blinks means the USB drive failed to mount, and that the boot sequence is complete.