How to set WIFI in Debian?

4,315 views
Skip to first unread message

Hugo Mallo

unread,
Feb 4, 2016, 1:05:29 PM2/4/16
to BeagleBoard

Hello everybody, I am quite new in BBB's world and I feel stuck in a ridiculous way as I am not able to connect BBB by WIFI, by editing /etc/network/interfaces and as I am trying to  connect with and WPA WIFI, I ought to edit the file /etc/wpa_supplicant/wpa_supplicant.conf .

I want to have BBB WIFI and able to change SSID, PSK, IP, NETMASK.... and so on, just using node js which modifies the interfaces and wpa_supplicant.conf  files and restarting the wlan0 interface, so tools like wicd or connman (I used them and worked perfectly) are not the best way as them limit the way to change settings.

I've been trying almost everything I found over Internet, with no results.

STARTING POINT:

  • Beaglebone Black Rev C
    • Distributions used:
      • Debian GNU/Linux 8.3 Jessie (I rather prefer to use this)
        • Kernel 4.1.15-ti-rt-r43
      • Debian 8.2 Jessie (is a tester distribution so I prefer not to use this one)
      • Debian 7.9 Wheezy (If anything goes well, I wont reject using this)
  • USB WIFI Adapter TL-WN722N & AWUS036H
  • WIFI with WPA2-Personal
The most common issue I get is .... after writing interfaces... I try to connect and:

root@beaglebone:/etc/network# ifup wlan0

Internet Systems Consortium DHCP Client 4.3.1

Copyright 2004-2014 Internet Systems Consortium.

All rights reserved.

For info, please visit https://www.isc.org/software/dhcp/

 

Listening on LPF/wlan0/d8:5d:4c:87:68:6c

Sending on   LPF/wlan0/d8:5d:4c:87:68:6c

Sending on   Socket/fallback

DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4

DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6

DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11

DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14

DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21

DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5

No DHCPOFFERS received.

No working leases in persistent database - sleeping.



I hope someone could help me !!! Thank you so much for you attention and help!!

Robert Nelson

unread,
Feb 4, 2016, 1:11:37 PM2/4/16
to Beagle Board
On Thu, Feb 4, 2016 at 12:05 PM, Hugo Mallo <hugomal...@gmail.com> wrote:
> Hello everybody, I am quite new in BBB's world and I feel stuck in a
> ridiculous way as I am not able to connect BBB by WIFI, by editing
> /etc/network/interfaces and as I am trying to connect with and WPA WIFI, I
> ought to edit the file /etc/wpa_supplicant/wpa_supplicant.conf .

nah use connman, i have it installed by default on jessie images. ;)

~$ sudo connmanctl
connmanctl> enable wifi
Enabled wifi

connmanctl> scan wifi
Scan completed for wifi

connmanctl> services
*AO Wired ethernet_74d435b65be6_cable
Avenger wifi_14cc201db6f6_4176656e676572_managed_psk

connmanctl> agent on
Agent registered

connmanctl> connect wifi_14cc201db6f6_4176656e676572_managed_psk
Agent RequestInput wifi_14cc201db6f6_4176656e676572_managed_psk
Passphrase = [ Type=psk, Requirement=mandatory ]

Passphrase? wine n dine
Connected wifi_14cc201db6f6_4176656e676572_managed_psk

connmanctl> quit

check:

sudo ifconfig -a

Regards,

--
Robert Nelson
https://rcn-ee.com/

DeKay

unread,
Feb 5, 2016, 10:22:53 PM2/5/16
to BeagleBoard
Networkmanager and nmtui makes wireless setup trivial.  And I'd recommend setting GOVERNOR="performance" while you are at it.

http://madscientistlabs.blogspot.ca/2015/01/wifi-on-beaglebone-black-with-systemd.html

Drew Fustini

