Finally a good Pokewalker App
Most Pokéwalkers are now sixteen years old. As time goes on they break and are not replaced, and the ones for sale are expensive.
My Pokéwalker, which I paid $60 for, has a sheared screw!!! So I can't even get it open to change the battery and use it.
When looking at this sad state I found myself in, I decided I'd try to get the original cartridge to communicate with my phone. That's what I walk with every day, and another Pokéwalker is $60!
The trouble is infrared
Even a Pokéwalker that works is awkward to use. The connection to the Pokéwalker needs the walker's small infrared window and the cartridge's window to face each other at close range, and players have reported for years that it fails for no obvious reason. When it fails, nothing tells you why.
The Kizuna has no infrared! So how can we even communicate?!
The cartridge talks IrDA SIR, an old serial infrared standard, at 115200 baud. To do the same from a Kizuna adapter I would need an IrDA transceiver module, which packs an infrared LED, a photodiode and their driver into one small part. I would also need a serial port to feed it, and a board shape that points the module's window at the cartridge's window from close range.
Infrared would serve HeartGold and SoulSilver and nothing else Kizuna does, and it would bring every problem above with it, because it would be the same link with a different walker on the end. I decided it was not worth the effort.
An infrared link was a sensible choice in 2009 and is a poor one now. The adapter already has Wi-Fi, so I moved the same conversation onto that.
What I built is a Kizuna mode where the adapter plays the Pokéwalker and the DS reaches it over Wi-Fi.
The idea
The game does not care what is on the other end of its infrared link. It sends a request and waits for a reply in a known format. If something answers correctly and quickly enough, the game carries on.
So the plan had three parts. Boot the game from its own cartridge. Intercept the points where it uses the infrared chip. Send those messages over the DS's Wi-Fi radio to the adapter, which answers as the walker.
Getting the DS to run my code first
The adapter appears in the DS's Download Play menu as an app called Pokéwalker. The DS downloads a small loader from it. The screen asks you to insert HeartGold or SoulSilver into the card slot.
The loader then starts the game from the card itself. It does this the way the DS firmware does: it reads the card, does the handshake the card expects and hands over. During hand over, I give it a "shim".
The shim
With the game running, the loader replaces a handful of routines in memory. Two of them matter most. One is the routine the game calls to receive on its infrared link. The other is the check the game makes to confirm the cartridge's infrared chip is there. The shim makes that check answer yes, and it routes the receive and send calls onto the DS's Wi-Fi radio instead of the chip.
On the other end, the adapter does the walker's side: it answers the game's requests, keeps the walker's memory, counts steps and hands a Pokémon back when asked. The phone in the photo supplies the steps and shows what is on the walker.
Want to integrate it with your own projects? Smart watch?
Your adapter is linked to your Kizuna account, so your walker can be too. With your own private access key, you can read how your walker is doing and add steps from other software. That means you could make your own smartwatch app, connect it to other community Pokéwalker projects, or build it into a mobile app.
This is at a very early stage. Everything is on the API page, and the details may change.
A walker can only be tracked on one device. You cannot have several devices adding steps to it.
What it does not do
- It does not modify your cartridge. The loader only reads it.
- It does not provide the game. You need your own HeartGold or SoulSilver.
- It does not create, edit or add Pokémon. What goes out comes back.
- It is not approved by Nintendo or The Pokémon Company, and it is not affiliated with either.
The loader that runs on the DS is free software, and its source will be published with the release.
Kizuna