Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ralink USB wireless adapters config #45

Closed
centaux opened this issue Aug 12, 2013 · 23 comments
Closed

Ralink USB wireless adapters config #45

centaux opened this issue Aug 12, 2013 · 23 comments

Comments

@centaux
Copy link

centaux commented Aug 12, 2013

Love cubian on my new cubieboard2. I set up cubian today on the CB2 and loved it. Used cubian to setup apache, php, mysql and a lot of tools and utilities to use it as an educational server, in one hour.
I'd like to use cubieboards with cubian to replace lots of Raspberry Pis in schools.
The only thing that is preventing me is I couldn't get any of my USB wireless adapters using Ralink chipsets ( RT3070 or RT5370), which work great on Wheezy on the Raspberry Pi (and I can run them in AP mode with hostapd on the Pi)

I installed firmware-ralink but to no avail.
What needs to be done on Cubian to get these USB wireless adapters recognized? Any special driver needed?

2 Sample adapters I tried:
ID 0411:015d BUFFALO INC. (formerly MelCo., Inc.) WLI-UC-GN Wireless LAN Adapter [Ralink RT3070]
ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

@cubieplayer
Copy link
Owner

The wireless driver installed by default is only a few which is widely used. Because the driver is large and not necessary for everyone.
For RT5370, I had compiled a driver for A10 device, I'm not sure if it works at A20. You can download it from
http://cubieplayer.github.io/static_files/temp/rt5370sta.ko

@cubieplayer
Copy link
Owner

I will improve cubian-update to support more wireless card

@centaux
Copy link
Author

centaux commented Aug 12, 2013

Thanks cubieplayer for the quick follow up. I will try the new module to see if it works on the cubie 2.
I read that the rt2800usb module is listed as enabling support for these Ralink chipsets on Debian: https://wiki.debian.org/rt2800usb
The advantage of these Ralink chipsets is that are not expensive and can be used in AP mode, so you can easily turn your cubieboard into an wifi access point if needed.
Yes, it will be awesome to get the extra drivers via cubian-update. I think cubian-update is one feature that will make cubian great, together with the nandinstall feature.

Congratulations again on your fantastic job with Cubian!

@mahdichi
Copy link

hi,
i have ralink RT3572 wifi.
i try insmod rt5370.ko but i cant

root@Cubian:/home/cubie# insmod rt5370sta.ko
Error: could not insert module rt5370sta.ko: Invalid parameters

i install Cubian to nand and update it.

am i doing wrong? please help? thanks.

@centaux
Copy link
Author

centaux commented Aug 12, 2013

I tried on my A20 cubieboard now.
I had the same error as mentioned above by mahdichi:
Error: could not insert module rt5370sta.ko: Invalid module format

I see from dmesg:
[12308.893821] rt5370sta: disagrees about version of symbol module_layout

Best regards

@cubieplayer
Copy link
Owner

emm, this driver is for A10 which has a kernel 3.4.43, I need recompile the driver for 3.3.0

@centaux
Copy link
Author

centaux commented Aug 17, 2013

Hi cubieplayer. Thanks for the follow up.
Are you planning to add this to a coming release soon?
The Ralink usb wireless adapters are very popular, and normally work great in other distributions. I would love to use Cubian due to its great features that simplify important tasks, like the SD to NAND install, cubian-update and cubian-resizefs. But now I have to use Linaro on the cubieboards (A20) as I need to use USB wireless adapters.
Cheers

@cubieplayer
Copy link
Owner

I will release a update of cubian-update soon. The updates contains the ralink driver and kernel is upgrade to 3.4.43+ on A20. The downgrade operation is aslo supported. I needs do a lot of tests before it's ready to release.

@cubieplayer
Copy link
Owner

The new updates is available. Ralink driver should work. http://cubian.org/2013/08/18/kernel-update-to-3.4.43-on-a20/

@centaux
Copy link
Author

centaux commented Aug 19, 2013

Thanks cubieplayer
Hey, I ran cubian-update and rebooted, but uname is still listing the kernel a 3.3.0:

root@Cubian:~# uname -a
Linux Cubian 3.3.0+ #18 SMP PREEMPT Mon Aug 12 03:06:36 CST 2013 armv7l GNU/Linux

Am I doing anything wrong?
Regards

@mmplayer
Copy link

@centaux Sry for that, but did you install the latest cubian-update? What's the output of cubian-update -v

@centaux
Copy link
Author

centaux commented Aug 19, 2013

This is the output:

root@Cubian:~# cubian-update -v
Root Path: /
Update Kernel: yes
Update Modules: yes
Branch: a20
*** Checking firmware updates from server
Checking updates from server https://github.com/cubieplayer/cubian-firmware.git
Remote revision: fcd6895b5c418756e0ce44544ec18bfa8ce7c8df
Local revision: fcd6895b5c418756e0ce44544ec18bfa8ce7c8df
*** Your firmware is up to date

