Pi Zero W Project: Travel Storage Device

I am no expert, but since your saying that simply installing a desktop solved this one issue, it seems like that script is similar to how HotKey Automation functions where (for some reason) it requires a DE for it to work (HotKey Automation does nothing on the DE expect automatically open terminal to start the script).

As an update to PirateBox - it truly seems that it is so outdated that a few features/functions will not work with newer hardware (specifically, the Pi Zero W, circa 2017) nor will it allow me to connect to it via SMB (on a Windows 10 PC). I also do NOT like how it puts out an unsecured Wi-Fi signal (and, based on my limited knowledge, won’t let me change this - even after searching around the file system via terminal to find the hostapd info, I was not able to find the file containing the broadcast signal info).

PirateBox Update:
After further review of their website, I found information that will allow me to change the SSID as well as secure it. It also provides for many other option/feature changes that will be beneficial to this project. For now, I can call PirateBox a success, however I am still exploring other potential options.


DietPi OS + Hotspot Update:
Last night I decided to install a fresh copy of DietPi OS 32-bit on a separate SD Card and give the Hotspot function another shot. Using an Ethernet HAT (the same one in the picture in the original post) connected to a network switch, I setup DietPi along with the Hotspot and Samba Software via dietpi-software. After a reboot, I backed up the Pi Zero W using dietpi-backup just incase something goes wrong. Once the backup completed, I shutdown the Pi via shutdown -h now, unplugged the ethernet cable, and re-powered the Pi…

Results:
The results were successful! i.e.; even without being connected via ethernet, the Hotspot software still broadcasted a Wi-Fi signal from the Pi’s On-Board Wi-Fi module. I was able to connect to it, AND I was able to use SSH and Samba without any issues. Just to ensure that this wasn’t a fluke, I rebooted the Pi once more and was still able to connect, SSH in, and access the USB Flash Drive via Samba.

Notes:
I have a feeling that if I were to go into dietpi-config and change something, the Hotspot software would no longer work (although I have not tested this since I have the Pi setup the way I want).

Continued Testing:
About 20 mins ago, I hooked the ethernet cable back into the Pi and installed FuguHub since it’s WebDAV function plays well with the FE File Explorer iOS App. After the installation and setup of FuguHub, I rebooted just to make sure that the Hotspot software continued to broadcast a signal - it did! I will be testing to see if I can successfully upload and download files from my iPhone to the Pi’s attached USB Flash Drive later on tonight. I’ll report back then…

DietPi OS + Hotspot Update:
As promised, I went down to my car, setup the Pi with power, connected to the [DietPi’s] Wi-Fi Signal, and used Samba and FuguHub’s WebDAV server to upload and download files, pictures, and videos back and forth from my iPhone. I can now say that this project (using DietPi OS) has been a success and is my preferred method of offloading photos and videos from my iPhone. :sunglasses: And truthfully, I might even uninstall FuguHub and attempt to use the dietpi-sync function (along with iOS’s Siri Shortcuts to delete the videos and photos after syncing) to sync everything once it connects to the Wi-Fi SSID signal.

Another quick update for those who are looking to accomplish the same type of project (i.e.; using a GoPro or DJI product and want to offload photos and videos on-the-go), I discovered this GitHub repository from a guy that hacks GoPro’s and DJI Drones (and other DJI products).

He has provided an outline on how to control, see stats, and download media from both products mentioned above with HTTP Get commands via Windows and Linux. After testing his scripts, I’ve decided that this is the best option for me, although most options mentioned in this thread will work (and I will most likely mess around with them once I am back from my next road trip).

Happy hunting!

Yeah…once you setup the FuguHub and then use the link ip.address.of.pi0/fs it goes right to the filesystem and just being able to upload directly to the website is very nice
Simple to install
https://fuguhub.com/RaspberryPi.lsp

pushd /tmp/;rm -f install.sh;wget FuguHub.com/releases/raspberrypi/install.sh;chmod +x install.sh;sudo ./install.sh;popd

It works…

Indeed, however I installed FuguHub from the DietPi-Software Library. It seemed to be the only File/Media Server that was light enough to run on the Pi Zero without a ton of latency due to high CPU usage.

Looks like we need to add filebrowser: https://github.com/filebrowser/filebrowser
Or did you try Syncthing?




Whoa! Filebrowser… never even thought to search for something like that. After a cursory overview of the software, it seems very simply and every easy to implement. I am going to load up a fresh SD Card and see how this thing interacts with DietPi.


Syncthing was one of my initial ideas for keeping everything sync’d up between the Raspberry Pi Zero and my iPhone due it’s lightweight nature and ability to create automated scripts where once my iPhone connected to it’s Wi-Fi, it would begin the sync, however there is no iOS App for Syncthing. Theoretically I could

As another option for networking, I stumbled across this little script while cleaning up some of my Chrome bookmarks. Apparently I found this months ago, bookmarked it for later review, but forgot about it.

