Tuesday, March 5, 2013

use wifi on raspberrypi

The raspberrypi has two usb ports, so I bought a usb wifi dongle to get rid of network cable.
This dongle uses RTL8188CUS chipset, which has built-in support on the raspberrypi linux kernel. So it just worked after I plugged it to raspberrypi.
The next step is to configure the dongle so that it can connect to my wifi router. There is GUI based connection manager if you're using raspbian system image. But in my case, I use a small system image built with built from builtroot with only command line interface, I have to setup manually.
I enabled wireless tools in buildroot config, which provides tools such as iwlist, iwconfig. My wifi router, which is configured with dhcp server enabled, doesn't required password to connect. So I can setup the network with commands below:
ifconfig wlan0 up
iwconfig wlan0 essid WIFI_ESSID
udhcpc -i wlan0
Having tested the network run ok, I updated the /etc/network/interfaces file so that network would be setup automatically.
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
    pre-up ifconfig $IFACE up
    pre-up iwconfig $IFACE essid WIFI_ESSID
    down ifconfig $IFACE down
I struggled a lot with the interfaces file due to the dhcp always failed to work. And I finally found that the connman package caused the conflict. Disable it solved the problem.

1 comment:

Unknown said...

If you're trying to lose pounds then you absolutely have to start following this totally brand new custom keto diet.

To create this service, licenced nutritionists, fitness couches, and top chefs united to produce keto meal plans that are useful, convenient, cost-efficient, and delightful.

From their launch in January 2019, hundreds of people have already completely transformed their body and well-being with the benefits a great keto diet can give.

Speaking of benefits: clicking this link, you'll discover eight scientifically-certified ones given by the keto diet.