RP and DWA-131

Placement, modules, components and accessories; the ones that exist and the the nice-to-be's
KrisJ
Posts: 8
Joined: Wed Jul 01, 2015 4:30 pm

RP and DWA-131

Post by KrisJ » Wed Jul 01, 2015 7:05 pm

Hi guys,

I have a D-Link DWA-131 lying around.

This device features an rtl8192cu chip just like the recommended Edimax - EW7811Un and the DWA-121 which was also reported to work with the RP (https://redpitaya.zendesk.com/hc/en-us/ ... connection)

When I plugin my module, during boot I get the message that wlan0 is not found.

lsub yields:

Code: Select all

Bus 001 Device 002: ID 2001:330d
Bus 001 Device 001: ID 1d6b:0002
Where the first ID is the WiFi dongle... (2001:330d).

Online many people seem to experience issues with getting this running but most solutions deal with Ubuntu and I am not well versed in the dark art of Linux modules.

Is it feasible to get this module running or shouldn't I bother?

I do not know what capabilities the Linux system on my RP has to try and solve this.

KrisJ
Posts: 8
Joined: Wed Jul 01, 2015 4:30 pm

Re: RP and DWA-131

Post by KrisJ » Wed Jul 01, 2015 7:52 pm

The same issue seems to have popped up for Raspberry Pi users and it could be fixed by recompiling a specific module.

https://www.raspberrypi.org/forums/view ... p?p=322870

However I have no idea yet on how to plug this fix in my unit...

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: RP and DWA-131

Post by Nils Roos » Wed Jul 01, 2015 11:49 pm

Going by the thread you linked, the solution is to add 0x330d to the list of device ids that the existing driver recognizes.

This could be accomplished by a small patch and a rebuild of the ecosystem from source.

KrisJ
Posts: 8
Joined: Wed Jul 01, 2015 4:30 pm

Re: RP and DWA-131

Post by KrisJ » Thu Jul 02, 2015 5:50 am

Indeed but looking at the github repo I was a bit lost as to where I should look. I suspect somewhere under "OS" but after that...

KrisJ
Posts: 8
Joined: Wed Jul 01, 2015 4:30 pm

Re: RP and DWA-131

Post by KrisJ » Thu Jul 02, 2015 10:05 am

I have been studying the github repository and I have already found RedPitaya/OS/buildroot/config where I see how you pull in the kernel code for compilation with some of the necessary features.

I can also see that you also apply specific patches and additions from the Overlay and Patches directories.

Particularly, RedPitaya/OS/linux/patches/add_rtl8192cu.patch seems to be relevant to me.

What I did not yet figure out is how I can use all this to get that missing device ID string in there somewhere or alternatively dump in the pre-compiled and fixed module that is floating around.

For the interest of learning it might still be cool if you could give some further pointers as to where I should look.

I can then find my way with compiling everything etc... so no pre chewed solutions needed :)

Buying the reported working adapter is probably easier but I want to learn something.

KrisJ
Posts: 8
Joined: Wed Jul 01, 2015 4:30 pm

Re: RP and DWA-131

Post by KrisJ » Thu Jul 02, 2015 2:41 pm

Just posting my findings as they might once serve someone:

Without having experience on Linux but looking at the RP GitHub repo it seems patches are applied to the various sources used to compile the OS. In particular:

RedPitaya/OS/linux/patches/add_rtl8192cu.patch

As I understand, these files are created by some sort of diff tool and can be applied to source files during compilation?

In any case, in this file, two lines are of interest:

181441: + {USB_DEVICE(0x2001, 0x3309)},//D-Link - Alpha (as part of usb_intf.c)

and

91190: + else if((pHalData->EEPROMVID == 0x2001) && (pHalData->EEPROMPID == 0x330a) (part of usb_halinit.c)

In the Raspberry Pi community, the DWA-131 was made functional by just copying these lines and modifying 0x330a to 0x330b

Like here:

https://github.com/grimjoey/raspi-linux ... b487d04812

I should in theory be able to pull in the RP source, edit these lines and recompile but here I have to questions:

1) How can I edit the .patch file? Can I do that manually by just adding a + .... line or do I need to use a tool?
2) After the edit will I be able to just install Vivado, compile and go?
3) It might be tricky to ask but would it be possible to add this permanently to the RP repository? It seems like such a small thing to do. At our uni, these DWA-131 devices are quite ubiquitous so it might help others who are interested in using RP units over here ...

Any feedback is welcome.

Cheers,

Kris

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: RP and DWA-131

Post by Nils Roos » Thu Jul 02, 2015 2:57 pm

KrisJ wrote:Buying the reported working adapter is probably easier but I want to learn something.
I wholeheartedly support that notion ;O)

I doubt you'll be able to use the precompiled binary, unless it was build on a kernel of exactly the right version and identical configuration as the Red Pitaya's - not likely.

I haven't had a look at the rtl8192 patch or the corresponding driver yet, that will have to wait until I get home later.

I just saw your post that you already found the places you'd need to modify ;O) so I'm just going to answer your new questions:

1) you can edit patch files manually, but there's a bit more to it than adding a line with preceding '+'. Either you learn about the diff-syntax or you take the original c file, apply the current patch, then add the 0x330d lines, then generate a patch against the original and replace the old patch with the new one.
2) here and here are two threads that may help you get started with building the ecosystem.
3) When you have a patch that works, consider submitting a pull request against the RP repo.

KrisJ
Posts: 8
Joined: Wed Jul 01, 2015 4:30 pm

Re: RP and DWA-131

Post by KrisJ » Thu Jul 02, 2015 3:00 pm

Thanks,

I indeed started to figure out that I need something like Emacs Diff mode or similar to do a safe edit but I didn't yet think about incrementally applying patches.

I will definitely give those solutions a try as it seems like an easy fix for a silly problem (the B HW revision of this stick).

When I manage to get it going I'll definitely submit a PR.

Thanks!

pavel
Posts: 799
Joined: Sat May 23, 2015 5:22 pm

Re: RP and DWA-131

Post by pavel » Thu Jul 02, 2015 3:56 pm

Hi Kris,

I've recently built a customized version of the Red Pitaya SD card that contains the patch for DWA-131. If it's not too much work for you, could you please check how it works with DWA-131? It can be downloaded from this link.

Cheers,

Pavel

KrisJ
Posts: 8
Joined: Wed Jul 01, 2015 4:30 pm

Re: RP and DWA-131

Post by KrisJ » Thu Jul 02, 2015 4:00 pm

I will!

I was waiting for a confirmation of my registration with Xilinx to actually get my hands on the necessary SDK to build here ... seems to take forever :\

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 71 guests