The W-Fi script that its using (http://downloads.fars-robotics.net/wifi-drivers/install-wifi) actually looks pretty promising as it automatically finds the correct driver needed for the USB Dongle.

filebrowser works well…did the unix installation

curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash

Then did the init for the database

filebrowser config init

and changed address from 127.0.0.1 to 0.0.0.0

filebrowser config set -a 0.0.0.0

, then exported it into the home user directory in .yaml format

filebrowser config export -c /home/user/filebrowser.yaml

Started it up

filebrowser -c /path/to/config.yaml

And boom!!!
It even generated thumbnails of files I had uploaded into a “test” directory…not ULTRA fast mind you…but it works flawlessly!

Awesome!!!

Oh man…it even allows for dragging an entire folder to the browser screen and uploading it!!!
Mind you I am using a PC not a phone…

Pardon my lack of knowledge, but can you explain why you did the following steps?





The Unix Installation Instruction states the following:
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
then…
filebrowser -r /path/to/your/files

Would the reason for the difference be due to the way Diet Pi OS is configured?

I manually installed it, didn’t know they had a filebrowser build

I ran it inside fubuhub /db directory

Stock it only listens on 127.0.0.1 so it will only answer the webpage ON the device…I was using my computer so I needed it to listen on all devices for the requests for the webpage

I then told it to create a config file rather than using everything stock, so I could modify the config as needed (and it would be a persistent change.

Stock config:

root@DietPi:/home/warhawk# filebrowser config cat
Sign up:          false
Create User Dir:  false
Auth method:      json
Shell:

Branding:
  Name:
  Files override:
  Disable external links:  false

Server:
  Log:           stdout
  Port:          8080
  Base URL:
  Root:          .
  Socket:
  Address:       127.0.0.1
  TLS Cert:
  TLS Key:
  Exec Enabled:  false

Defaults:
  Scope:         .
  Locale:        en
  View mode:     mosaic
  Single Click:  false
  Commands:
  Sorting:
    By:
    Asc:  false
  Permissions:
    Admin:     false
    Execute:   true
    Create:    true
    Rename:    true
    Modify:    true
    Delete:    true
    Share:     true
    Download:  true

Auther configuration (raw):

{
  "recaptcha": null
}

My config…rather large

root@DietPi:/home/warhawk# cat /home/bd/filebrowser.yaml
settings:
  key:
  - 110
  - 120
  - 104
  - 154
  - 38
  - 55
  - 162
  - 187
  - 126
  - 143
  - 57
  - 243
  - 210
  - 196
  - 56
  - 76
  - 59
  - 156
  - 193
  - 151
  - 0
  - 200
  - 77
  - 39
  - 184
  - 121
  - 234
  - 138
  - 216
  - 105
  - 207
  - 13
  - 184
  - 88
  - 237
  - 18
  - 43
  - 164
  - 140
  - 250
  - 138
  - 121
  - 173
  - 226
  - 11
  - 105
  - 5
  - 208
  - 215
  - 145
  - 98
  - 135
  - 89
  - 15
  - 39
  - 105
  - 232
  - 239
  - 143
  - 151
  - 105
  - 21
  - 41
  - 214
  signup: false
  createuserdir: false
  defaults:
    scope: .
    locale: en
    viewmode: mosaic
    singleclick: false
    sorting:
      by: ""
      asc: false
    perm:
      admin: false
      execute: true
      create: true
      rename: true
      modify: true
      delete: true
      share: true
      download: true
    commands: []
    hidedotfiles: false
  authmethod: json
  branding:
    name: ""
    disableexternal: false
    files: ""
    theme: ""
  commands:
    after_copy: []
    after_delete: []
    after_rename: []
    after_save: []
    after_upload: []
    before_copy: []
    before_delete: []
    before_rename: []
    before_save: []
    before_upload: []
  shell: []
  rules: []
server:
  root: .
  baseurl: ""
  socket: ""
  tlskey: ""
  tlscert: ""
  port: "8080"
  address: 0.0.0.0
  log: stdout
  enablethumbnails: false
  resizepreview: false
  enableexec: false
  typedetectionbyheader: false
auther:
  recaptcha: null

OoOoOoOoOoOhHhHh - ok, got it. Makes sense - I was following your steps and couldn’t get anything to work properly, haha and now I know why. I understand now.

I am going to try the normal install steps on a fresh copy of Diet Pi OS and see how it reacts.

Stay tuned…

Hmm, I just tried installing it on a fresh copy of Diet Pi OS and Raspberry Pi OS using the standard install instructions, but I have not been able to get it to function at all.

root@DietPi~: curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
...
root@DietPi~: filebrowser -r /

But when I run the second command filebrowser -r / it tells me that there is no ‘config’ file found but starts the server anyway… Listening on 127.0.0.1:8080.

What I am doing wrong here?

Edit: I just noticed that the fresh copy of Diet Pi OS is running the new Debian Bullseye image - could this be a possible issue? I have the previous image available, if needed.

Update on FileBrowser:

I was able to get it working on a fresh install of DietPi OS. I Added a USB Flash Drive prior to installing the script (formatted in Ext4), and ran dietpi-backup so I could revert back without having to reflash the SD Card. I then ran the following commands while in the USB Flash Drive’s directory:

root@TravelFilePi: /mnt/FileUSB# curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
root@TravelFilePi: /mnt/FileUSB# filebrowser config init
root@TravelFilePi: /mnt/FileUSB# filebrowser config set -a 0.0.0.0
root@TravelFilePi: /mnt/FileUSB# filebrowser users add <username redacted> <password redacted>
root@TravelFilePi: /mnt/FileUSB# filebrowser config export /mnt/FileUSB/filebrowser.yaml
root@TravelFilePi: /mnt/FileUSB# filebrowser -c /mnt/FileUSB/filebrowser.yaml

After running that last command, I was greeted by the server starting successfully:

2021/08/15 15:03:11 Using config file: /mnt/FileUSB/filebrowser.yaml
2021/08/15 15:03:11 Listening on [::]:8080

I navigated to the Pi’s IP address on my LAN followed by the port number ':8080" (http://192.168.xxx.xxx:8080) and was able to log in and upload/download files!

Now, the real question is: How do I get this script to start once the Raspberry Pi boots?

I guess you just need the last command to start the app again after reboot?

filebrowser -c /mnt/FileUSB/filebrowser.yaml

If yes, you could create your own systemd service.

Did some digging

Under method 4, would the ExecStart= just be the last command
such as

ExecStart=filebrowser -c /mnt/FileUSB/filebrowser.yaml

Or do you need to provide the explicit location of the filebrowser binary?

Worse comes to worse…a rc.local file I suppose…
Ah…here it is

This file might be useful for running filebrowser under Ubuntu and systemd:

[Unit]
Description=File browser: %I
After=network.target

[Service]
User=www-data
Group=www-data
ExecStart=/usr/local/sbin/filebrowser -c /etc/filebrowser/%I

[Install]
WantedBy=multi-user.target

>
> Put configuration files under /etc/filebrowser directory, for example default.yaml, and execute:
>
> ```text
sudo systemctl enable filebrowser@default.yaml.service

to start filebrowser on boot as a service.

Specific tweaks for user dietpi might be needed to ensure read/write ability in directories not associated with dietpi

Also putting it in the /etc/filebrowser directory prevents non authorized users from being able to see/tweak the config, but allows the program to have a static/persistent config file it can initiate from.

you would need to specify the full path to filebrowser executable.

I linked the discussion from the GitHub request: https://github.com/MichaIng/DietPi/issues/2560
Something for v7.6!

There are a BUCKETLOAT of options for the config that can be set in the config.yml file

root@DietPi:/home/warhawk# filebrowser config set --help
Updates the configuration. Set the flags for the options
you want to change. Other options will remain unchanged.

Usage:
  filebrowser config set [flags]

Flags:
  -a, --address string                     address to listen on (default "127.0.0.1")
      --auth.header string                 HTTP header for auth.method=proxy
      --auth.method string                 authentication type (default "json")
  -b, --baseurl string                     base url
      --branding.disableExternal           disable external links such as GitHub links
      --branding.files string              path to directory with images and custom styles
      --branding.name string               replace 'File Browser' by this name
      --cache-dir string                   file cache directory (disabled if empty)
  -t, --cert string                        tls certificate
      --commands strings                   a list of the commands a user can execute
      --disable-exec                       disables Command Runner feature
      --disable-preview-resize             disable resize of image previews
      --disable-thumbnails                 disable image thumbnails
      --disable-type-detection-by-header   disables type detection by reading file headers
  -h, --help                               help for set
      --img-processors int                 image processors count (default 4)
  -k, --key string                         tls key
      --locale string                      locale for users (default "en")
      --lockPassword                       lock password
  -l, --log string                         log output (default "stdout")
      --perm.admin                         admin perm for users
      --perm.create                        create perm for users (default true)
      --perm.delete                        delete perm for users (default true)
      --perm.download                      download perm for users (default true)
      --perm.execute                       execute perm for users (default true)
      --perm.modify                        modify perm for users (default true)
      --perm.rename                        rename perm for users (default true)
      --perm.share                         share perm for users (default true)
  -p, --port string                        port to listen on (default "8080")
      --recaptcha.host string              use another host for ReCAPTCHA. recaptcha.net might be useful in China (default "https://www.google.com")
      --recaptcha.key string               ReCaptcha site key
      --recaptcha.secret string            ReCaptcha secret
  -r, --root string                        root to prepend to relative paths (default ".")
      --scope string                       scope for users (default ".")
      --shell string                       shell command to which other commands should be appended
  -s, --signup                             allow users to signup
      --singleClick                        use single clicks only
      --socket string                      socket to listen to (cannot be used with address, port, cert nor key flags)
      --socket-perm uint32                 unix socket file permissions (default 438)
      --sorting.asc                        sorting by ascending order
      --sorting.by string                  sorting mode (name, size or modified) (default "name")
      --viewMode string                    view mode for users (default "list")

Global Flags:
  -c, --config string     config file path
  -d, --database string   database path (default "./filebrowser.db")

I guess the main thing to do is do the filebrowser config init to pre-generate a “stock” config, then exporting it to /etc/filebrowser/config.yaml, might even be a good place to put the filebrowser.db in /etc as well…but it could grow rather large I would bet

ah heck…here is the cli from the main website
https://filebrowser.org/cli