root@Cubian:~# uname -a
Linux Cubian 3.3.0+ #18 SMP PREEMPT Mon Aug 12 03:06:36 CST 2013 armv7l GNU/Linux

@cubieplayer
Copy link
Owner

@centaux you are using the old version of cubian-update. http://cubian.org/2013/08/18/kernel-update-to-3.4.43-on-a20/

@centaux
Copy link
Author

centaux commented Aug 19, 2013

You are right. In this cubieboard2 I had not ran apt-get update before the apt-get install...

Ran well after it and the cubian-update is done successfully.

Now back to the new module for Ralink:

There is still an issue, on the new rt2870sta module including with this update: The initialization fails as the system is trying to open a non existent dat file for the module: /system/vendor/modules/RT2870STA.dat

From dmesg:

[ 280.292044] RtmpOSFileOpen(): Error 2 opening /system/vendor/modules/RT2870STA.dat
[ 280.303448] Open file "/system/vendor/modules/RT2870STA.dat" failed!
[ 280.307530] 1. Phy Mode = 0
[ 280.308534] ERROR!!! RTMPReadParametersHook failed, Status[=0x00000001]
[ 280.381863] !!! rt28xx Initialized fail !!!

@cubieplayer
Copy link
Owner

@centaux

  1. download RT2870STA.dat
  2. put to /system/vendor/modules/
    Does it work?

@centaux
Copy link
Author

centaux commented Aug 20, 2013

Thanks cubieplayer.
Yes, I created the /system/vendor/modules directories (which don't exist in the current cubian image) and placed there the .dat file.

After that the module initializes.

But still hostapd, which is why I opened this request, does not work with cubian. Which is interesting, as with my Linaro/Ubuntu images for cubieboard I can have in 5 min an access point up and running with hostapd and these Ralink wi-fi adapters..
hostapd just can't initialize the required nl80211 driver.

Anyway, I guess I'll wait for newer versions of cubian in the future.

If you want some further details let me know.
Best regards

@abispo
Copy link

abispo commented Aug 23, 2013

I have the same problem. My cubieboard is A20 and the system is up to date. I got the following output:

root@Cubian:~# ifup wlan0
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

RTNETLINK answers: Operation not permitted
Listening on LPF/wlan0/00:0f:54:15:1b:b4
Sending on LPF/wlan0/00:0f:54:15:1b:b4
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
send_packet: Network is down
receive_packet failed on wlan0: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
send_packet: Network is down
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16
send_packet: Network is down
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
root@Cubian:~#

The cubieplayer's solution using RT2870STA.dat doesn't work for me too.

@Simon-L
Copy link

Simon-L commented Aug 26, 2013

Just a quick comment, my solution was to modify script.bin/fex to enable usb wifi, along with running cubian-update to update to latest kernel ( 3.4.43.sun7i+ as of this writing).
When running "modprobe rt5370sta" it failed and dmesg showed error "ERR: script_parser_fetch usb_wifi_usbc_num failed". Googling this I found it was an error in the Ralink module source code mentioning "usb_wifi_para" which is a section normally present in script.fex that isn't in the default Cubian script.fex.
I added the following section to script.fex and ran fex2bin.

[usb_wifi_para]
usb_wifi_used = 1
usb_wifi_usbc_num = 2

Rebooted and voila, "sudo ifup wlan0" worked.
Source for script.fex section is : http://linux-sunxi.org/Fex_Guide#.5Busb_wifi_para.5D

@cubieplayer
Copy link
Owner

@Simon-L Seems it doesn't matter whether usb_wifi_used is 0 or 1. It's working because usb_wifi_usbc_num must exists in script.bin. Whatever, I think it's good to set usb_wifi_used to be 1.

@Simon-L
Copy link

Simon-L commented Aug 28, 2013

@cubieplayer I agree yes. If I may suggest something, I think it could be a good idea to either set usb_wifi_usbc_num to 2 by default in script.bin or write it in the wiki that one needs to change that since I couldn't find the information anywhere.

@cubieplayer
Copy link
Owner

@Simon-L cubian-update will update script.bin if there is a newer version. The fex file Cubian used is here. They all defined the wifi para.It should be ok if you run cubian-update.
1.A10 https://github.com/mmplayer/sunxi-boards/blob/master/sys_config/a10/cubieboard_argon.fex
2.A20 https://github.com/mmplayer/sunxi-boards/blob/master/sys_config/a20/cubieboard2_argon.fex

@cubieplayer
Copy link
Owner

@abispo What about apt-get installl firmware-ralink?

@abispo
Copy link

abispo commented Sep 2, 2013

@cubieplayer, I sold my cubieboard few days ago, lol. I'll buy another and test again. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants