Alexander Sayapin Teacher's site

Network setup for the robotic platforms

Posted on Fri 28 June 2019

In Общие вопросы.

tags: setup programming robotics


Often the development boards for robotic platform (I mean Raspberry Pi, Aaeon Up Board, Arietta, BeagleBone and so on) do not hold a wireless interface.

The users of the boards have to use different wireless/WiFi usb modules, like RT5370 Wireless Adapters. Sometimes, even if the module is recognized by the system correctly, the corresponding network interface is not active. Let's fix it!

We are supposing we use Ubuntu 16.04 LTS (there would be no difference for 18.04 too), and noname Chinese wifi module with RT5370 chipset.

First of all, you have to get your board up, and get an access to it. Then check if the module is visible by the system:

lsusb

You are supposed to see something like this:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 0424:2530 Standard Microsystems Corp.
Bus 001 Device 005: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 004: ID 0424:4603 Standard Microsystems Corp.
Bus 001 Device 003: ID 046d:0825 Logitech, Inc. Webcam C270
Bus 001 Device 002: ID 03e7:2150
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Our module is Ralink Technology, Corp. RT5370 Wireless Adapter. Ok, the system "sees" it.

Let's check if the corresponding network interface is up:

ifconfig

In my case the output is

enp1s0    Link encap:Ethernet  HWaddr 00:07:32:3f:c7:21
          inet addr:192.168.0.103  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::207:32ff:fe3f:c721/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5560 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3212 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7719135 (7.7 MB)  TX bytes:288886 (288.8 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:353 errors:0 dropped:0 overruns:0 frame:0
          TX packets:353 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:71577 (71.5 KB)  TX bytes:71577 (71.5 KB)

Oops! No wireless interface. Let's check if it is present at all:

 ifconfig -a

The output is

enp1s0    Link encap:Ethernet  HWaddr 00:07:32:3f:c7:21
          inet addr:192.168.0.103  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::207:32ff:fe3f:c721/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5654 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3255 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7739577 (7.7 MB)  TX bytes:295428 (295.4 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:402 errors:0 dropped:0 overruns:0 frame:0
          TX packets:402 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:89121 (89.1 KB)  TX bytes:89121 (89.1 KB)

wlx008732748025 Link encap:Ethernet  HWaddr 00:87:32:74:80:25
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Hooray! The wifi interface (wlx008732748025) is here, but not active at the moment.

We suppose the name f the interface here is wlx008732748025, but for your board the name definitely would be different. Please note wlx008732748025 has to be replaced with the name of your interface.

Let's get it up:

ifup wlx008732748025

Oops again! No such network interface? How's that?

The ip command will help us:

sudo ip link set wlx008732748025 up

Now it is active.

It's time to check for the available wireless networks around here:

sudo iw dev wlx008732748025 scan

A lot of information, if you are to see only networks' SSIDs, just add some grep:

sudo iw dev wlx008732748025 scan | grep SSID

Now you have just SSIDs of the networks.

Well, we are almost there. Now we have to connect to our network. It takes a few additional steps.

First, you have to install wpasupplicant:

sudo apt-get install wpasupplicant

Then we should generate the hash of our psk passphrase:

wpa_passphrase Home as71djddhwyf

Here we suppose that our network's SSID is Home and the passphrase is as71djddhwyf (which is not my passphrase, of course ;) )The output would look like this:

network={
    ssid="Home"
    #psk="as71djddhwyf"
    psk=86219a4c225a32beafe899a2b80f887b9f6140a40a50eb9850b9593f7898a890
    }

Now add the following lines to the /etc/network/interfaces:

auto wlx008732748025
iface wlx008732748025 inet dhcp
wpa-ssid Home
wpa-psk 86219a4c225a32beafe899a2b80f887b9f6140a40a50eb9850b9593f7898a890

Now save the file and restart the interface:

sudo ifdown wlx008732748025 && sudo ifup -v wlx008732748025

Now check the interfaces again:

​ ifconfig

The output now have to show you connected status with IP address for your wlx008732748025 interface.

Useful sources

15 Useful “ifconfig” Commands to Configure Network Interface in Linux

ifconfig vs ip

Linux IPv6 HOWTO (en) Chapter 5. Configuring interfaces

How can I display the list of available WiFi networks?

Loading Debian (Ubilinux) on the Edison

buntu server 16.04 no wireless internet connection

tags

алфавит (1) архитектура ЭВМ (3) asp.net (1) бгд (22) бисв (23) бкб (22) бме (22) бпэ (23) бпэз (4) бпэзу (1) бпм (19) бпм объявления (7) certbot (1) cheatsheet (1) checkinstall (1) csv (1) дискретная математика (25) экзамен (1) embedded rust (2) english (1) формальные грамматики (1) gdb (2) язык (1) исследование операций (1) jupyter (1) критерии (2) курсовая работа (2) lighttpd (2) low-latency (1) machine learning (3) make (1) make install (1) markdown (1) машинное обучение (1) математическая лингвистика (1) математическая логика (1) математическая статистика (1) Математические основы кмпьютерной графики (1) Математические основы компьютерного моделирования (1) Математические основы компьютерной графики (1) Методы оптимизации (17) методы оптмимизации (1) методы принятия решений (1) миа (6) мии (8) мик (7) мим (7) мио (4) мип (9) мит (44) миу (13) миз (12) ml (1) mono (1) мпм (6) natural language processing (1) nlp (1) nucleo (2) объявления (31) оформление (2) openocd (2) openpgp (1) pandas (1) pgp (1) подтверждение вывода (1) programming (3) python (3) robot (1) robotics (2) setup (6) шпаргалка (1) smartcard (1) ssh (1) ssl (1) STM32 (2) streaming (1) строка (1) тб (21) teaching (1) teaching statement (1) Теоретические основы цифровой обработки изображений (2) тест (1) учебник (1) up board (1) video (1) вкр (2) xls (1)