Pi Zero W Project: Travel Storage Device Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
User avatar
WarHawk
Posts: 773
Joined: Thu Jul 20, 2017 8:55 am

Re: Pi Zero W Project: Travel Storage Device

Post by WarHawk »

Joulinar wrote: Fri Jul 30, 2021 9:02 am You did used 2 WiFi adapter?
negative
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: Pi Zero W Project: Travel Storage Device

Post by Joulinar »

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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
dwr
Posts: 72
Joined: Thu Feb 18, 2021 3:46 am

Re: Pi Zero W Project: Travel Storage Device

Post by dwr »

WarHawk wrote: Fri Jul 30, 2021 6:33 am 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
Joulinar wrote: Fri Jul 30, 2021 10:27 am 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.
User avatar
WarHawk
Posts: 773
Joined: Thu Jul 20, 2017 8:55 am

Re: Pi Zero W Project: Travel Storage Device

Post by WarHawk »

Joulinar wrote: Fri Jul 30, 2021 10:27 am 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
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...
https://github.com/martin-ger/esp_wifi_repeater

Doing some poking around it might be a hostapd issue...checking...maybe it's a driver issue
https://unix.stackexchange.com/question ... -one-bssid
https://wireless.wiki.kernel.org/en/use ... on/hostapd
User avatar
MichaIng
Site Admin
Posts: 3216
Joined: Sat Nov 18, 2017 6:21 pm

Re: Pi Zero W Project: Travel Storage Device

Post by MichaIng »

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.
User avatar
dwr
Posts: 72
Joined: Thu Feb 18, 2021 3:46 am

Re: Pi Zero W Project: Travel Storage Device

Post by dwr »

WarHawk wrote: Sat Jul 31, 2021 1:54 am 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...
https://github.com/martin-ger/esp_wifi_repeater

Doing some poking around it might be a hostapd issue...checking...maybe it's a driver issue
https://unix.stackexchange.com/question ... -one-bssid
https://wireless.wiki.kernel.org/en/use ... on/hostapd
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.
MichaIng wrote: Sat Jul 31, 2021 4:06 pm 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.
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!
User avatar
Joulinar
Posts: 5619
Joined: Sat Nov 16, 2019 12:49 am

Re: Pi Zero W Project: Travel Storage Device

Post by Joulinar »

Thx for sharing your experience. I.have marked the request as solved, even if it's not fully done on DietPi ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
WarHawk
Posts: 773
Joined: Thu Jul 20, 2017 8:55 am

Re: Pi Zero W Project: Travel Storage Device

Post by WarHawk »

dwr wrote: Mon Aug 02, 2021 7:51 pm
WarHawk wrote: Sat Jul 31, 2021 1:54 am 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...
https://github.com/martin-ger/esp_wifi_repeater

Doing some poking around it might be a hostapd issue...checking...maybe it's a driver issue
https://unix.stackexchange.com/question ... -one-bssid
https://wireless.wiki.kernel.org/en/use ... on/hostapd
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.
MichaIng wrote: Sat Jul 31, 2021 4:06 pm 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.
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!
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
https://feldspaten.org/2020/04/01/a-vir ... -in-linux/
https://nims11.wordpress.com/2012/04/27 ... ess-point/


DietPi wifi does support AP on stock WLAN setup

Code: Select all

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])
https://github.com/lakinduakash/linux-wifi-hotspot

And this one...CLI only
https://github.com/garywill/linux-router
User avatar
WarHawk
Posts: 773
Joined: Thu Jul 20, 2017 8:55 am

Re: Pi Zero W Project: Travel Storage Device

Post by WarHawk »

aaaaaand nothing!!!!

Spent all night hacking away at it and it just won't work with DietPi scripting
User avatar
MichaIng
Site Admin
Posts: 3216
Joined: Sat Nov 18, 2017 6:21 pm

Re: Pi Zero W Project: Travel Storage Device

Post by MichaIng »

I'll also try it the next days. RPi Zero W on the way :).
Post Reply