unread,
Feb 6, 2016, 3:28:53 PM2/6/16
to beagl...@googlegroups.com
On Thu, Feb 4, 2016 at 12:10 PM, Robert Nelson <robert...@gmail.com> wrote:
> Passphrase? wine n dine

thanks for the instructions. I've shied away from connman in the past
as I wasn't sure of the commands to...

plus now we can use your wifi when visiting Northern Minnesota :)

> Connected wifi_14cc201db6f6_4176656e676572_managed_psk

just curious, what generates that identifier?


thanks,
drew

Robert Nelson

unread,
Feb 6, 2016, 4:33:38 PM2/6/16
to Beagle Board
> thanks for the instructions. I've shied away from connman in the past
> as I wasn't sure of the commands to...
>
> plus now we can use your wifi when visiting Northern Minnesota :)

Yeah, for wifi connman works awesome. ethX not always. ;)

>
>> Connected wifi_14cc201db6f6_4176656e676572_managed_psk
>
> just curious, what generates that identifier?

Both the ssid and mac, it's a connman thing for identification.

Jason Kridner

unread,
Feb 15, 2016, 5:14:09 PM2/15/16
to BeagleBoard


On Thursday, February 4, 2016 at 1:11:37 PM UTC-5, RobertCNelson wrote:
On Thu, Feb 4, 2016 at 12:05 PM, Hugo Mallo <hugomal...@gmail.com> wrote:
> Hello everybody, I am quite new in BBB's world and I feel stuck in a
> ridiculous way as I am not able to connect BBB by WIFI, by editing
> /etc/network/interfaces and as I am trying to  connect with and WPA WIFI, I
> ought to edit the file /etc/wpa_supplicant/wpa_supplicant.conf .

nah use connman, i have it installed by default on jessie images. ;)

~$ sudo connmanctl
connmanctl> enable wifi

If connected to BeagleBone with it acting as an access point (AP), this seems to result in immediately losing connection. Is there a way to keep the AP active?

Brian Anderson

unread,
Feb 16, 2016, 6:35:14 PM2/16/16
to BeagleBoard



nah use connman, i have it installed by default on jessie images. ;)

~$ sudo connmanctl
connmanctl> enable wifi

If connected to BeagleBone with it acting as an access point (AP), this seems to result in immediately losing connection. Is there a way to keep the AP active?

Ya.  I don't think connman plays well with create_ap.  You can probably work around this by telling connman to not manage wlan0 by placing something like the following in /etc/connman/main.conf

NetworkInterfaceBlacklist=wlan

This will prevent connman from attempting to manage _any_ wlan interface.  But of course, you won't later be able to use connman with that interface to connect as a STA.

It seems to be a point of confusion about how to setup and manage persistent settings for networking.  People often are tripped up by the fact that connman may be interfering with their attempts to make changes using /etc/network/interfaces and friends.  It would be great if we could come up with ways to prevent this confusion.

I do know that connman will setup an AP (called tethering).  Unfortunately, the only way I could get this to work was by stopping dnsmasq.  For some reason, dnsmasq was preventing connman for establishing the AP...my guess is that connman wants to do DHCP and conflicts with dnsmasq.

I wonder if it would be possible to have connman manage the USB link and thus avoid all the hackery in /etc/network/interfaces and dnsmasq?

Alternatively, I wonder if network manager might be a better all around choice for one stop shopping for network management in lieu of connman?  I don't have any personal experience, but others (DeKay) have supposedly had luck using nm.



 

Jason Kridner

unread,
Feb 17, 2016, 11:39:24 AM2/17/16
to BeagleBoard
Perhaps we need to fully define the requirement such that experts can provide the lowest memory and least complex solution?

