1

i use this https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md tutorial to turn raspberry pi3 to an access point and also i write a script to hide the ssid and another script to remove the access point but after running each script i should reboot the the raspi to see the changes. i want to know is there a way to switch between access point mode and none access point mode(remove the access point) or access point and hiding the ssid without rebooting the raspi? or is there any script that do this and i can use it? thank you update: the raspi should connect to the internet with ethernet cable while it become an AP and while it switch to the client mode it also connects to the internet with wifi and also ethernet cable.

ali
  • 37
  • 1
  • 5
  • 2
  • 1
    You always ask the same or similar questions switch between access point mode and none access point mode(station mode) in raspberry pi 3 (duplicate) and Switch Raspberry Pi 3 between access point and non-access point. You should finally follow one of the many suggested solutions now! If you cannot get it to work then please ask at that question and don't open always a new question. – Ingo Jan 13 '19 at 21:30
  • sorry, i didn't know that. – ali Jan 14 '19 at 06:21
  • @Ingo hello, by using your solution i can switch between client and AP mode. and i want to thank you for that. but i have a problem. the problem is i cant connect to the internet when i am in a client mode or when i connect to the AP with mobile phone. is it because i didn't remove the AP which i made before using your tutorial? (i couldn't leave this comment on that post so i ask it here.) – ali Jan 19 '19 at 12:37
  • @Ingo i have two ssid other than ssid="wlan@hoeft-online.de" with the same password that i set for this ssid in the file that you said to create for wlan0. and the wifi connection icon on desktop shows the two other ssid and none of them connects to the internet. – ali Jan 19 '19 at 13:37
  • You should not leave fragments from older installations like an access point before using systemd-networkd. The best is you start with a default unmodified Raspbian Stretch. The desktop integration of systemd-networkd isn't supported. Please read the "intro" from Howto migrate from networking to systemd-networkd with dynamic failover. – Ingo Jan 19 '19 at 22:26
  • @Ingo thank you. i should buy a new sd card and try that. isn't there a way to use raspbian stretch with desktop other than raspbian stretch light and then configure systemd-networkd that has a full connection. i really need to have desktop. – ali Jan 20 '19 at 06:54
  • @Ingo do i need to do step 4 Bonding ethernet and wlan or until step 3 is enough to have systemd-networkd for swapping between client and AP? – ali Jan 20 '19 at 07:03
  • If you follow the tutorial Switch between wifi client and access point without reboot then there no step about bonding. – Ingo Jan 21 '19 at 02:11
  • @Ingo i get a new sd card and install the newest raspbian stretch on it. i try your tutorial but after i reboot the pi it didn't show the wireless connection. when i switch to AP my phone can connect to the "RPiNet" network and it gets IP but it can not connects to the internet. and i also can not connect to the internet with ethernet cable on raspi. could you help me? – ali Jan 22 '19 at 10:58
  • Of course you cannot get into the internet with your mobile phone if you are connected to the access point. For this you need an additional connection from the RasPi to the internet router but that client connection is switched off. It is by design. If you want a wifi repeater you should have a look at Access point as WiFi repeater, optional with bridge. – Ingo Jan 22 '19 at 12:53
  • @Ingo and is there a solution about wireless connection and ethernet connection. they are disconnected. – ali Jan 22 '19 at 13:30
  • You asked how to switch the wifi from client mode to access point. Switch here means swap so when the one mode is on then the other is off. For this I have given you a link how to do this. There is nothing else asked, nothing about a wired connection on eth0 or other things. I cannot present any possible combination of the interfaces in the hope one may fit your needs. Please modify your question and explain what you want to do, for example: use an access point and connect the RasPi by wired or wireless ethernet to an internet router, so stations can get into internet. – Ingo Jan 22 '19 at 14:19
  • @Ingo i use these 3 tutorials: https://raspberrypi.stackexchange.com/questions/88214/setting-up-a-raspberry-pi-as-an-access-point-the-easy-way and https://raspberrypi.stackexchange.com/questions/93311/switch-between-wifi-client-and-access-point-without-reboot/93312#93312 and https://raspberrypi.stackexchange.com/questions/78787/howto-migrate-from-networking-to-systemd-networkd-with-dynamic-failover/78788#78788 to solve my problem. but they just remove the connection (wifi and lan) of my raspi and the "RPiNet" network doesn't even create this time. could you help me with my problem? – ali Jan 26 '19 at 11:37
  • @Ingo or could you help me with my problem or could you write another tutorial for it? – ali Jan 26 '19 at 11:37
  • You wrote in your question "i want to know is there a way to switch between access point mode and none access point mode(remove the access point)". This is exactly covered by Switch between wifi client and access point without reboot so only follow these instructions. This will switch the wifi. You do not wrote anything about a connection with eth0. So please describe in detail what you want. – Ingo Jan 26 '19 at 11:50
  • @Ingo i want the rasppi to swich between AP and client mode and the raspi should connect to the internet with ethernet cable while it become an AP and while it switch to the client mode it also connects to the internet with wifi and also ethernet cable. – ali Jan 26 '19 at 12:47
  • OK but it does not make sense to have the same connection two times to the internet in client mode. So a usable configuration is a permanent internet connection with ethernet cable and just switch on and of the access point. You don't need a wifi client mode. Could this be a solution for you? – Ingo Jan 26 '19 at 12:55
  • @Ingo no i need a normal client raspberry that can connect to the internet with ethernet and on board wifi and wifi adapter. and some times with a command it become and access point that it self can connects to the internet and the clients that connect to its network connect to the internet. if in AP mode there are more then one way to connect to internet would be better. so i need eth0 and wlan0 connection at AP mode. with switching on and off the AP i want to reduce the client contact with AP. – ali Jan 26 '19 at 13:29
  • It is not possible to have a failover internet connection as wifi client together with a wired connection in conjunction with an access point. It is only possible to have a wired connection that always connected to the internet, also clients that are connected to the access point. – Ingo Jan 26 '19 at 14:29
  • It may be possible if you buy a second USB/wifi dongle. – Ingo Jan 26 '19 at 19:43
  • @Ingo according to what you said it is possible to have an AP with wired connection that AP and its clients can connect to the internet or an AP with wifi dongle and also in client mode raspi can connect to the internet with both wifi and wired connection.could you answer this post with this condition? – ali Jan 27 '19 at 05:56
  • @Ingo i tried your tutorial Setting up a Raspberry Pi as an access point - the easy way and i use the general set up and Setting up an access point and with eth0, with routing but i can not connect to the internet neither with raspi nor with my phone that connects to AP network. i check the services and both of them were active (running) and i also change the DNS IP to 208.67.222.222,208.67.220.220 but it still can not connects to the internet. could you help me? – ali Jan 29 '19 at 07:47
  • @Ingo i have a problem at check point2. this is my check point1 output0ca644539fdaf4e19ec7cebf9e61c049b82ba45b1a21cdec91fa54bd59d660d2 2018-11-13-raspbian-stretch-full.zip and for check point2 after this command sudo -e boot/wpa_supplicant.confi ger error: editing files in a writable directory is not permitted i use this command chmod a-w boot/ but i still get that error. could you help me? – ali Jan 30 '19 at 11:29

