Jump to content

[SOLVED] Orange PI PC and $2 Ralink MT7601U dongle (USB ID 148f:7601)


Recommended Posts

Posted

It took me some time to figure how to make it work, so I decided to save it for some poor soul who would need it in future. (I am a Windows guy so this stuff is a bit alien for me).

 

I bought <$2 WiFi dongle for my new Orange PI PC from here: http://www.aliexpress.com/snapshot/7899695282.html?orderId=76846564349160

 

post-1862-0-44678900-1471251774_thumb.jpg

 

I am running latest "ARMBIAN jessie 3.4.112-sun8i". The chip was detected by the OS but didn't work: lsusb gave me this:

Bus 004 Device 002: ID 148f:7601 Ralink Technology, Corp.

I tried several solutions:

 

  • installing "firmware-ralink" package,
  • compiling various sources and getting "loboris kernel"
  • using code from this git: https://github.com/porjo/mt7601.git
  • ...and many others to no avail.

Here is how to make it work. 

 

Plug your Orange PI PC into LAN. Open terminal (or SSH) with root access. 

 

First, make sure that all packages on your board are up-to-date and install few additional ones (not sure if it is necessary, though, but it won't hurt):

apt-get update && apt-get upgrade && apt-get autoremove
apt-get -y install update-usbids  linux-headers-sun8i  build-essential fakeroot dpkg-dev

Download the driver to your Orange PI from the official MediaTek site (http://www.mediatek.com/en/downloads1/downloads/) using this command: 

wget http://cdn-cw.mediatek.com/Downloads/linux/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2

Unpack it with command:  

tar -jxvf DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2
cd DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/

Some recipes suggest editing the file "os/linux/config.mk" in the source of the driver, but it looks like MediaTek have made the necessary changes already.

 

Run commands and grab some coffee while it compiles. 

make
make install

Then run 

modprobe mt7601Usta

Reboot. Make sure that the command: 

iwconfig

now displays new network interface:

lo        no wireless extensions.
tunl0     no wireless extensions.
ra0       Ralink STA
eth0      no wireless extensions.

and running 

lsmod 

outputs the mention of "mt7601Usta". 

 

Now you can connect your Orange PI to WiFi network.  Run

wpa_passphrase NAME_OF_YOUR_WIFINETWORK YOUR_WIFI_PASSWORD

and save the generated passphrase (long string of numbers and characters that will look like this: "ebb09a6794c2500d74e433b9de4da493c......").

 

Make sure that neither your WiFi network's name or password contain characters which Linux bash considers "special". My password contained exclamation point, which is, and determining the cause of the problem was quite tricky. I had to "escape" it by prefixing it with backslash, like this:

password! => password\!

Edit file "/etc/network/interfaces":

editor /etc/network/interfaces

Unlike it is said in many manulas, your newly created interface will not be called "wlan0". Its name in your (our) case will be "ra0".

 

Add these lines on top of "/etc/network/interfaces" file:

auto ra0
        allow-hotplug ra0
        iface ra0 inet dhcp
        wpa-ssid NAME_OF_YOUR_WIFINETWORK
        wpa-psk LONG_STRING_OF_CHARS_AND_NUMBERS_YOU_WROTE_DOWN_EARLIER

Save the file by pressing Strl+S followed by "Y" and Ctrl+X.

 

Activate WiFi by running: 

ifup ra0

You wll get something like this as an output:

Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/ra0/00:36:76:22:b1:59
Sending on   LPF/ra0/00:36:76:22:b1:59
Sending on   Socket/fallback
DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 9
DHCPREQUEST on ra0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.100.1
DHCPACK from 192.168.100.1
bound to 192.168.100.209 -- renewal in 11858 seconds.

If you'd run:

ifconfig -a

you will see that both wired and wireless links work simultaneously:

eth0      Link encap:Ethernet  HWaddr ba:ab:c9:ac:7e:9a
          inet addr:192.168.100.206  Bcast:192.168.100.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1983 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1764 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:170565 (166.5 KiB)  TX bytes:294641 (287.7 KiB)
          Interrupt:114


lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  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:0
          RX bytes:0 (0.0   TX bytes:0 (0.0 


ra0       Link encap:Ethernet  HWaddr 00:36:76:22:b1:59
          inet addr:192.168.100.209  Bcast:192.168.100.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3283 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:841424 (821.7 KiB)  TX bytes:3420 (3.3 KiB)


tunl0     Link encap:IPIP Tunnel  HWaddr
          NOARP  MTU:1480  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:0
          RX bytes:0 (0.0   TX bytes:0 (0.0 

Now you can unplug LAN cable and reconnect your SSH to an IP address that belongs to the WiFi link you have just created.  

 

Additionally you can remove all IPv6 functionality if your home network doesn't use it. Edit the file "/etc/sysctl.conf" and add the following lines to the bottom of it:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Once you reboot your Orange PI, you won't see any mentions of IPv6 addresses in the output of "ifconfig -a" command. 

Posted

Two things to mention:

 

1) Without adding the module's name to /etc/modules I would believe you end up without WiFi after a reboot?

 

2) we included a driver for this dongle back in March, then in May the driver's repo got password protected (see issue #299) and in the meantime it's simply renamed but available again. The reason why this happened is outlined in Readme.md:

 

DON'T USE!! This driver is old + buggy - use the official Linux driver instead

 

We disabled building the driver in May but since the old repo is available again with a different URL I simply gave it a try since I built an Armbian image anyway: By renaming extras/mt7601.sh.disabled to extras/mt7601.sh and adjusting line 12 to point to the new repo URL driver compilation seems to work again:

 

[ o.k. ] Installing additional driver [ MT7601U ]

[ o.k. ] ... you have latest sources [ mt7601  ]

[ o.k. ] Installing additional driver [ RT8192 ]

[ o.k. ] ... you have latest sources [ rt8192cu  ]

[ o.k. ] Building deb [ sunxi-tools ]

[ o.k. ] ... downloading sources [ sunxi-tools ]

[ o.k. ] ... downloading sources [ temper ]

[ o.k. ] ... downloading sources [ BT utils ]

[ o.k. ] ... compiling [ sunxitools ]

[ o.k. ] ... compiling [ temper ]

[ o.k. ] ... compiling [ bluetooth utils ]

[ o.k. ] Installing [ armbian-tools-jessie_5.17_armhf.deb ]

[ o.k. ] Installing additional application [ USB redirector ]

 

Since I have neither the hardware nor an interest in WiFi dongles I leave it up to someone else to check whether this tiny fix does really work and is the right step (since with vanilla kernel the official driver included in 4.2 should better be used if I understand correctly)

Posted

 Without adding the module's name to /etc/modules I would believe you end up without WiFi after a reboot?

 

I assume make install handled this somehow. WiFi works after reboot. 

(see issue #299

 

 

I saw that warning - that's why I ended up with official driver from MediaTek's website.

 

I will check your fix some time later this week and report on it here.

Posted

I saw that warning - that's why I ended up with official driver from MediaTek's website.

 

Well, but that was maybe a move in the wrong direction since the porjo repository bases on this driver but contains tons of bug fixes according to commit history: https://github.com/porjo/mt7601u/commits/master

 

BTW: Also based on looking through older variants of Readme.md I would assume it should be ok if we fix extras/mt7601.sh in Armbian sources (adding the single letter u to github driver repo's URL) since when running kernel 4.2 or above the new module will be default unless it is blacklisted. Since I can't test confirmation by someelse is needed. But then we could include MT7601U drivers again with Armbian (older kernels using porjo's driver, vanilla kernels the new included driver)

Posted

Well, but that was maybe a move in the wrong direction since the porjo repository bases on this driver but contains tons of bug fixes

Good point, I didn't pay attention to date of the MediaTek's sources.

 

 

 

 driver compilation seems to work again

 

In your estimates, when the new binary distribution of Armbian will be released? (I.e. will it make sense to take the trouble to get virtual machine with build environment up and running or just wait a bit?)

Posted

In your estimates, when the new binary distribution of Armbian will be released? (I.e. will it make sense to take the trouble to get virtual machine with build environment up and running or just wait a bit?)

 

Well, the developer who added this driver has vanished some time ago, at least I won't touch WiFi dongles and I've no idea whether someone else will look into (same applies to release of updates).

 

BTW: Setting up Virtualbox isn't a heavy task and you get Xenial images ready to run 'somewhere on the internet' eg here: http://www.osboxes.org/ubuntu/(no idea if this is trustworthy but for a first test with Xenial Xerus final release in 64-bit variant it should suffice -- I use always official installers from Canonical since settings things up is pretty fast too).

 

In case you give it a try please report back -- also whether parts of our developer documentation needs improvements (preferrably as pull requests against our documentation repo :) )

Posted

You are asking too much of a Windows guy :) And the last time I've made a pull req to GitHub was a while ago. But I will give it a try.

Posted

I found our previous sources and enable them back.

 

No, you used Mediatek's original sources which are known to contain countless bugs. As written above: our previous sources are now available at https://github.com/porjo/mt7601u (repo URL has a trailing u now) and they contain tons of fixes compared to the sources you use now. Just read through the posts above and the commit log: https://github.com/porjo/mt7601u/commits/master

 

BTW: This other commit also worsens things (enabling audio in on CT and breaking it on all other sunxi boards that use microphone instead)

Posted

I hope this will go together with moving (already populated) to utils pool.

deb http://apt.armbian.com $RELEASE main utils desktop

Generally works but more testing is needed ...

First, there will be separate sunxi-tools package, so this part should be removed from armbian-tools.

Second, speaking of wireless drivers, ideally they should be packaged with dkms similar to existing r8168-dkms and rtl8812au-dkms. This should improve reliability of kernel upgrades (if dkms works correctly, needs to be tested).

And repository entries will look like this:

deb http://apt.armbian.com $RELEASE main $RELEASE-utils $RELEASE-desktop

or at least desktop part should be release-specific.

Posted

Is the driver already included in 5.20? I have:

root@PKBACKUP:~# lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 148f:7601 Ralink Technology, Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@PKBACKUP:~# dmesg | tail -20
[    6.211410] systemd[1]: Started Journal Service.
[    6.832513] rtc-ds1307 0-0068: rtc core: registered ds1307 as rtc1
[    6.832534] rtc-ds1307 0-0068: 56 bytes nvram
[    6.832571] i2c i2c-0: new_device: Instantiated device ds1307 at 0x68
[    7.116108] systemd-udevd[183]: starting version 215
[    7.951116] EXT4-fs (mmcblk0p1): re-mounted. Opts: commit=600,errors=remount-ro
[    8.148795] Adding 131068k swap on /var/swap.  Priority:-1 extents:2 across:139260k SS
[    9.686287] systemd-journald[167]: Received request to flush runtime journal from PID 1
[    9.960815] gmac0: probed
[    9.961142] gmac0 gmac0: eth0: eth0: PHY ID 00441400 at 0 IRQ poll (gmac0-0:00)
[   14.960222] PHY: gmac0-0:00 - Link is Up - 100/Full
[   20.100021] eth0: no IPv6 routers present
[  147.996252] ehci_irq: highspeed device connect
[  148.260115] usb 2-1: new high-speed USB device number 2 using sunxi-ehci
[  829.218316] ehci_irq: highspeed device disconnect
[  829.218529] usb 2-1: USB disconnect, device number 2
[  829.221336] ehci_irq: highspeed device connect
[  829.285464] ehci_irq: highspeed device disconnect
[  832.369997] ehci_irq: highspeed device connect
[  832.640115] usb 2-1: new high-speed USB device number 3 using sunxi-ehci
root@PKBACKUP:~#

Posted

Is the driver already included in 5.20? 

    

I have downloaded the sources from git and compiled them on the Ubuntu virtual machine, as advised. I've built Debian desktop version. WiFi works nicely from the box - all I had to do was to provide WiFi password from GUI.

Posted

or at least desktop part should be release-specific.

 

FYI, the Debian server variant I've built from sources works with this WiFi dongle "out of the box". But Ubuntu desktop does not - 'ifconfig' doesn't list 'ra0' adapter at all.

Posted

FYI, the Debian server variant I've built from sources works with this WiFi dongle "out of the box". But Ubuntu desktop does not - 'ifconfig' doesn't list 'ra0' adapter at all.

Most probably firmware is missing, dmesg log should contain more details.

Posted

Without compiling - is there any way to compile just module? I have just "server" release. If I am abl to run the driver then the rest should not be a problem (wpa_applicant etc.).

 

I see also a lot of discussion if sources are OK or not OK (so basically would be goo to post git URL with the most up-to-dated source which is OK). Then some part related that driver will be included in package (from apt.armbian repository). Is dis available already?

Posted
root@PKSERVER:/lib/modules/3.4.112-sun8i/kernel# find . -name "*7601*"
root@PKSERVER:/lib/modules/3.4.112-sun8i/kernel# uname -a
Linux PKSERVER 3.4.112-sun8i #14 SMP PREEMPT Wed Sep 14 20:29:31 CEST 2016 armv7l GNU/Linux
root@PKSERVER:/lib/modules/3.4.112-sun8i/kernel#

I guess the module is not included in Armbian 5.20...

Posted

I guess the module is not included in Armbian 5.20...

 

The problem is that this specific driver is only included at OS image creation time and that sources for this driver have been broken for a few months. So in case your OS image has been created between May 2016 and  Aug 16, 2016 then the driver is and will be missing: https://github.com/igorpecovnik/lib/commits/master/extras

 

Unfortunately not all stuff below https://github.com/igorpecovnik/lib/tree/master/extras is already properly packaged so that you'll have to rebuild the driver yourself in case you only updated Armbian since mid of August (simply use https://github.com/igorpecovnik/lib/blob/master/extras/mt7601.sh  and adopt it to your local installation)

Posted

So in case your OS image has been created between May 2016 and  Aug 16, 2016 then the driver is and will be missing

 

I checked out the sources from git on Sept 21st and compiled Debian and Ubuntu desktop versions myself in Ubuntu VM. The problem is that Debian desktop version works beautifully from the box with Ralink MT7601U, but Ubuntu does not. It does nothing when I try to open network manager and "ifconfig" doesn't list "ra0" adapter.

 

Please tell me what additional information I should provide to help debugging it.

Posted

Please tell me what additional information I should provide

 

Output of the following running as root:

modprobe -v mt7601u || modprobe -v mt7601

And then please don't fiddle around with /etc/network/interfaces (at least ensure that there's no entry for Wi-Fi present) but follow these instructions 

https://github.com/igorpecovnik/lib/issues/493#issuecomment-252751466 and get back to us with feedback (only one person so far responded but we need way more feedback on nmcli/nmtui. Thanks!

Posted

Hello !

 

Thank you very much for your solution, which works well !

However, I am using latest Armbian 5.25 Ubuntu desktop (using legacy kernel) and the interface does not start on boot, I each time I have to run "ifdown ra0" and "ifup ra0" to make it connect to my wifi AP... :wacko:

 

Do you have ideas to help me ?

Thank you !

 

Edit : A few more details, after boot (when desktop is displayed) I can see in my router configuration that the OPi is connected... But I can't ping it and when I try to run ifconfig, ra0 does not appear ! It looks like it stops working.

Here is the output of dmesg, as you can see I restart the interface (using ifdown and ifup) at 311 sec : http://pastebin.com/z7qsaad8

And strangely, I made a startup script which restarts the interface but that doesn't work...

Posted

Hi, long time listener (whos ears do not always understand everything that has been said), first time caller, please be gentle.

 

Like a lot of people I am not a linux expert but I am willing to learn. I have the opizero and the 7601 wifi chip and with the ubuntu legacy kernel the chip worked great and was giving me reasonable wifi speeds (I want to use it as a wireless backup).

 

It worked over multiple reboots until... I did the apt upgrade and the ra0 driver has disappeared and I cannot seem to get it back. 

the wlan0 also has disappeared but I'm not really fussed about that in this posting

 

I understand that the drivers have been disabled in 5.2.5??

 

How exactly do I work with the script below? how do I run this, and will this be what I am looking for, since there seems to be some issues with 7601 or 7601U

 

https://github.com/armbian/build/blob/master/extras/mt7601.sh

 

Should I go back to the version that was working, and never do an apt-upgrade?

If I should do this, then what would be the offending item that causes me problems in the upgrade?

 

https://askubuntu.com/questions/99774/exclude-packages-from-apt-get-upgrade is this something that I can use or will I have to specifically look out for any network drivers type issue when I have packages that need upgrading.

 

 

 

 

Thanks a ton for all the work that you guys do here, I really appreciate the fact that you guys enable me to use a $10 computer as a wireless server (until I upgrade :) )

 

Posted

When I unpack it it gave me message saying something about it could not change or something about the UID.

Anyone came across this message or know what this mean?

 

Or..... does anyone know a brand and model that is plug and play?

board info:

OPI PC RetrOrangePi and Armbian same as  Sanja, thread starter.

 

On ‎08‎/‎15‎/‎2016 at 5:04 AM, sanja said:

post-1862-0-44678900-1471251774_thumb.jpg

Download the driver to your Orange PI from the official MediaTek site (http://www.mediatek.com/en/downloads1/downloads/) using this command: 


wget http://cdn-cw.mediatek.com/Downloads/linux/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2

Unpack it

 

 

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines