Pi Zero W Project: Travel Storage Device

Greetings,

Before I begin, I want to outline the hardware and software that I will be using:

Hardware:

  • Raspberry Pi Zero W
  • USB + Ethernet Expansion HAT (Connected via GPIO and MicroUSB Data Port)
  • SanDisk 64GB Flash Drive (for ‘dietpi_userdata’ and Photo, Video, & File Storage)
  • (Optional) TP-Link TL-WN725N USB Wi-Fi Dongle

Software:

  • DietPi OS (32bit)
  • NextCloud (Photo, Video, & File Storage)
  • Wi-Fi Hotspot (to connect a device to to transfer files)

Project Goals:
I am attempting to setup a Travel Storage Device to transfer photos and videos to. The goal is to have the Pi Zero W put off a Wi-Fi signal via the Hotspot software to which I will connect to and upload photos, videos, and files through the NextCloud software. Due to the setup that I am using, I do not require the Pi Zero to have access to the internet via Wi-Fi since I will use an ethernet connect for updates, etc - I simply need it to put off a Wi-Fi signal for me to connect to.

Initial Thoughts and Subsequent Issues:
My initial thought process included using the TP-Link Wi-Fi USB Dongle as the Wi-Fi transmitter (via the Hotspot Software), and the Pi’s On-Board Wi-Fi to connect to the internet for updates. However, I found that DietPi OS does not recognize the USB W-Fi Dongle after the initial setup and reboot. Since that wasn’t working, I tried to simply use the On-Board Wi-Fi as both the transmitter and receiver, but ‘dietpi-software’ would not allow me to install the Hotspot Software without a network connection through the ethernet port.

So, my question is simple: What is the easiest and most efficient way for me to set this up?

Best bet would be to just set it up as a WIFI AP, then use your phone to direct connect to the AP’s SSID, then you can directly use either a URL or simply the DNS IP of the AP as the connector to Nextcloud and then sync the images that way.

Heck you could probably run a full bore photo gallery (included in Dietpi Software Store)

I did so some digging…I found this guy created a dual SSID build on a RPi0W that no only broadcasts it’s own SSID, but appears it can connect to a wifi AP directly as well (not sure it can route thru it…maybe it can)
He is an Amateur Radio guy so it’s a bit in depth
https://www.youtube.com/watch?v=TO6lmroNDRU
https://github.com/km4ack/pi-scripts

Yes, that is what my goal is here, however I am unable to get DietPi to work like this. As mentioned above, I was going to set it up using the Hotspot software included with DietPi. Maybe the Hotspot software is the wrong way to go in this scenario… Thoughts on a better software solution?

I run multiple websites with Lychee and other photo gallery software through my hosting business so I am familiar with this but figured that running NextCloud on the Pi Zero for this special project would be more… robust… since it allows me to upload whatever I need to it. But I am always open to others’ opinions and solutions - thoughts?

It’s funny that you mention this as I am actually a registered HAM Radio operator, haha! I will check out his GitHub tomorrow to see if anything that he currently has posted will work for me. As a side note, RaspAP will also do what you mentioned here (broadcasting an AP as well as receiving signal) but I would much rather work with DietPi since it allows me to be more flexible with additional software installations (since the software that is available through DietPi will work in conjunction with each other).

Yes the HotSpot implementation of DietPi is not that flexible. For installation, it require an Ethernet (eth0) as well as WiFi (wlan0) interface and of course an internet connection to be able to download packages needed.

As an alternative, RaspAP should be working as well.

I actually tried installing RaspAP on top of DietPi last year but was unable to get it to work properly. If you are able to provide me with some detail about getting it to work with with DietPi, I would be extremely grateful since that would solve my issue.

I probably should have put this in the original post, but I am attempting to mirror this project: SUBZero (Secure USB Backup Zero) - however, with this project, one cannot change where the files are “uploaded” to nor is there an interface to view the already uploaded files (which is why I wanted to use NextCloud). Thoughts on an alternative?

Just for reference: https://github.com/MichaIng/DietPi/issues/2813
RaspAP install experiences/attempts can be at best discussed there.

Indeed - I found this will Google’ing “DietPi RaspAP”.

I found this as well while searching for the above:

Might be worth a shot, but not using DietPi unfortunately. I suppose I could install NextCloud manually or simply use Samba. I’ll report back with my results, but if anyone has any other suggestions or tips to make something like I mentioned in the original post, please let me know.

Well if the DietPi AP one doesn’t work then a side load of RaspAP will work just fine…the other apps in DietPi will work just as advertised, it’s just the scripting to get the wireless card to operate smoothly just isn’t up to snuff…

I have sideloaded many non DietPi programs into a DietPi build…they just don’t auto stop/start with the DietPi-config scripts…and will have to use the init or systemctl commands to restart/control, so the RaspAP might be the best cleanest/easiest option to go with (however there might be quite a bit of manual installation needed) Manual installation - RaspAP Documentation ← maybe the devs can look at this and build a working script to do a proper install of RaspAP directly on DietPi as an actual DietPi package

DietPi is based off of Debian (just heavily scripted) so any commands to run/install apps on Debian will work on DietPi

73’s KF5CIF

Just tried it…didn’t work

Sacrificed my Pwnagotchi build (imaged the card first of course) and installed the latest DietPi image on it…and attempted the install…no go…it would connect to the wireless but would not broadcast the AP SSID for the Captive Portal…I tried all night to get it to work but no go

Nope tried the YouTube video version as well…no go, I can see the WIFI SSID but when I connect, I get no DHCP address from the RPi0W…I did see when installing the guys script it did give and error on the hostapd install (but the script disables it ??)

Dunno what to do, following the video was easy enough…and it installed straight forward but due to the scripting of DietPi it really messes with the scripting of the AP scripting…dunno what to do…sorry

You did used 2 WiFi adapter?

negative

I guess you would need to use 2 interfaces.

A WiFi adapter to broadcast the AP SSID and a 2nd interfaces to create the local network connection to the internet



So, as I mentioned in my last post, I found an option via this script using a fresh copy of RPi OS Lite. After installing and testing all three options that he provides, I found that option 1 will work the best for me. I then decided to install an instance of NextCloudPi via their “Debian” installation script - after some brief testing late last night, I realized a few conflicting items and was able to correct them. I will be testing it more this evening and/or over the week - I will report back with results.

I was just hoping there was a way to create a 2nd SSID on one device…

This guy did it with a simple ESP01 and it works flawlessly…

Doing some poking around it might be a hostapd issue…checking…maybe it’s a driver issue

https://wireless.wiki.kernel.org/en/users/Documentation/hostapd

Definitely two network adapters are required to make this work. Either 1 WiFi and 1 Ethernet, or two WiFi adapters. One adapter cannot broadcast an access point with DHCP etc as a local network, while connecting to the internet the same time. So to test things, this would be the way to go:

  • Install and setup DietPi the regular way, with whichever network adapter used for internet connection.
  • If not present, attach an additional WiFi adapter and follow guides or use install scripts to install RaspAP or any other WiFi access point implementation with this additional WiFi adapter as access point/DHCP server target. This should definitely work as DietPi does not interfere with the regular Debian network stack in any way, as long as you do not run dietpi-config > Network Options: Adapters and explicitly apply changed network settings (which overwrites /etc/network/interfaces). So that needs to be avoided, generally when any custom network setup has been done.
  • The only thing I can imagine a guide/installer with Raspberry Pi OS in mind could fail, is when it expects and does setup via dhcpcd. But that is bad practice, as it is a misuse of a DHCP client, when you want a static IP and a DHCP server instead. Still, some installers surprisingly do it like that.

Appreciate the resources provided! This can absolutely be done since RaspAP has transformed a few of my Pi Zero W’s into simple repeaters in the past. The ESP boards are an idea that I have been planning to explore more, but with time constraints being what they are, I will need to explore that possibility down the road.

This is great info! Thanks for clearing this up and providing steps to accomplish what I need, albeit ‘a delicate’ process.

I did find a simple solution for this project - I found a GL.iNet Mango Router that I wasn’t using and since it comes with OpenWRT on it, I was able to setup simple Samba sharing features. It has a USB Port too, so I simply plugged in a 128GB USB Flash drive and BOOM, it just worked. In the future I might explore more ‘syncing’ options through the DietPi OS, but for now this solution will allow me to offload pictures and videos to the USB drive from my iPhone’s ‘Files’ App as needed.

I did find a few other solutions along the way (one of which was my previous post which actually worked decently well) such as VirtualHere’s CloudHub OS (based on OpenWRT as well) and a combination of OpenMediaVault and RaspAP (although it won’t work on a Pi Zero due to hardware limitations), but as I mentioned, the Gl.iNet Mango Router with File Sharing turned on will work just fine.

Thanks to all that provided info!

Thx for sharing your experience. I.have marked the request as solved, even if it’s not fully done on DietPi :wink:

Never thought of that…yeah DDWRT (spinoff of OpenWRT) on some routers can do samba sharing over wifi and to a USB pendrive…didn’t even think of that.

hostapd is definitely the way to go for creating “virtual” wlans on a single wlan device

DietPi wifi does support AP on stock WLAN setup

root@DietPi:~# iw list | grep "Supported interface modes" -A 8
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * P2P-client
                 * P2P-GO
                 * P2P-device
        Band 1:
                Capabilities: 0x1020

I found this…trying it out (w/ GUI [not sure a desktop install of XFCE is needed or not])

And this one…CLI only

aaaaaand nothing!!!

Spent all night hacking away at it and it just won’t work with DietPi scripting

I’ll also try it the next days. RPi Zero W on the way :slight_smile:.