Saturday, February 22, 2014

Running DslrDashboardServer on MLW221 OpenWrt

A little while ago I mentioned that I wanted to use the MobileLite Wireless for teetered shooting together with my trusty 50D and a Nook HD+. So my earlier prioritized list of functions is now on hold, and its time to play.

Earlier i found the great application DslrDashboard, so thats what I want to play with. And not only is the source ready, the developer has also created an OpenWrt package for it. This is almost easier than I deserve.

As mentioned in the last post I have cloned a github repo named qdk0901/openwrt-mt7620. Since my original plan were to actually create full support for the MLW221, I already started on adding proper support. So here is a short patch file.


Nothing big there, but at least it's a start.

After applying the patch, the next thing we want to do is getting DslrDashboardServer, and following the instructions on the page.

The next thing is to do a make menuconfig and configure our image. Since I haven't gotten time to look at the filesystem yet, we should still run with initrd. So it would be a smart choice to select that. Quickly summed up, these are roughly the items that needs to be selected.
  • The correct SoC etc.
  • Initrd
  • USB things
  • Vfat
  • Udev
I will most likely have forgotten something here, but you get the idea. I also choose to install the LuCI package, not because it's needed, mostly because I wanted to play around a bit.

Afterwards it's just to build OpenWrt. Boot the MLW221 uimage using tftp and play with the camera. If you have firewall enabled in the image (as I do) you will have to allow INPUT udp/4757. And then its time to play with the camera a bit. And I have to say, it's a quite sweet solution. The Nook HD+ is awesome for this, it's cheap, good sized and the screen is quite nice. And now I guess can finally find a use for the large hole in the bottom left corner of the Nook. It's good to have both hands free when adjusting the tripod.

Some people might find it a bit irritating that we start up in OpenWrt with an open WiFi network, and have to redo all configuration after every reboot. But then again, it's fun to test that it actually works fine.

If anyone want to test out with OpenWrt with the image I played with, you can download it here. If you don't have at least UART attached to your device, you should stay away. Myself I would prefer to just boot from RAM using TFTP (as described earlier). Have fun and play.

Wednesday, February 19, 2014

MobileLite Wireless running OpenWrt, with working wireless

It's been quite a while since last post. A combination of little time to play, and some bumps in the road.

I'll try to sum it up quickly.

After John commented about another project using the WiFi part on th MT7620, I decided to search around a bit, and found a ton of information. The most important being that OpenWrt didn't include the WiFi because of licensing issues.

Kingston were kind enough to include the Ralink SDK, even though the licensing in the source seems to indicate that it violates the license. But then again, I'm not a lawyer, so I can just assume what they are doing is legal.

I check out some code a few places, among those is this one ASUS RT-N56U/N65U/N14U custom firmware, but that is uClinux based, and we wanted OpenWrt. And OpenWrt as close to trunk as posible.

I found quite a few Chinese pages mentioning the WiFi on the device, at first the most interesting one was one called "openwrt-mt7620-pandora". Some minor changes, and I manage to boot the device with WiFi and everything. It was running a 3.3 kernel, but that wasn't any big issue. Then I start to look at the source and sure enough, there is both the Ralink/MediaTek license header in some files. There was also some files that were licensed to Drambox Pandora, with a disclaimer that It's illegal to use with other devices.

But at least, now I know its possible. So I start all over from scratch again. I have the source for the wireless drivers from Kingston, and if others have managed to use them, so should I.

Short story, it was a lot harder than expected. So I have spent quite some time learning the structure of OpenWrt devices, the toolchain etc. Today I finally had plenty of time after work to really sit down and try to solve this. I do a few quick searches to get some information, an this page pops into the search result MT7620 OpenWRT所用的RT2860v2 WIFI驱动package. And it links to this Github page. And sure enough, a few days ago there was a changeset that adds WiFi support to the device.

I just check out the code, configure and builds. And there I have it, the wireless is working just the way I want it to. On what seems like a, pretty current version of OpenWrt. Someone finished doing exactly what I were trying, and failing, to do. It would be stupid of me to continue trying to do this, when someone else has already finished doing it. So much for my learning experience.

I guess I will need to make some minor changes, add the MLW221 as a device. Configure GPIO and file system, and make a patch for it. But its getting closer.

If anyone want to try it out, this is how I do it.
  1. Clone repository
  2. make menuconfig
  3. Configure for our SOC
  4. Configure the WiFi part under Ralink as builtin, and add the stuff we need.
  5. Set image type to initrd
  6. Build
  7. tftp boot to ram
I still have my concerns about the license of some parts of the repository, so consider yourself warned.

Sunday, February 2, 2014

Getting OpenWrt to boot and wireless network to work

I'm back home, and a it's time to get things up and running here.

Our first goal is to get the system up and running with wireless support. We are going to do the testing using tftp boot and an image with embeded root file system.

I have spent a little time trying to learn the structure of OpenWrt and how devices are configured. Created a dts file for our device with the hardware specific parts and changed some of the boot scripts to support the device.

Building the image works fine, and it boots. So we are off to a good start here. For some reason I get decompress errors when booting from the uboot command line, but it works fine when booting from tftp on the main uboot menu (option 1). We might address that later, and find out whats wrong. But for now we are fine with just booting the normal way.

And after digging around a bit, I find out that while the SoC is supported, but the wlan is not. Which leaves us with a few options, use the proprietary driver (and therefore also a old kernel), write a driver for the wifi or use the uClinux environment that Kingston used. For now, I will go for the latter.

I guess I should have checked this out before spending a lot of time on preparing everything else for the image. So no OpenWrt, for now. Time to get a SSH server to our modified stock image.

And last, but not least. My pal Larry has created an OpenWrt wiki page for the device. My device seem to have a different flash chip (and 16MB to play with), but thats all I have to comment on it. Well, that and of course to say good work.

So thats it for now I will try to make an flashable image or something similar next time. Yes, and I almost forgot, I also want to use the device for tethered shooting with automatic backup to the SD-card and/or online services. I got this NOOK HD+ for cheap, and I decided that it would make a great device when shooting tethered. I could of course just do that using a Raspberry PI, since that already works fine, but whats the fun in that.