Welcome to the home of Ben

Navigation
 
 
 
 
 
 
Information
 
 
 
 

WMB Applications

If you want to talk to your Nintendo DS then these applications may help. You can get the source for all the applications in this single tar ball (dated 9th June 2006). To build the applications, extract the source (tar -xvjf NinWMB_xxxxxxxx.tar.bz), change directory into the NinWMB_xxxxxxxx directory and type make (this will make the Linux versions). To make the DSLinux and NDS ports use make -f Makefile.dslinux and make -f Makefile.nds respectively.

These applications use information and code from the gbadev forums and libnifi project.

Currently the only wireless adaptors known to work with these applications are those based on the ralink rt2500 and rt2570 chipsets. For the rt2570 chipset you will need the hacked driver.

You can follow developments with Linux WMB hosts in a topic on gbadev.org.

The applications run under Linux with versions being ported to DSLinux and native NDS.

Windows Users: you can use the linux wmbhost and rt2570 driver under VMPlayer. See here and here for details.

News

9th June 2006 - released new source code. Added command line option to set the client send interval.

9th June 2006 - released new source code which allows correct download of Trauma Centre and some other demos. Added command line option to change the wmbhost server's name.

25th March 2006 - released some shell and awk programs to help investigate how to configure DS wifi.

9th March 2006 - released new source code which includes a non working NDS port.

Contents

Latest Versions

RSS feed Keep up with the latest releases with this RSS feed.

ApplicationCore lib Common Linux DSLinux NDS
WMB host 1.0 1.0 1.1 0.2 (not working) 0.1 (not working)
WMB client 0.1 0.1 NA NA

Source tar balls

Recent source releases, latest first.

DSLinux binary

If you cannot build from the source, here is the latest binary (does not do anything useful yet). You may want to rename it to something a bit shorter.

NDS binary

If you cannot build from the source, here is the latest .nds file. It is currently broken as the data transfer does not work.

rt2500 Card Problem

I am having a problem with my rt2500 card. When my PC first boots up the card does not seem to want to send out or receive frames when in monitor mode. I can resolve the problem by bringing the interface down, removing the module (rt2500) and then modprobing the module back in again.

The sequence of commands I use for bringing the interface up is as follows:

iwpriv ra0 rfmontx 1
iwpriv ra0 set TxPreamble=1
iwconfig ra0 mode monitor
ifconfig ra0 up
iwconfig ra0 channel 13 rate 2M

Core Library

The core library is code that is common to all applications. It includes functions for manipulating ieee802.11 frames and .nds files and the like.

Change Log

  • Version 1.0
    • Use the correct NDS header when downloading .nds file with a DS DOWNLOAD PLAY header in them.
  • Version 0.2
    • File reading moved out of core library.
  • Version 0.1
    • Initial version after seperation.

WMB host

Download Nintendo DS demos and homebrew (flashme'd DS required for homebrew) over the air.

WifiMe works with this host now! The firmware on your DS must be version 3 or less for WifiMe to work.

NDS version notes

There is a problem receiving 802.11 Data frames at the moment and, therefore, the data transfer does not happen.

This has only been tested using a GBAMP and using the Linux WMB client program below as the client.

How to use it

Copy the .nds file that you want to transfer to the root of your CF card, renaming it "test.nds". Run the WMB host nds file and enjoy the fine user interface. Lots of debug stuff relating to the wifi side of things will be printed out.

DSLinux version notes

This version does not do the wireless side yet and therefore cannot do transfers.

How to use the Linux version

This host cannot do any tuning of a wireless interface so you will have to set that up beforehand. The interface must be setup in monitor mode with transmit allowed, preamble short and a rate of 2M.

Here is an example of how to run the application assuming you have tuned your card to channel 13, you are using the hacked rt2570 driver and your demos are in the directory NDSDemos.

./wmbhost -i ninusb0 -c 13 NDSDemos/meteos_demo_e3_2005.nds

To do WifiMe simply add the -w option

./wmbhost -i ninusb0 -c 13 -w NDSDemos/meteos_demo_e3_2005.nds

PCAP frame dumping

The Linux version of the host can dump its frames to a set of pcap format files.

FILE_PREFIX_tx.pcap file contains the frames that the host has written out. If a frame appears here it does not mean that it actually went out on the air.

FILE_PREFIX_rx_all.pcap file contains all the frames that the host has received. This will include the frames the host itself has transmitted (the interface is in monitor mode so should pass up all frames it sees). Any frames in the air from other random stations may also appear.

FILE_PREFIX_rx.pcap file contains all the frames that the host has received and processed. A frame is considered processed if it is correctly addressed to the host and from a client with which the host is having a conversation.

The WMB host and client interaction can be seen by a merge of FILE_PREFIX_tx.pcap and FILE_PREFIX_rx.pcap (this is FILE_PREFIX_rx_all.pcap with any noise removed).

Linux Usage

The following is the program's usage (Linux version - DSLinux version is similar but with fewer options).

Usage: wmbhost [OPTION...] <nds input filename>
A Nintendo DS WMB host -- server for ni-fi downloads
 
  Wireless mode:
  -i, --iface=IF_NAME The name of the wireless interface.
 
  File mode:
  -o, --outfile=FILENAME The file to which the client will place its output.
  -s, --infile=FILENAME The file from which the client will take its input.
 
  General options:
  -a, --genacks Generate ACK frames - if your hardware does not auto respond you will need this.
  -c, --channel=CHANNEL_NUM The channel the interface is on (THIS DOES NOT TUNE THE INTERFACE TO THE CHANNEL)
  -n, --name=SERVER_NAME Set the server name to the supplied string (maximum of 10 characters).
  -p, --pcap=FILE_PREFIX Dump Tx and Rx frames, in pcap format, to FILE_PREFIX_tx.pcap, FILE_PREFIX_rx.pcap and FILE_PREFIX_rx_all.pcap.
  -t, --interval=INTERVAL_TIME Set the interval, in microseconds (minimum 2000), between sends to the client. A smaller value means a faster download. The default is 20000. Using a smaller value than the default with a rt2570 based USB stick can lead to instablity of the driver. Values that are too small (less than 5000 but this is system dependent) will actually cause the download to be slower.
  -w, --wifime Enable WifiMe and boot the GBA flash cart
 
  -?, --help Give this help list
  --usage Give a short usage message
  -V, --version Print program version
 
Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options.
 
Serve Nintendo DS downloads over the air to anybody who asks for them.

The file mode was an idea I had for connecting a WMB host and client together without a wireless interface for testing.

Change Log - Common Platform Version

The code that is common to all platforms.

  • Version 1.0
    • The D@rion fix - have non ascii characters in the client DS name no longer causes a segmentation fault.
  • Version 0.3
    • Changes for NDS port.
  • Version 0.2
    • Restructuring of the source directories.
    • Better method for sending the data blocks in the right order (the previous version was development code that got left in - it worked most of the time so I forgot about it).
  • Version 0.1
    • Initial release with seperate versioning.
    • Fix for zero ROM size in NDS header; you can download Sushi now (and play it on a flashme'd DS)

Change Log - Linux version

  • Version 1.1
    • Added an option to adjust the client send interval from the command line.
  • Version 1.0
    • Added command line option to change the wmbhost server name.
  • Version 0.5
    • File reading moved out of core and into platform code.
  • Version 0.4
    • Restructuring of the source directories.
    • Platform, application and core library seperation.
  • Version 0.3.2
    • Seperate application and core versioning
  • Version 0.3.1
    • Added PCAP frame dump files.
    • More common/platform dependent code seperation.
  • Version 0.3.0
    • This release is to aid with porting and keeping a common core code.
    • Split the entry point for easier porting.
    • Removed the mmap of the NDS file to reduce memory footprint.
  • Version 0.2.3
    • Fix for rt2500 based cards: Insert the frame sequence number and do not rely on the hardware to do it.
  • Version 0.2.2
    • BUG FIX: Being a bit eager and zeroing beyond the end of a structure :(
  • Version 0.2.1
    • Will now drop privileges after opening the interface so you can run setuid root from non root accounts.
    • Fixed getting the client DS name
    • Other tidying up
  • Version 0.2
    • The first WifiMe version
  • Version 0.1
    • Initial release

Change Log - DSLinux version

Please note that no version has wireless.

  • Version 0.2
    • Restructuring of the source directories.
    • Platform, application and core library seperation.
  • Version 0.1.2
    • Seperate application and core versioning
  • Version 0.1.1
    • More common/platform dependent code seperation.
  • Version 0.1
    • Initial release
    • Note: this version has no wireless therefore no transferring. Released for those who may be interested.

Change Log - NDS version

Please note that data transfer is broken in all versions.

  • Version 0.1
    • Initial release

A WMB client for talking to Nintendo DS

This client is still broken and cannot download from a DS.

The client is now logically complete. By this I mean that it can download and save a .nds file. What it cannot do is download when talking to an actual Nintendo DS (see the problem below).

You can play around downloading from a WMB Linux host using the wirless interface or using the file operation mode. Oh the fun.

To help improve the WMB for linux programs I began developing this client. I hit a bit of a problem and think this particular client may stay broke forever more.

Change Log - Common Platform Version

The code that is common to all platforms.

  • Version 0.1
    • Initial release

Change Log - Linux version

  • Version 0.1
    • Initial release

The Problem - as I understand it

A WMB host and client talk by the host polling the client (data for the client is included in this poll message) and when the clients sees this poll it can send a reply - also marked as an acknowledgement. This acknowledgement must be sent in a timely manner so if no data is ready then the poll is at least acknowledged with a no data reply. All frame exchanges are initiated by the host.

The problem arises from the "in a timely manner" as it is not possible to acheive this at application level - the computer could be off doing something else when the frame arrives and not give your application the processor until after the time when the host expects to receive a reply. Without the response, as expected by the host, it appears to ignore what you do send. You can see this if you capture the wireless frames, they do not follow the nice host/client pairing as seen when two DSs talk to each other.

Possible Solutions

To be timely, replies will have to sent as a direct response to a frame being received.

In the Driver

This can be done at the driver level. When the driver sees a frame of a particular type it can ready a response and it is not likely to get interrupted for the entire window in which the host is expecting its reply. This requires the driver to understand Ni-Fi and will obviously have to be implemented on each and every driver.

In the IEEE802.11 stack

As I understand it, the frame transfer between DSs is near enough standard 802.11. Therefore with a little (or possible a lot) of careful coding the 802.11 stack could be made to associate with and then talk to a DS being a WMB host (an access point in wireless terms). At the moment this would require changing each and every driver as some of the 802.11 operation is performed there. But I believe the linux 802.11 stack is being changed to perform these common tasks and leaving the driver to handle the putting/getting frames on/off the air. So in the future a WMB client maybe able to run on nearly all wireless cards supported by linux. Here's hoping.