OpenWrt Forum Archive

Topic: Kingston Mobilelite MLW221

The content of this topic has been archived between 14 Apr 2018 and 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello!
I just bought myself this new toy also and am looking to teach it some tricks for the hardware.
I was checking this page and saw an error and i don't know where to report it; the MLW221 actually has 16MB of flash storage.
It can be seen on the actual pictures on the page that the flash chip is marked FL128S... which is 128Mbit flash. Even in software the flash chip is identified as FL129P which is the old version of 128Mbit chip.
FL129P
FL128S

Thanks for the report. Wiki updated.

Patch v3 submitted for this device.

http://patchwork.openwrt.org/patch/6000/

WARNING :
If you want to play with OpenWrt on this toy...
You will need to have access to the serial port.

(Last edited by ldpinney on 26 Jul 2014, 15:27)

Hi,
     I've too recently came into possesion of an MLW221 unit for about $37, knowing well that the software support will be a bit modest (proprietary Android client, no API) . I'm too interested in expanding the capabilities of this device (which can be considered as a battery-operated MIPS-powered portable router with USB host). But because I do not have all the required knowledge (and time) to develop my own firmware, I've searched the web for other people who are working on this seemingly not-so popular apparatus. The only info I found is this forum (and the device's OpenWRT wiki page) and http://devchaotic.blogspot.ro/, which is the only source for details for installing OpenWrt, but seems to have paused his work.
     I've managed to open the device simply and cleanly by inserting a plastic clip, so I have fully working access to the UART port. So if there is anything I can help, I'm more than glad to do (i.e. test firmware).
     So my question is: will someone post the settings that they chose in menuconfig for this device, or additional settings/steps taken that are specific to this board/processor? Thank you!

(Last edited by mihneapop on 25 Jul 2014, 22:19)

Hi mihneapop:

Sure send me an e-mail....I'm working on patch v3 for this device

Device is supported in trunk @r41841

Thank you for your work, ldpinney! It's good to know we can use our MLW221 to it's full potential!

Hi,
I got me an MobileLite G2 some weeks ago and I would like to connect a Voltcraft K402 Datalogger to get the temperature from my coffee roaster to my iPad. But there fore I have to "update" the MobileLite with the linux driver from Silicon Labs (CP210 USB to UART Bridge VCP Driver)  http://www.silabs.com/products/mcu/page … ivers.aspx
Will there be a way to modify the ML G2 so that I can use it?
I am only a Mac user und have some very low experience with Linux (from 1990).
Can anyone help me?
Thanks
Peter

katho wrote:

Hi,
I got me an MobileLite G2 some weeks ago and I would like to connect a Voltcraft K402 Datalogger to get the temperature from my coffee roaster to my iPad. But there fore I have to "update" the MobileLite with the linux driver from Silicon Labs (CP210 USB to UART Bridge VCP Driver)  http://www.silabs.com/products/mcu/page … ivers.aspx
Will there be a way to modify the ML G2 so that I can use it?
I am only a Mac user und have some very low experience with Linux (from 1990).
Can anyone help me?
Thanks
Peter

Hi,
Unfortunately OpenWRT has been ported so far only for the first generation of MobileLiteWireless, and not the second (G2). I'm not sure if you can use the same image file because it may not have the same hardware configuration (cpu, bootloader, leds, etc.). But you could share some pictures with the internals, maybe you're in luck and it's the same. It doesn't appear to be a lot of info on the internet regarding your model, but judging by it's datasheet and photos, it looks the same in terms of hardware design (three LEDs, 2 buttons, usb host and charge ports, SD card port and it also includes an ethernet port, which on the first generation isn't installed, but can be accessed via some test pads on the board), and has a richer software (ability to work as a router is useful).
If you do manage to put OpenWRT on it, there are already kernel mods available for a multitude of USB-to-Serial adapters.
So it would help a lot if you do a quick disassemble (only if you wish) and post some photos. Even better, if you could get access to it's serial port, you could dump it's bootloader output (as seen on http://wiki.openwrt.org/toh/kingston/mlw221) and it could confirm if it is the same (heck, maybe I'll buy one too if it would work with OpenWRT out of the box).

Just opened it :-)
How can I upload Fotos?