usb0 should act as a DHCP server to simplify connecting to a PC. It should generally not provide a gateway such that it doesn't interfere with the PC's network. Often, people will want to bridge the network on the PC such that the Beagle can get to the Internet. For this, we need a way to trigger the adding of a route to the usb0 interface as well as adding nameservers, since the route isn't coming from a DHCP request. Additionally, it might also make sense for the Beagle to provide a bridge to wlan0 or eth0 if those are known to provide good Internet connections and thus a gateway and nameserver might need to be provided. Unless the DHCP times out quickly, I don't know how you'd be able to add that to the PC connection. Further, I am not sure how we'd want to register the user's desire to enable or block this behavior. We should broadcast our mDNS on this interface. The static IP address for this interface should be 192.168.7.2/30, but if the PC provides a bridge, we should DHCP our address.

eth0 should act as a DHCP client almost all the time. Occasionally people will want to add static configurations, but I don't think we need to do anything to make this easy. We should broadcast our mDNS on this interface.

ap0 should come up by default using the "BeagleBone-XXXX" SSID and "BeagleBone" password if a compatible adapter is in the system. It should be possible to provide a persistent password change and to disable the AP as long as a wlan0 connection is made within a timeout period. If wlan0 is configured and times out, ap0 should come up unless more "expertly disabled", i.e., we don't need to make it easy to permanently disable ap0. We should provide DHCP, gateways and nameservers over ap0 and we should resolve everything to the bone101 server until wlan0 or eth0 is configured. We should NAT ap0 requests to the wlan0 or eth0 networks as long as our DHCP config provides a good gateway and nameservers on those interfaces. We should give preference to eth0 or whatever interface has a valid Internet connection. We can use https://BeagleBoard.org to validate our connection if desired. To be discovered when on an Internet connected network, we should broadcast our mDNS on this interface. Also, if we are proxying the DNS, we should resolve hostname.local ourselves to our static ap0 IP address. It is also desirable to support NAT to usb0 if the PC is configured as a bridge, but this would be a last resort. The static IP address for this interface should be 192.168.8.1/24.

wlan0 should look for a "BeagleBone-XXXX" SSID by default and use the "BeagleBone" password, but should not connect to itself. This provides an immediate network of BeagleBones, though only the AP would actually be able to provide a route to the Internet on this network. In practice, you'd need to have a period where all non-Internet-connected-AP-capable BeagleBones have their ap0 disabled (i.e., powered off) to make the network of BeagleBones include a route to the Internet. More important than the network-of-Bones is simply providing an easy persistent configuration for getting on a user's existing WiFi network, including WPS. If a configuration is there, it should connect on boot. This should not take down ap0 unless there is an explicit configuration to do so. It could further be considered to bring in a wlan0 configuration from another BeagleBone found on the network, either if the Beagle host is acting as the AP or perhaps discovered via mDNS. The wlan0 interface should act as a DHCP client and we should broadcast our mDNS on this interface.

Don't forget IP over Bluetooth or Bone variants with eth1. An Internet bridge over Bluetooth is especially interesting to make easy. My desire is to simply treat it generically to have an interface with an Internet connection configured outside our "plan" and triggering any desired NAT to the above mentioned interesting interfaces.

Is this helpful? Accurate?
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Anderson

unread,
Feb 17, 2016, 4:39:34 PM2/17/16
to BeagleBoard
Jason, this is excellent!  Having something along the lines of what you call out here out of the box would be great, especially if it was very clear how to "configure" said setup w/o having to resort to "legacy" (e.g. ifup/down/config) tools.

This would also be especially useful with future/planned boards that have builtin WiFi and/or BT.  And as a stretch, maybe even an iOS/Android companion app to help with setup/onboarding.  I understand that the BBB is supposed to be an embedded systems "learning" platform, so maybe having something so consumer friendly is asking a lot.  Even so, there seems to be an inordinate number of issues posted here concerning initial networking setup, so maybe something like this isn't so far off track as many people struggle with this.  Addressing the whole "onboarding" issue is also a huge deal for anyone considering what it takes to make a consumer friendly device.  A reference implementation would be a great learning experience.  There are not a lot (maybe no) open source solutions to this problem.  I do know that the AllJoyn folks have defined an OnBoarding service spec to help address this, but there isn't much as far as implementation here yet.  There may be other efforts (OIC?), but I am unaware of them.

