NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] myRIO-1950 - Wifi dongle driver compilation

Dear Aryk, I appreciate your kindness and quick response. I could do ping to the device and run VIs on it. But the remained issue is that we cannot setup or upgrade the system through wifi.   Can I ask you one question? When you tried to connect the device with wifi dongle, did you edit ni-rt.ini??

0 Kudos
Message 31 of 40
(2,958 Views)

I've done some quicks tests:

1. I can see myRIO in MAX and connect to it.

2. I cannot modify software because the device is not in configuration mode (see images attached)

myrio-monitor.PNGmyrio-max.PNG

My guess is that when you plug the USB cable it enables you to choose what software you want, so it has to be configuration state somewhere.


The quick workaround would be to reboot the device in safe-mode (if you can connect through wifi in safe mode I don't know that, might be possible since the drivers are part of the kernel)

The long route would be to track down how the USB connection (usb0) in linux is configured and try to replicate that when you start the wifi. (aka enable configuration mode in linux via a command or something)

If you want to run for the second you might need to ask the question to a NI Support that knows Linux RT well and know how that usb0 connection is configured.

0 Kudos
Message 32 of 40
(2,958 Views)

Hi Aryk, thanks to your kind advice, our unclear points were resolved. We will investigate more detail for this application.  Thank you so much!!!!

0 Kudos
Message 33 of 40
(2,958 Views)

Dear myRIO community

I'm also trying to compile the wifi dongle driver to enable wireless access to my myRIO.

The dongle is the following: http://www.hardkernel.com/main/products/prdt_info.php?g_code=G137447734369

But according to the update of Aryk from the 18/09/15 this is only possible with the old Kernel 3.2.x

Unfortunately I use the new kernel and think thats why I can not compile. Get some errors from .c files.

My version:

Linux Nanins-Sushi 3.14.40-rt37-ni-3.0.0f2 #1 SMP PREEMPT RT Thu Jun 11 17:43:52 CDT 2015 armv7l GNU/Linux

Did anybody find another solution to install a driver with the new kernel?

Thanks for your update and help!

Cheers, Jonas

0 Kudos
Message 34 of 40
(2,958 Views)

Hi Jonas,

The new kernel update 3.4.x (LabVIEW 2015) has made the official drivers deprecated. Hopefully internet is a vaste place and there is always someone to do a fix:

1. Install git

opkg install git

2. Download the corrected drivers

git clone https://github.com/pvaret/rtl8192cu-fixes.git

3. Modify the header file has you would do previsouly and compile the drivers from your git folder

Enjoy working drivers

Note: This is only working for rtl8192cu drivers that replace native rtlwifi drivers on the board

0 Kudos
Message 35 of 40
(2,958 Views)

The 2015 kernel that you're using should have support for the 8188CUS built-in, it may, however, be missing the firmware binary blob needed to load into the wireless device. Can you check the following:

  1. Check the the needed driver (rtl8192cu) is configured for your kernel
    • Running zcat /proc/config.gz | grep RTL8192CU should return CONFIG_RTL8192CU=m

  2. Plug in the USB device and check the kernel logs to see what it says (post the output of running dmesg | tail -n 40 after plugging in the wireless device)

    • For example, using a random USB wifi adapter that I had handy, I see the exact sort of issue that I expect you'll run into

    • [499701.398052] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin' (this fails as I don't have that firmware blob on the filesystem)


  3. Just for completeness, post the results of running lsusb (you'll need to install this with opkg update && opkg install usbutils)

So, I'd recommend we do a bit of detective work first before we slog through getting wireless working on your myRIO.

0 Kudos
Message 36 of 40
(2,958 Views)

Hi guys,

Thank you very much for the quick reply!

Here the result from my investigation:

  1. as it should be: CONFIG_RTL8192CU=m
  2. from dmesg:

[ 3751.763555] usb 1-1: new high-speed USB device number 6 using zynq-ehci

[ 3751.916729] rtl8192cu: Chip version 0x10

[ 3752.013593] rtl8192cu: MAC address: 7c:dd:90:ba:71:91

[ 3752.013616] rtl8192cu: Board Type 0

[ 3752.013956] rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1

[ 3752.014068] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin

[ 3752.014183] usb 1-1: Direct firmware load failed with error -2

[ 3752.014198] usb 1-1: Falling back to user helper

[ 3752.019008] usb 1-1: Direct firmware load failed with error -2

[ 3752.019027] usb 1-1: Falling back to user helper

[ 3752.022524] rtlwifi: Loading alternative firmware rtlwifi/rtl8192cufw.bin

[ 3752.022544] rtlwifi: Firmware rtlwifi/rtl8192cufw_TMSC.bin not available

     3. from lsusb:

Bus 001 Device 006: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

Would appreciate if you could give me any further hints for how to solve this problem  "easily" and load the correct firmware/driver.

Thanks, Jonas

0 Kudos
Message 37 of 40
(2,958 Views)

The firmware (and corresponding licenses) for these kinds of devices can often be found in the Linux firmware git repository, located here:

https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/

Specifically, I think the firmware you need is this one:

https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain/rtlwifi/rtl8192cufw_T...

That should go into the appropriate firmware directory on your myRIO, which I believe is at:

/lib/firmware/rtlwifi/rtl8192cufw_TMSC.bin

Can you give that a try?

0 Kudos
Message 38 of 40
(2,958 Views)

Awesome, I think its working or close to it.

Just have to find a wlan router 😉

Had to create the folders and then copied the file there.

Afterwards the dmesg outputs the following:

[12655.083959] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin

[12655.084723] ieee80211 phy3: Selected rate control algorithm 'rtl_rc'

[12655.086497] rtlwifi: wireless switch is on

[12655.351207] cfg80211: Calling CRDA for country: US

[12655.363177] cfg80211: Regulatory domain changed to country: US

[12655.363195] cfg80211:  DFS Master region: unset

[12655.363203] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)

[12655.363216] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)

[12655.363228] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)

[12655.363245] cfg80211:   (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)

[12655.363258] cfg80211:   (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)

[12655.363269] cfg80211:   (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)

[12655.363280] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)

[12655.363291] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm)

Afterwards I unblocked wifi:

rfkill unblock wifi

and then I started wlan0 with

ifconfig wlan0 up

No I'm trying to connect to a network with wpa-supplicant. But have to leave and will test it tomorrow.

Thanks for the help so far!

Can I install wicd on the myRIO?

Thanks, Jonas

0 Kudos
Message 39 of 40
(2,958 Views)

It seems that wicd is not in the NI repo feeds, so you'll either need to build the software or just use wpa_supplicant + (ip or udhcpc or dhclient) directly. Or, you know, the interface should show up in MAX if you wanted to use that...

wifi-9068.jpg

wifi-9068.jpg

(quick note: more likely than not, the "Create a Wireless Network" option won't work with your hardware)

0 Kudos
Message 40 of 40
(2,958 Views)