katho wrote:

Just opened it :-)
How can I upload Fotos?

Hi,
You could use some online photo sharing service and post the link to it (for ex. Flickr). You can't upload images on this forum website, only embbed images as online links (HTML code).
Best regards,
mihneapop

Hope that that will help to solve my problem

http://up.picr.de/19745415oh.jpg

http://up.picr.de/19745994ij.jpg

http://up.picr.de/19745980tv.jpg

http://up.picr.de/19745981jn.jpg

http://up.picr.de/19745982ys.jpg

http://up.picr.de/19745983cv.jpg

(Last edited by katho on 7 Oct 2014, 14:08)

katho wrote:

Hope that that will help to solve my problem

http://up.picr.de/19745982ys.jpg

Hi,
It seems you're in luck as your generation 2 unit has the same SoC (system-on-chip), only in a different package. But to be 100% sure, it's best you dump your boot serial output. It looks like the only appropiate pins are the four pads on the main board's back, in the fifth photo, on the top-left position (next to the cut-out for the ethernet port, the middle two pads have a pull-up and a pull-down resistor). The pinout should be GND-RX-TX-VCC. Be sure to measure a voltage of 3.3V on the left-most and right-most pin before connecting your USB-to-Serial adapter (3.3V and not 5V compliant, of course). If at boot (startup_ you don't get anything, swap the RX and TX pin. Do a cold-boot (i.e. completely turn off then turn on the device) and paste the console output here.
Best regards,
mihneapop

(Last edited by mihneapop on 9 Oct 2014, 16:53)

Hey everyone, I figured out how to install OpenWRT on the MLW221 without opening the case or soldering anything.

Kingston's factory firmware has a very rudimentary upgrade process... Place a firmware file with the name of "mlwfw_v*.*.*.*.bin" on the root of a FAT32 USB flash drive, insert the flash drive and power on the unit. The factory firmware searches on boot for a file matching this name and if found it launches its firmware update process.

Kingston released a firmware update, version 1.1.5.2, which is available on their website. Here's what it looks like once the file is found:

We're now doing FW upgrade...
rm -rf /media/USB1/mlwfw_v1.1.5.2.bin;reboot;
CRC check is OK!
fw_model is WMTM-169N
fw_version is 0.0
FW model is correct!
Start to run nvram_upgrade function
nvram_upgrade start to sleep...
nvram_upgrade sleep done...
ifconfig: ioctl 0x8913 failed: No such device
ifconfig: ioctl 0x8913 failed: No such device
ifconfig: ioctl 0x8913 failed: No such device
killall: udhcpc: no process killed
killall: wifidetect: no process killed

-------Start Image Upgrade--------
INFO:Blinking DIAG LED...
INFO:Erasing kernel partition...
INFO:Burning Kernel&root...
INFO:nLeft = 5510481
INFO:Wrote 64 KB

(..... lather, rinse, repeat ...)

INFO:Wrote 5 KB
Upgrade /media/USB1/mlwfw_v1.1.5.2.bin(5381 KB) successfully
The system is going down NOW!
Sending SIGTERM to all processes
Sending SIGKILL to all processes
Requesting system reboot
Restarting system.

So I tried copying the openwrt firmware binary to a USB drive as "mlwfw_v1.1.5.0.bin"... it ran the firmware update process and the CRC check failed. Next I set off to compare the factory firmware update file to the image stored on the flash (available via /dev/mtd3). I discovered that the file contains a 52-byte header not found on the flash, and the flash has 52 bytes worth of zeroes at the end of the image. I figured this 52-byte header had to either contain a CRC checksum of the image or a static CRC signature used to authenticate the image source.

I tried the easy route - I took the 52 byte header from Kingston's firmware, inserted it at the start of the openwrt image using a hex editor, and slapped it on a USB disk. Sure enough it passed the CRC check and flashed the image! Here's the process at work:

We're now doing FW upgrade...
rm -rf /media/USB1/mlwfw_v1.1.5.0.bin;reboot;
CRC check is OK!
fw_model is WMTM-169N
fw_version is 0.0
FW model is correct!
Start to run nvram_upgrade function
nvram_upgrade start to sleep...
nvram_upgrade sleep done...
ifconfig: ioctl 0x8913 failed: No such device
ifconfig: ioctl 0x8913 failed: No such device
ifconfig: ioctl 0x8913 failed: No such device
killall: udhcpc: no process killed
killall: wifidetect: no process killed

-------Start Image Upgrade--------
INFO:Blinking DIAG LED...
INFO:Erasing kernel partition...
INFO:Burning Kernel&root...
INFO:nLeft = 3407928
INFO:Wrote 64 KB

(again, lather, rinse, repeat...)

INFO:Wrote 0 KB
Upgrade /media/USB1/mlwfw_v1.1.5.0.bin(3328 KB) successfully
The system is going down NOW!
Sending SIGTERM to all processes
Sending SIGKILL to all processes
Requesting system reboot
Restarting system.

It boots right up with OpenWRT!

Unfortunately the OpenWRT release image has the wireless interface disabled by default, which means you DO have to open the thing up and solder on the wired ethernet header to perform the initial configuration. It would be nice in a future release if the OpenWRT image had a wireless network enabled by default.

That's all for now!

-Laird

laird.bedore wrote:

Kingston's factory firmware has a very rudimentary upgrade process...CUT...

Unfortunately the OpenWRT release image has the wireless interface disabled by default, which means you DO have to open the thing up and solder on the wired ethernet header to perform the initial configuration. It would be nice in a future release if the OpenWRT image had a wireless network enabled by default.

That's all for now!

-Laird

Hello Laird :

Nice find...Thanks!

The factory firmware upgrade process uses a 52-byte header.
Perhaps one could replace this factory header with the OpenWrt header to revert to the factory firmware?
Like I would do that smile

Yes...OpenWrt has the wireless interface disabled by default...but you can change that when you compile it.
I used the Serial/TTL port to enable the wifi...

IMHO enabling OpenWrt to build the "mlw221-squashfs-factory.bin" could be considered a bit reckless for this device.
Also note that currently no MT762* based devices have the *-factory.bin built by the OpenWrt build bot(s).

katho wrote:

Hope that that will help to solve my problem
...Pix CUT...

Hi katho

If you can post the serial output from your G2 I might be able to help get it running OpenWrt.

You can also send me forum email by clicking on my username.

Here's the USB-based firmware installation process in a nutshell.

1. Download an OpenWRT image for the MLW221.
2. Download the 52-byte header for Kingston's factory images.
3. Insert the header into the OpenWRT image for the MLW221.
4. Save the file to a FAT32-formatted USB flash drive as "mlwfw_v1.1.5.0.bin".
5. Insert USB drive, then power on the MLW221.
6. Wait. Quite a while. It has to flash, then it has to boot, then OpenWRT has to do its magic.
7. Connect to serial console (see the hardware wiki page) to do your initial configuration.

-Laird

Thanks everyone for the useful info here. Id been looking for something like the kingston as a travel appliance, so when I found this thread and the openwrt wiki entry I got a cheap one on ebay and began playing. Im aiming for something I can use to share the connection from a public network and also serve files via samba. The last couple of posts about the usb flash have been great, and Ive got things going now and thought Id put some notes and questions here.

Further to laird's post above you can join the header on with just a simple

cat mlw221-firmwareupdate-header.bin openwrt-ramips-mt7620n-mlw221-squashfs-sysupgrade.bin > mlwfw_v1.1.5.0.bin

Once it was flashed I went on the serial console and got a wireless repeater setup with method 2 from this thread. I needed to copy the generic settings in /etc/config/dhcp and /etc/config/wireless for things to work.

I then setup automounting as in this page - still a couple of issues to fix here.

Samba setup was from here - also an issue to sort out.

So far it seems to be working OK, Im getting about 2mb/s from the sd card on whilst connected to the other network as well. Questions Ive got so far:

* How would I save my config as a base for a failsafe boot? Does that need to be done with the flash image instead of the installed image?
* I cant see anything much in /proc about battery or charging, is this in the kernel at all?
* reboot seems to get stuck, need to power cycle by hand

These arent really MLW221 realted, but if anyone knows:

automounting
*Ive got it set on anon_mount=1 but its picking up the mtd partitions as well as usb/sd cards, is there an 'ignore partition' option?
*Can I set general mount options for anon_mount, specifically something like flush for vfat?

samba
*Im sharing /mnt so that any automounted device shows up, but this means that free space being reported by samba is the ~9mb on the flash, not the 128gb on the sd card. Is there a bodge to get samba report free space for the current mount instead of the base filesystem?

(Last edited by jumphog on 4 Nov 2014, 17:42)

jumphog wrote:

* I cant see anything much in /proc about battery or charging, is this in the kernel at all?
* reboot seems to get stuck, need to power cycle by hand

Confirmed...My unit has the same behavior ... seems to be hardware related, but I'm not certain.

It'd be nice to have a way of doing a clean shutdown when the battery goes flat but I guess that only matters for the mounted devices - root should be OK?

Ive got a bodge for free space and extra directories: Have two shares, sda1 & sdb1, it does mean that devices which arent partitioned wont show up, but thats probably an edge case.

Initially I had awful I/O performance with a class 10 SD card... it was formatted VFAT and mounted with the default options. I switched it to EXT4 and changed the mounting options to "async,noatime" and the performance is great now. My SD card holds a squid cache which isn't that critical, so I have a cron job that runs every 5 minutes and performs a sync, just in case the power dies.

Same experience with the battery, I haven't found a way to interface with it. Would've been smart to take a look at how they're doing it on the stock firmware. Power off and reboot don't work at all on Barrier Breaker but the current chaos calmer trunk reboots gracefully.

-Laird

After using the setup for a while its actually pretty workable. It'd be nice to have a better shutdown system but it doesnt seem to have caused any problems so far.

The only usability bug is that writes to the SD card via samba sometimes timeout. Ive put in the recommended firewall rules to stop it tracking smb packets which has helped, but occasionally it will stall. It doesnt seem to be an issue with putting the data on the card, as its only about 2mb/s and top doesnt show lots of sys time when the stalls happen. Ive had the same issues with all 3 of the cards Ive tried but reads are fine. Anyone else come across similar problems?

Been playing around with stock firmware before trying openwrt. Came up with a way to get a shell without opening the device up. It's a shell command injection exploiting the firmware upgrade script (/sbin/upgrade.sh)

on the root of a USB drive create a file called "mlwfw_v;telnetd; .x.x.bin" without the quotes

From a linux CLI:
$ touch 'mlwfw_v;telnetd; .x.x.bin'

Insert in the MLW221 and then boot/reboot. Give it a while and you should now be able to get a shell using a standard telnet client and the username 'admin'. The default IP is 192.168.200.254.

Hello, I just received the G2. (Sadly only to find out that the Android app won't work on Android 5 or, at least, this is what I think is the problem since many are reporting this but it could be something else in my case since I have never seen it working otherwise. I can connect to the G2's wireless network but the app won't find it...)

In anycase, the reason I'm posting here is not so much about this issue, but rather that reading this forum, I was getting to the conclusion that given the hardware for the G2 is the same as the first generation with the addition of an Ethernet port, that it was highly probable that installing openwrt on this device would not require that I open it. Anyone with more experience willing to concur with my conclusions?