# Just Installed, No WiFi



## limo (Oct 4, 2021)

Hi,
I hope this is the right forum.
I just installed and from the screen with “cable” connected to router I could:
`ping www.yahoo.com`
`ping www.google.com`

Both returned to me data (64 bytes from 216.58…. icmp_seq=11 tt1=109 time=60.234 ms)
Unplugged the cable and got “no route to host”
So I assume it is working.

How can I get WiFi to work?

P.S. I am just a few minutes on BSD.
Thank you.


----------



## SirDice (Oct 4, 2021)

limo said:


> How can I get WiFi to work?


Handbook: 32.3. Wireless Networking



limo said:


> I am just a few minutes on BSD.


Good, please start reading the handbook, a lot of your questions are going to answered in there. 

FreeBSD Handbook


----------



## limo (Oct 4, 2021)

SirDice said:


> Handbook: 32.3. Wireless Networking
> 
> 
> Good, please start reading the handbook, a lot of your questions are going to answered in there.
> ...


Wow, glad to have my saviour agin with me. Thank you very much for your kind support.


----------



## Argentum (Oct 4, 2021)

limo said:


> How can I get WiFi to work?


Short answer is - use security/wpa_supplicant (manual: wpa_supplicant(8)). However I strongly agree with SirDice that it is good time to read the manual.


----------



## SirDice (Oct 4, 2021)

Argentum said:


> Short answer is - use security/wpa_supplicant (manual: wpa_supplicant(8)).


Note that security/wpa_supplicant and wpa_supplicant(8) are different implementations. The latter is already part of the base OS, you don't need to install a port/package for it.


----------



## SirDice (Oct 4, 2021)

limo said:


> Thank you very much for your kind support.


I have no intention of regurgitating what's already explained in the handbook. So I suggest you read it, and if you are having problems then ask specific questions about the things you're having problems with.


----------



## astyle (Oct 4, 2021)

limo said:


> Hi,
> I hope this is the right forum.
> I just installed and from the screen with “cable” connected to router I could:
> `ping www.yahoo.com`
> ...


The basic logic to apply here is to look at output of `dmesg` and see what hardware your kernel can detect on boot. Some newer wi-fi cards don't play well with FreeBSD, but with some upfront effort to figure out what the kernel can detect, and how it shows up - not impossible to make wi-fi work. At least you do have ethernet as plan b.


----------



## T-Daemon (Oct 4, 2021)

According to the hardware specification of your system the wireless is a Broadcom BCM4313:

```
Network: Device-1: Broadcom BCM4313 802.11bgn Wireless Network Adapter driver: wl
```

You need to install from ports net/bwn-firmware-kmod. There is no package available due to a modified version of a restricted firmware. How to install from ports: 4.5. Using the Ports Collection


----------



## scottro (Oct 4, 2021)

I have  a page that might be of use, once you get the driver. https://srobb.net/fbsdquickwireless.html


----------



## limo (Oct 4, 2021)

T-Daemon said:


> According to the hardware specification of your system the wireless is a Broadcom BCM4313:
> 
> ```
> Network: Device-1: Broadcom BCM4313 802.11bgn Wireless Network Adapter driver: wl
> ...



Well, I did
32.3.2. Quick Start​“almost” everything. Still no luck.

So, I need to connect through a cable and issue some commands to install.
Sounds a bit…. mmm… I feel a bit lost. Vastly different from Linux. But I’m still so interested.
So, I should do the commands shown in “*Procedure: Portsnap Method”* to install ports and be ready to install net/bwn-firmware-kmod

I will try to do it.
I’ll appreciate helping me with a few specific commands.


----------



## astyle (Oct 4, 2021)

limo said:


> Well, I did
> 32.3.2. Quick Start​“almost” everything. Still no luck.
> 
> So, I need to connect through a cable and issue some commands to install.
> ...


First, plug your ethernet cable back in, and don't unplug it until you get wi-fi to work.


----------



## astyle (Oct 4, 2021)

limo : The Portsnap method is for *updating* the ports tree already on disk (or *creating* a brand-new ports tree).  After that, you still have to `cd /usr/ports/net/bwn-firmware-kmod/`, and then do `make && make install` in that directory.


----------



## limo (Oct 4, 2021)

astyle said:


> cd /usr/ports/net/bwn-firmware-kmod


No such file or directory.
During last install I didn’t select ports… I just went with defaults (only selected UFS not ZFS)


----------



## SirDice (Oct 4, 2021)

limo said:


> During last install I didn’t select ports…


That's fine. That ports tree is too old now anyway. The easiest way to get an up to date ports tree is to run `portsnap fetch extract`. To keep that ports tree updated regularly run `portsnap fetch update`. 

The portsnap(8) tool is scheduled to be removed some day, but it'll do for now.


----------



## mrbeastie0x19 (Oct 5, 2021)

SirDice said:


> That's fine. That ports tree is too old now anyway. The easiest way to get an up to date ports tree is to run `portsnap fetch extract`. To keep that ports tree updated regularly run `portsnap fetch update`.
> 
> The portsnap(8) tool is scheduled to be removed some day, but it'll do for now.


What is the planned alternative for fetching the ports after this goes? Or is it just a case that all systems would need to install this package?


----------



## astyle (Oct 5, 2021)

mrbeastie0x19 said:


> What is the planned alternative for fetching the ports after this goes? Or is it just a case that all systems would need to install this package?


There was some noise about a utility called gitup(), but I like portsnap(8) functionality. Looking at the manpages, it looks very possible to replicate Portsnap's functionality (if you're paying attention). From gitup.conf(5): 


> ```
> Executing:
> 
> gitup ports
> ...


Then replicating Portsnap's `extract` subcommand would involve paying attention to the options given to cp(1), and relative filepaths. EVERY TIME. Not impossible, but makes me grateful that Portsnap exists.


----------



## grahamperrin@ (Oct 5, 2021)

limo you might take this opportunity to begin using _latest_ (instead of _quarterly_) for packages.

Essentially: create /usr/local/etc/pkg/repos/FreeBSD.conf as described at <https://docs.freebsd.org/en/books/handbook/ports/#quarterly-latest-branch>.

Recommendation: 

create, activate then boot a boot environment
create the file
logout from KDE
Control-Alt-F2 (takes you away from ttyv8, to ttyv1)
login as root
`pkg upgrade -y`
`exit`
Control-Alt-Delete
For step (1) above, with today's date as an example:

as the root user
`bectl create 2021-10-05-a`
`bectl activate 2021-10-05-a`
restart


----------



## grahamperrin@ (Oct 5, 2021)

limo said:


> … lost … I’ll appreciate helping me with a few specific commands.



As the root user
use gitup or portsnap to get what's known as the ports _tree_
`cd /usr/ports/net/bwn-firmware-kmod/ && make install clean`
`kldload bwn`
FreshPorts is our friend. There's a wealth of information on the page for each port; much to take in, for a newcomer. 

Step (3) is copied from <https://www.freshports.org/net/bwn-firmware-kmod#add>


----------



## grahamperrin@ (Oct 5, 2021)

mrbeastie0x19 said:


> alternative











						portsnap being retired - what's the alternative?
					

Hi,  portsnap being retired:  https://marc.info/?l=freebsd-ports&m=159656662608767&w=2  I use "portsnap fetch extract" on a new install, and "portsnap fetch update" to get updates - does anyone know what the alternatives are to those?  I'll go digging and might answer my own question soon.  Thanks.




					forums.freebsd.org
				












						Solved - Portsnap alternative
					

After reading that portsnap is depreciated, I would like to use net/svnup for ease of use.  For the last 3 days, portsnap fetch update always returns "Ports tree is already up to date". So I'm assuming it no longer can be used?  My questions are :  Do I need to rm -rf /usr/ports before using...




					forums.freebsd.org
				












						Solved - What's the new alternative to portsnap
					

I just did a search on this topic and found 76463/, but didn't feel like combing through 120 msgs...  AFAIUI git the big new thing, so how do I go about populating /usr/ports/  https://www.freebsd.org/ports/installing/ only mentions portsnap and svn so I'm not sure if git is the way to go.




					forums.freebsd.org


----------



## limo (Oct 5, 2021)

SirDice said:


> portsnap fetch extract


I did this and 




grahamperrin said:


> cd /usr/ports/net/bwn-firmware-kmod/ && make install clean


with cable connected 
ping www.yahoo.com worked
Disconnected cable, didnt work, rebooted, didn’t work 
Then



grahamperrin said:


> bectl create 2021-10-05-a


ZFS filesystem version: 5 ..
libbe_init(“”) failed


grahamperrin said:


> bectl activate 2021-10-05-a


Failed
I’m missing something?


----------



## limo (Oct 5, 2021)

Well, it’s good I could install nano
`pkg install nano`
Though trivial at least I did something on my system other than asking questions on the 
forum.
And just installed lynx


----------



## limo (Oct 5, 2021)

I repeated
Noticed an error
stopped in usr/ports/net/bwn-firmware-kmod-0.1.2/bg/v4
*** Error code 1


----------



## T-Daemon (Oct 5, 2021)

Please execute

```
# pkg info -E bwn-firmware-kmod
# kldload if_bwn
# dmesg | grep bwn0
```


----------



## limo (Oct 5, 2021)

UPDATE

Currently installing KDE Plasma (using cable). I found this.
I think I read on the screen something like detecting my hardware and cards and installing automagically required drivers (I hope it’s true).

Just noticed it’s taking ages, (maybe downloading and compiling on my machine)


----------



## astyle (Oct 5, 2021)

limo said:


> Just noticed it’s taking ages, (maybe downloading and compiling on my machine)


This one, it depends on how fast your Internet connection is, and how powerful your machine is.


----------



## scottro (Oct 5, 2021)

I would guess that KDE plasma is one of those LARGE packages (and several dependencies, that even on a powerful machine,will take a long time to compile. Some of the desktops, browsers, etc., will take several hours to compile, even on a fast machine with nvme drives. As astyle says, it is dependent upon how powerful your machine is. In many cases it's better to choose the package, but of course, there are often reasons for choosing the port.


----------



## Vull (Oct 5, 2021)

limo said:


> ZFS filesystem version: 5 ..
> libbe_init(“”) failed
> 
> Failed
> I’m missing something?


You should skip the `bectl` commands. They only work for ZFS boot environments and you have UFS.



limo said:


> Just noticed it’s taking ages, (maybe downloading and compiling on my machine)


Installing packages is much faster than compiling ports. You only really need ports for your wireless driver, and could substitute packages for everything else. Case in point: you have already used packages to install the nano program. It's your choice.

Following up on T-Daemon's post, we still need to find out if your wireless driver ever finished compiling successfully. What output do you get from `pkg info -E bwn-firmware-kmod` ?


----------



## astyle (Oct 5, 2021)

scottro said:


> I would guess that KDE plasma is one of those LARGE packages (and several dependencies, that even on a powerful machine,will take a long time to compile. Some of the desktops, browsers, etc., will take several hours to compile, even on a fast machine with nvme drives. As astyle says, it is dependent upon how powerful your machine is. In many cases it's better to choose the package, but of course, there are often reasons for choosing the port.


www/kf5-khtml and www/qt5-webkit are the worst offenders in terms of compile time. The source tarballs are not that big (~20-30 MB), but on my rig (with a Ryzen 5 1400 3.4 GHz), *each* takes an hour and a half to compile (AFTER their dependencies are satisfied). Well, I do compile my ports with as many options enabled (beyond defaults) as possible, that's my use case. Having a decently fast connection helps (I top out at 430 KB/sec for downloading).


----------



## grahamperrin@ (Oct 5, 2021)

limo said:


> I’m missing something?



Installation to ZFS, which is the default when installing the operating system. 

I'm curious, was installation to UFS a conscious choice?

For what it's worth, I should recommend starting afresh. Install to ZFS; it's almost guaranteed to save you future pain.


----------



## limo (Oct 5, 2021)

grahamperrin said:


> Installation to ZFS, which is the default when installing the operating system.


Well… I was just worried ZFS is too advanced for me.
Well,  I will start again from scratch and strictly follow defaults.


----------



## SirDice (Oct 5, 2021)

grahamperrin said:


> Installation to ZFS, which is the default when installing the operating system.


It's not. FreeBSD lets you choose, UFS or ZFS, neither are considered the default. It's perfectly fine to pick UFS. 



grahamperrin said:


> Install to ZFS; it's almost guaranteed to save you future pain.


Not necessarily. It can also make your life more complicated. If you don't know how to deal with a problem ZFS isn't going to help with that. Careful planning and understanding what you're doing is. Yes, snapshots are useful, boot environments too. But neither are going to help you understand the issues any better.


----------



## grahamperrin@ (Oct 5, 2021)

SirDice said:


> It's not. FreeBSD lets you choose, UFS or ZFS, neither are considered the default.



I mean, ZFS is pre-selected. (I have never seen UFS pre-selected with any recent installer.)

In the absence of boot environments, it can be much more difficult to recover from shooting oneself in the foot. Painful recoveries detract from, diminish, opportunities to learn.


----------



## astyle (Oct 5, 2021)

I'd actually recommend ZFS, the rollback and bectl are well-documented, they do make it easy to recover from mistakes if you bother to learn them. With UFS, the same functionality and pathways to undoing mistakes - good luck finguring THAT out.


----------



## scottro (Oct 5, 2021)

I'm going to add there's not much to learn with bectl (or beadm).  I forget who already gave you the commands, but if it's not on page one, Mike Lucas gives a good summary (using beadm) at https://mwl.io/archives/2363

A few people, including me, (but only once) had trouble deleting a snapshot with bectl and had to use beadm, but I'd say most of the time, for the simple use of backing up before an update, there's no substantial difference, save that bectl is part of the base system and beadm a package.


----------



## grahamperrin@ (Oct 6, 2021)

scottro said:


> … if it's not on page one, …



<https://forums.FreeBSD.org/threads/82319/post-535005> offered an example.

Two commands, then restart the OS.

I habitually do this before _any_ upgrade.

*A terse name that begins with (or includes) the date* will help to decide which named boot environment to choose, if it becomes necessary to boot something other than the most recent environment.

Not pictured in the FreeBSD Handbook:

Boot Environments




– option *8* in the loader menu for FreeBSD 13.⋯.

Using a loader menu to activate a boot environment

A screenshot of the loader menu in OmniOS CE (2017):






Compared to OmniOS and some other BSD-based operating systems, FreeBSD does not yet have the luxury of a shortlist of boot environments.

Instead, it's necessary to key *2* –





– sometimes repeatedly, until the required environment is listed as active.

There can be a sense of disorder in response to the key presses, so pay close attention to each name that appears on the line.


----------



## astyle (Oct 6, 2021)

scottro said:


> I'm going to add there's not much to learn with bectl (or beadm).  I forget who already gave you the commands, but if it's not on page one, Mike Lucas gives a good summary (using beadm) at https://mwl.io/archives/2363
> 
> A few people, including me, (but only once) had trouble deleting a snapshot with bectl and had to use beadm, but I'd say most of the time, for the simple use of backing up before an update, there's no substantial difference, save that bectl is part of the base system and beadm a package.


Y'know, even if bectl is simple and does just a few things (but well), it still can take time to just soak in how powerful it is. Most people will say that a cable has two ends, but have a surprisingly hard time putting that into practice.


----------