1 Answers1

0

To verify your network environment and to keep things as simple as possible I suggest to use Raspbian Stretch Lite for a check up. In a first step you should setup an access point with a wired ethernet uplink to your internet router. You can follow this Check up - Setting up a Raspberry Pi as an access point. If it is running then with this know how you can install Raspbian Stretch with desktop and recommended software from scratch from the image. This way you can improve the installation step by step to your needs.

But you should know that you cannot manage the network from the Graphical User Interface. This is because we are using systemd-networkd but supported is default dhcpcd without modifications.

Please tell me what Checkpoint fails.

Ingo
  • 42,107
  • 20
  • 85
  • 197
  • You are using Raspbian Stretch with desktop and recommended software. You should start with Raspbian Stretch Lite. This will also fix the error editing files in a writable directory is not permitted. – Ingo Jan 30 '19 at 12:25
  • to solve the error instead of sudo -e boot/wpa_supplicant.conf i write sudo nano boot/wpa_supplicant.conf and continue the check points. check point3 was ok but in checkpoint4 after rebooting the raspi, the "RPiNet" doesn't show on my phone and checking the eth with ip -4 addr show dev eth0 shows the ip 169.254.x.x. should i try with raspbian light now? – ali Jan 30 '19 at 13:00
  • @ali Yes please use Raspbian Stretch Lite. Before Checkpoint 4 is no reboot. It is before Checkpoint 3. – Ingo Jan 30 '19 at 14:06
  • i use raspbian stretch lite. when i insert the commandsudo -e boot/wpa_supplicant.conf i get error:sudo: boot/wpa_supplicant.conf: editing files in a writable directory is not permitted Hangup. should i use sudo nano. i use ubuntu16 on a virtual machine, is it related to the problem? – ali Jan 31 '19 at 06:49
  • i try diffrent things like sudo chmod a-w boot/ sudo chmod 777 boot/ sudo chmod o+w boot/ and w !sudo nano boot/wpa_supplicant.conf but i cant change file mode it is readonly. – ali Jan 31 '19 at 07:47
  • @ali I do not understand why there is a message ... Hangup. What is hanging up? Yes, using a virtual machine is the problem. In the check up instructions I wrote I suppose you have a monitor, keyboard and mouse attached to your Raspberry Pi .... So please do that. And please do not fiddle with chmod. There is no need to do that. It makes things worse. – Ingo Jan 31 '19 at 10:20
  • hello, sorry for answering late. i lost my sd card and i also have problem to fine a linux os. i try your tutorial. i do the check point1 and check point 2 and everything was the same as the tutorial but at the end of check point2 it said to put the sd card in raspberry and boot. i do that(a few times) but it doesn't boot and nothing shows on desktop and only red light of raspi is turning on. could you tell me what the problem is and help me? thank you. – ali Feb 26 '19 at 07:02
  • @ali Flashing a SD Card and boot it is a very basic task. Hundreds of users have done it hundred times successful. If it does not work for you then there must be a general problem, maybe with your SD Card or with your Imaging program or with the hardware of your RasPi or something like this. Please follow the The Boot Problems Sticky to fix it. – Ingo Feb 26 '19 at 09:57
  • sorry to ask, can i burn the image on sd card without linux command? is burning the image without linux command change the result of the tutorial? i cant boot os with linux commands. – ali Mar 05 '19 at 10:28
  • @ali You should use etcher. How to do it, look at Installing operating system images. – Ingo Mar 07 '19 at 19:31
  • for check point 1 &2, i use etcher and install raspbian stretch full on raspberry and to create wpa_supplicant.conf i run this command sudo nano /etc/wpa_supplicant/wpa_supplicant.conf. and do the same as tutorial but at check point 5 when i run ping -I eth0 -c3 google.com i get this error:ping: google.com:temporary failure in name resolution.i add nameserver 208.67.220.220 to resolv.confand nothing change.(because i need proxy for authentication to connect to the internet i use raspbian stretch full. i cant connect to internet with proxy on raspbian lite). – ali Mar 09 '19 at 10:44
  • i also ping 8.8.8.8 instead of google.com and i got this error: PING 8.8.8.8 (8.8.8.8) from 192.168.50.60 eth0: 56(84) bytes of data. ping statistics: 3 packets transmitted, 0 received, 100% packet loss, time 2062ms – ali Mar 09 '19 at 10:46
  • @ali Now suddenly a proxy comes to play? That's to much for me. I don't know how to handle this in the known environment. – Ingo Mar 09 '19 at 10:54
  • ok , if i can, i try the tutorial without the proxy to see if i have that error or not. thank you. – ali Mar 09 '19 at 11:30