NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] myRIO-1950 - Wifi dongle driver compilation

Hi Aryk, thank you for your answer!!

I could compile the driver and replace it with new module.

But i want to know what's the best way to configure the device to connect network.

Do you have any incofmation which tells us the way?

Thank you!!

0 Kudos
Message 21 of 40
(3,239 Views)

Hi,

For that, you need to use wpa_supplicant:

Follow this procedure and that should work.

1. vi /etc/natinst/share/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=ni

update_config=1

fast_reauth=0

network={

ssid="router ssid"

psk="passphrase"

priority=2

}

network={

ssid="ad-hoc wlan"

psk="passphrase"

priority=1

}

2. wpa_supplicant -B -iwlan0 -c /etc/natinst/share/wpa_supplicant.conf -Dwext && dhclient wlan0

3. ping google.com

This create a wpa_supplicant, and will connect in priority to an ad-hoc wlan, if not is found will then connect to a router if it is available. You have to lauch the 2. at startup every time for the dongle to work. The best is to create a boot-script for that, you have a tutorial available on the community documents.

Does that help?

0 Kudos
Message 22 of 40
(3,239 Views)

thx!! I could make the device connect to network!!

0 Kudos
Message 23 of 40
(3,239 Views)

I could use USB wifi dongle on myRIO-1900 but not on myRIO-1950...

According to lsmod, some module were not registered to blacklist.

 

============================================

admin@NI-myRIO-1950-030526be:~# lsmod

Module Size Used by

ipv6 271851 12

rtlwifi 71295 0

rtl8192c_common 54706 0

firmware_class 6337 0

mac80211 198512 2 rtl8192c_common,rtlwifi

cfg80211 181015 2 mac80211,rtlwifi

8192cu 598411 0

niriozynqk 190001 0

ehci_hcd 39556 0

NiRioSrvCompactRIO 585674 0

nibds 47467 2 NiRioSrvCompactRIO,niriozynqk

nikal 67570 3 nibds,NiRioSrvCompactRIO,niriozynqk

xilinx_xadcps 8395 0

hwmon 1191 1 xilinx_xadcps

============================================

There are "rtlwifi" and "rtl8192c_common" but they should be removed from module.

Ofcourse, I have edited /etc/modprobe.d/blacklist.conf and registered rtlwifi/rtl8192c_common/rtl8192cu.

 

But it seems that the configuration isn't recognized by myRIO-1950.

Anyone has same trouble and could solve this?

And I want to check your lsmod and myRIO process (by ps commend) log.

   

Thank you!

0 Kudos
Message 24 of 40
(3,239 Views)

Hi all, we could make myRIO recognize USB wifi dongle by removing rtlwifi folder placed at

/lib/modules/3.2..../kernel/drivers/net/wireless/.

But i think it isn't correct(?) way.

Looking for some web page, we should type "update-initramfs -u" command on Ubuntu

to update blacklist configuration.

But myRIO doesn't have such command.

Does anyone know what command can be used on myRIO to do that.

And by typing wpa_supplicant command, it could connect to access point.

But i believe that it should connect automatically by DHCP.

Do you have any idea what does prevent the function?

Best,

0 Kudos
Message 25 of 40
(3,239 Views)

Hi,

You should be able to block rtlwifi from launching using by creating a blacklist.conf

vi /etc/modprobe.d/blacklist.conf

Add the entry: blacklist rltwifi

You seems to have already done it, but that's how I did it and it worked on the 1950.

You can also try to uninstall the module using

modprobe -r module.ko

and then install your freshly compiled module

modprobe module_fresh.ko

Sometimes giving a small ifconfig wlan0 up can also help you out

Is that helping?

0 Kudos
Message 26 of 40
(3,239 Views)

Thank you for your info!!

I have created the file but it seems that the file doesn't work correctly.

"lsmod" command shows "rtlwifi" module....

 

And should type wpa_supplicant command to connect the device to AP.

Is the command needed or is there any way to connect automatically?

0 Kudos
Message 27 of 40
(3,239 Views)

I've taken a closer look at your log and everything seems fine.

Every single time you boot need to type the wpa_supplicant command:

wpa_supplicant -B -iwlan0 -c /etc/natinst/share/wpa_supplicant.conf -Dwext && dhclient wlan0

You can do a script that boots at startup to do that:

https://decibel.ni.com/content/docs/DOC-38960

Here an example of the script I've made to check if the connectivity is correct and synchronize the time to network using ntp&ntpdate protocols

#!/bin/bash

LOGNAME=network_init.log

LOGPATH=/home/admin/$LOGNAME

rm $LOGPATH

WLAN=ifconfig|grep wlan0

if [ -n $WLAN ]; then

    # Stop synchronization

    /etc/init.d/ntpd stop >> $LOGPATH

    echo "[-----------Initiating Network----------]" >> $LOGPATH

    #Set up Internet for the Wifi Dongle

    wpa_supplicant -B -iwlan0 -c /etc/natinst/share/wpa_supplicant.conf >> $LOGPATH

    dhclient wlan0 >> $LOGPATH

    echo "[-----------Connected to Network----------]" >> $LOGPATH

    ping -c3 google.com >> $LOGPATH

    # Launch Synchronization

    echo "[-----------Time Synchronization----------]" >> $LOGPATH

    ntpdate uk.pool.ntp.org >> $LOGPATH

    /etc/init.d/ntpd start >> $LOGPATH

else

echo "[-----------WIFI MODULE NOT PRESENT----------]" >> $LOGPATH

fi

0 Kudos
Message 28 of 40
(3,239 Views)

Thank you so much for your information!!  I have a question related with this issue. But it's not difficult. When you could make compile and connect myRIO-1950 through wifi dongle,  could you see installed software on myRIO on MAX under remote systems tree?  We can connect the device and run some VIs but cannot see these detail on MAX... It means that we cannot upgrade the software through wifi and it will be trouble in the future.  Best,

0 Kudos
Message 29 of 40
(3,239 Views)

NI Max will only care about NI product installed, serial ports, and USB to serial ports.

When you plug your USB cable, you don't see a USB connection under max, but you will see it using ifconfig

The wifi dongle drivers are added to the kernel, it is a part of linux and has nothing to do with NI or MAX.

When you got the connection right and the dongle working, you should be able to access the target through its IP address or its DNS name. It is exactly like having the USB cable plugged-in exept its through wifi. And you can of course, have the wifi dongle working & the USB cable at the same time.

MAX should be able to see that the device is online through wifi (USB cable unplugged), if it is not the case that means your target is not connected to the network or that your wifi dongle doesn't work properlly. If you can connect to the target and run VIs then you should be able to upgrade software, format and do all those stuff in MAX.

0 Kudos
Message 30 of 40
(3,239 Views)