LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-20-2017, 06:47 PM   #1
Swoncen
LQ Newbie
 
Registered: Oct 2015
Posts: 18

Rep: Reputation: Disabled
ad-hoc network and setup wifi via app


Hello,

I'm not sure if this is in the correct subforum. I want to do the following to my raspberry pi 3 with ubuntu server:

- setup an ad-hoc network
- connect to that network and an app (android) configures a "real" network (wifi) with ssid and psk
- the network(s) entered in the app will be stored in a file on the raspberry pi and the networks will be loaded (in the interfaces file or rc.local?) one after another and the first one, where the pi can connect to, will be used.
- From now on, the wifi on the pi will be set to the set-up wifi.
- When none of the networks is available, the ad-hoc network should be on again. The optimal solution would be, that the ad-hoc network is only reachable, when the pi cannot connect to on of the entered networks.

My knowledge is linux is not good enough to make that working, so I would need some help.

Thanks in advance.
 
Old 08-24-2017, 08:02 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,459

Rep: Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827
Since no one has posted anything.

At one time Android devices could not connect to an ad-hoc network unless it was rooted. I do not know if this is still the case.

I've never tried to write a smartphone app so do not know how difficult it would be but it should be possible.

You can create a real wifi access point on the Pi and it should be possible to write a program to write to the wpa_supplicant.conf and interfaces file with the network information. wpa_supplicant will automatically connect to the available wifi. Not sure what is involved in automatically switching back to an AP if not connected.
 
Old 08-24-2017, 08:11 AM   #3
Swoncen
LQ Newbie
 
Registered: Oct 2015
Posts: 18

Original Poster
Rep: Reputation: Disabled
Hi Michael,

thank you very much for responding, that actually helped me alot. So instead of an ad-hoc network, I will try to create a wifi access point. I will try this next week and report if it was a success =)
 
Old 08-24-2017, 08:28 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,459

Rep: Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827Reputation: 5827
You can find some information on configuring multiple wifi networks but here is one link.

https://www.mikestreety.co.uk/blog/u...-wifi-networks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Setup A WiFi Network In Arch Linux Using Terminal? LXer Syndicated Linux News 0 10-26-2016 11:51 AM
[SOLVED] wifi setup through network manager... Monk Tea Slackware 27 09-14-2014 07:38 PM
rebuilding wifi to accept ad-hoc wifi addic Linux - Mobile 1 03-24-2011 09:25 AM
Cannot connect to ad-hoc WiFi Padawan.AVT Linux - Networking 2 05-14-2009 01:56 PM
how to setup wifi ad hoc network gopal_patil06 Linux - Networking 0 12-09-2008 08:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration