Git Product home page Git Product logo

Comments (15)

fgg89 avatar fgg89 commented on August 14, 2024

Hi @rosenk, unfortunately I don't have a Raspberry Pi 3 for testing. Was the docker container started successfully? otherwise the iw command will fail.

from docker-ap.

rosenk avatar rosenk commented on August 14, 2024

Yes the container even remains started after the fail. There is indeed a dir where

pi@raspberrypi:/var/run/netns $ ll
total 0
lrwxrwxrwx 1 root root 17 окт 12 15:23 9624 -> /proc/9624/ns/net

so everything prior iw is correct, but then when I manually try:

pi@raspberrypi:/var/run/netns $ sudo iw phy phy0 set netns 9624
command failed: Operation not supported (-95)

The same error occurs. Please help, It would be great to switch my raspberry to AP and back with docker

from docker-ap.

fgg89 avatar fgg89 commented on August 14, 2024

It seems that there is a problem when exporting the wifi interface of the Raspberry Pi 3 to a container, as pointed in the following link:

https://www.raspberrypi.org/forums/viewtopic.php?f=56&t=153212&p=1003680

I'm afraid I cannot help further here. I would give it a try with a USB wifi card to make sure the hardware (or possibly "iw"?) is the problem here.

from docker-ap.

N2ITN avatar N2ITN commented on August 14, 2024

@fgg89 Any thoughts on this?
https://stackoverflow.com/questions/30019734/docker-get-access-to-wifi-interface

from docker-ap.

rosenk avatar rosenk commented on August 14, 2024

My current take on this is to use create_ap. Probably it will work in docker --privileged too

from docker-ap.

N2ITN avatar N2ITN commented on August 14, 2024

I'm running now after replacing -net=bridge with -net=host in line 178 of docker_ap as per the SO link I posted, will let you know how it goes.

If it doesn't work I'll try create AP!

from docker-ap.

rosenk avatar rosenk commented on August 14, 2024

Thanks, and good luck

from docker-ap.

N2ITN avatar N2ITN commented on August 14, 2024

It worked.

from docker-ap.

N2ITN avatar N2ITN commented on August 14, 2024

I will upload to Dockerhub and specify it's for RPi3.

Quick question - do you know of a way to bridge to local wifi network instead of just ethernet?

from docker-ap.

fgg89 avatar fgg89 commented on August 14, 2024

Hi,

Thank you for the feedback! Running a container with -net=host will open up a security breach since the container networking will not be containerized.

Regarding the question of bridging a local wifi network, can you provide more details about this setup? remember that a wireless interface in managed mode cannot be bridged.

from docker-ap.

N2ITN avatar N2ITN commented on August 14, 2024

Good to know about security. Is password protection on the hotspot able to mitigate this?

About bridging, I made a locally hosted page with for users to enter wifi credentials to transfer the Pi to the user's network. Right now the docker-ap hotspot and the local web page + data entry work, as well as the script to connect to a new network (using the python wifi module). However, the two don't work together, even if I first stop the docker container before interfacing with wln0 with the wifi module.

from docker-ap.

fgg89 avatar fgg89 commented on August 14, 2024

Exposing the host networking to the docker container is unrelated to wireless encryption. You will find more info in the Docker documentation but basically the thing is that by using net=host you are able to access all the host network interfaces from the container and that goes against the idea of container isolation.

If I understand correctly, you want to be able to be connected to a wireless network and at the same time run docker_ap to create a hotspot using the same wireless interface? If that's the setup, it cannot work as the interface will only work as a client or as an access point, in that case you would either need an Ethernet connection or a second wireless interface.

from docker-ap.

rosenk avatar rosenk commented on August 14, 2024

As far as I know the rpi3 can't be simultaneously wifi access point and wifi client. That is a hardware limitation that can't be circumvented with docker tricks

from docker-ap.

N2ITN avatar N2ITN commented on August 14, 2024

I should have been clearer, I'm trying to set up an access point to get wireless credentials, store them, turn off the AP, then log on to wlan0 with provided credentials.

EDIT - This works:
Add bash script that starts AP + local web server to /etc/rc.local so it runs on boot --> enter credentials fro web interface, store to txt --> restart wlan with:

os.system('sudo ifconfig wlan0 down')
os.system('sudo ifconfig wlan0 up')

--> call wifi_login.py --> change startup script to call wifi_login.py instead of AP/web server

Not the most graceful solution but it works!

Will post to my account if anyone is interested.

from docker-ap.

fgg89 avatar fgg89 commented on August 14, 2024

I am not aware of any wireless interface that works in client and AP mode simultaneously, this is simply not possible. If you want to see your wireless interface capabilities and possible mode combinations you can run iw list.

Thank you for your feedback @N2ITN, I'm glad you found the project useful.

from docker-ap.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.