Good thoughts!

ba

William Hermans

unread,
Feb 17, 2016, 4:56:47 PM2/17/16
to beagl...@googlegroups.com
Jason,

Perhaps a Nodejs app linked in the getting started pages. That have "button" to switch on / off desired behavior. g_ether, g_serial, etc.

Another thing I was curious about. Is why does a wireless network device need a network manager running at all ? I don't know . . .I've always used / preferred wired networking.

Additionally, perhaps it is time to stop trying to automate DNS, and just have instructions on how to manually set gateway / IP address on each possible host system type ? This way, you manually set USB0 as 192.168.7.2, and the host gets set to 192.168.7.1 manually by the user at setup time. Or perhaps have a script for the 3 main OSes to set this up automatically ? Linux and OSX should be easy, but Windows . .. no idea how this could be done with powershell . . .

Anyway, just thinking out loud.

Robert Nelson

unread,
Feb 17, 2016, 5:01:10 PM2/17/16
to Beagle Board
On Wed, Feb 17, 2016 at 3:56 PM, William Hermans <yyr...@gmail.com> wrote:
> Jason,
>
> Perhaps a Nodejs app linked in the getting started pages. That have "button"
> to switch on / off desired behavior. g_ether, g_serial, etc.
>
> Another thing I was curious about. Is why does a wireless network device
> need a network manager running at all ? I don't know . . .I've always used /
> preferred wired networking.

I've seen a "device" with only wireless and usb-otg...

William Hermans

unread,
Feb 17, 2016, 5:10:55 PM2/17/16
to beagl...@googlegroups.com
@Robert,

That not the point I was attempting to convey. I've never setup a wireless device in Linux *ever*, so I've no idea if it is as simple as setting up ethernet connections. With ethernet, I *always* manually set IP, gateway, network, and all that in the interfaces file.

Anything stopping one from doing the same with wireless adapters ?

William Hermans

unread,
Feb 17, 2016, 5:53:44 PM2/17/16
to beagl...@googlegroups.com
Hmm, I guess no one knows then. Either that, or I'm dealing with a bunch of "smart people" here . . . heh.

John Syne

unread,
Feb 17, 2016, 6:19:10 PM2/17/16
to beagl...@googlegroups.com
Setting up Wifi is way more complicated that ethernet because of the wireless settings and then there is the security setup like WPA2, etc and that is done before you start with the regular IP settins. Best to search Google “beaglebone wifi setup” which has lots of examples. I know the first time I did this, it took me all day, but that was years ago ;-) I guess I’m not one of those “smart people"

Regards,
John



William Hermans

unread,
Feb 17, 2016, 7:00:37 PM2/17/16
to beagl...@googlegroups.com
I guess I’m not one of those “smart people"

hah !

I think ideally I'd much rather set wifi up manually if it was not too much of a hassle. Time is one thing, but pulling what's left of your hair out for a week is not really my idea of fun.

As for googling, I would probably not use beaglebone for a keyword at all, and just start googling "linux manual wifi setup" or some such keywords. But if it's like bluetooth, which is also somewhat complicated. It can be done.

William Hermans

unread,
Feb 17, 2016, 7:04:43 PM2/17/16
to beagl...@googlegroups.com
The biggest problem I have with using network managers is that "they" tend to get into the way too much. I really do not like a bit of software( be is scripts, or whatever ) thinking it is smarter than I. So when I "put my foot down" and do something manually, I mean it, and want it in place. But that's not how these network managers seem to work . . .

maxmike

unread,
Jul 2, 2017, 12:33:07 AM7/2/17
to BeagleBoard
Thereis also the issue I have, where I allow unsophisticated users to dynamically change the static IP address.
With ifconfig I can give them a script, but connmanctl doesn't make that as simple.
Reply all
Reply to author
Forward
0 new messages