#127062 - Abcd1234 - Sun Apr 29, 2007 6:49 pm
I'm not sure if anyone else has done this (I looked around and could only find ->FAT dumpers), but I've written an EEPROM backup tool that, unlike existing solutions, dumps the contents via WiFi over a raw TCP/IP connection to a specified host. This is useful for those who only own a slot-1 card and wish to transfer the saved games from their existing carts to their backup device.
Anyway, you can find source and a compiled binary here: http://frodo.dyn.gno.org/~brettk/savsender
It's pretty raw, but I've tested it with a few type-2 and type-3 carts, and it seems to work. I've tested with the following games:
Super Mario 64 DS
Brain Age
Mario and Luigi - Partners in Time
Tetris DS
Mario Kart DS
Of course, I haven't had a chance to play all those games to verify the EEPROM contents transfered correctly, but an initial check seemed to indicate it all worked successfully.
Note, on the server side, you'll need something that will just listen on a given port and dump the received data to a file. I've used netcat via cygwin on a Windows box, but anything similar will work.
#127070 - dantheman - Sun Apr 29, 2007 8:40 pm
As far as I know, no one else has done something like this, so you are the first to use Wifi for save transfers.
However, I'm having trouble getting it to work. The main issue is that I'm really not sure how to use netcat. I have nc.exe available, so should I launch it with something like this?
Code: |
nc.exe -l -p 5000 > file.sav |
My config file consists of
Quote: |
192.168.1.123
5000 |
Where 192.168.1.123 is the IP of my computer, and my router has already been instructed to forward all traffic on port 5000 to that IP. It gets past connecting to the AP and reading the save file and resolving to the host, but it freezes up at "connecting to server", and after a minute it displays "Error!"
I have already allowed nc.exe to act as a server in my firewall config.
Is there something blatantly obvious that I'm doing wrong?
#127072 - Abcd1234 - Sun Apr 29, 2007 8:53 pm
Not that I can see... I assume the host and port are identified correctly in the application (just want to make sure there's no bug in the config file parsing)? If so, then I can only guess that it's an issue with your firewall rules, either on the receiving box itself (if you have the Windows firewall enabled, make sure it's configured to allow port 5000 inbound), or in the WiFi router.
Note, both the firewall and the router should have some useful logging available, so perhaps you can see if the connection attempts are being blocked somewhere.
#127075 - dantheman - Sun Apr 29, 2007 9:09 pm
Here's a picture of what I see on my DS, which seems to show that the IP and port are working correctly. http://img260.imageshack.us/img260/8306/sd530724vs4.jpg
I don't think it's my router, as I use the same port for DSHobro and it connects to the server application correctly. I've also used a homebrew wifiloader that used netcat to send the data to the DS over wifi, and it worked.
I'll look into the firewall thing.
#127091 - tepples - Sun Apr 29, 2007 11:33 pm
Abcd1234 wrote: |
I'm not sure if anyone else has done this (I looked around and could only find ->FAT dumpers), but I've written an EEPROM backup tool that, unlike existing solutions, dumps the contents via WiFi
[...]
Of course, I haven't had a chance to play all those games to verify the EEPROM contents transfered correctly |
You could always test the results against the same saves copied using REIN or Etool or Eepinator, using fc /b fromSavsender.wav fromREIN.sav. That's what I did when testing RAC.
_________________
Driven from Tilwick by ice storms, couldn't fit in in Flower Bud...
Nintendo DS: With two ARMs, who needs legs?
#127094 - Abcd1234 - Sun Apr 29, 2007 11:41 pm
Honestly, I have no idea what could be going wrong. The fact that it gets to connecting to the server implies that the host name resolved properly and the connection to the AP is correctly established. At that point, what's failing is the connect() call, and the only thing I can figure is an issue with connectivity from the DS to the desktop machine, or a bug in wifilib... unfortunately, I can rule out neither. :(
However, I have updated savsender as follows:
1. Slows down upload rate. Hopefully this reduces failures during transmission.
2. Fixes reading config files with DOS line endings.
3. Reports the resolved IP before calling connect().
That last modification might shed some light onto what's going on... though, I'm not confident.
#127095 - Abcd1234 - Sun Apr 29, 2007 11:44 pm
tepples wrote: |
You could always test the results against the same saves copied using REIN or Etool or Eepinator, using fc /b fromSavsender.wav fromREIN.sav. That's what I did when testing RAC. |
Don't those tools require some kind of slot-2 storage device? After all, the only reason I wrote this thing in the first place was because my extremely old Flash Advance slot-2 card seems to have a dead battery (the contents of the SRAM were zeroed after I ran Eepinator).
Of course, if someone else wanted to test savsender as you describe... :)
Last edited by Abcd1234 on Sun Apr 29, 2007 11:55 pm; edited 1 time in total
#127097 - dantheman - Sun Apr 29, 2007 11:52 pm
Something you did fixed it. It shows the following:
Quote: |
Resolving host...
Resolved to 192.168.1.123
Connecting to server
Sending EEPROM contents.................
.....................................................
... |
It freezes at the end (is there supposed to be a confirmation message?) but my test.sav file is 262,144 bytes long, so I'm assuming it worked. I'll test the validity of it versus REINmoon later on.
Thanks for the modifications. I know my config file had MS-DOS line endings, so I can't rule out exactly what the culprit was, but at least it works now.
#127098 - Abcd1234 - Mon Apr 30, 2007 12:04 am
dantheman wrote: |
Thanks for the modifications. I know my config file had MS-DOS line endings, so I can't rule out exactly what the culprit was, but at least it works now. |
Ahh, yeah, the line-endings may have been it, then (although it shouldn't have resolved the hostname, in that case...).
Anyway, yeah, it was finished dumping... it just didn't tell you. It's the little details, I tell ya. :) I've fixed that and updated the files on the website, so it now emits a "Done!" message.
#127108 - dantheman - Mon Apr 30, 2007 12:52 am
tepples wrote: |
You could always test the results against the same saves copied using REIN or Etool or Eepinator, using fc /b fromSavsender.wav fromREIN.sav. That's what I did when testing RAC. |
Tested with Mario Kart DS cartridge, 'test.sav' from SavSender and 'MKDS.sav' from REINMOON:
Quote: |
Comparing files test.sav and MKDS.SAV
FC: no differences encountered
|
Looks like it works correcty.
Awesome job abcd1234, thanks for the contribution. Any plans for a reverse one that writes save files back to the cart?
#127110 - Abcd1234 - Mon Apr 30, 2007 12:59 am
It wasn't on the top of my list (right now, I'm quite interested in writing a more DS-friendly interface to NethackDS), but it sounds like an interesting side-project...
#127120 - Dood77 - Mon Apr 30, 2007 3:54 am
Abcd1234 wrote: |
It wasn't on the top of my list (right now, I'm quite interested in writing a more DS-friendly interface to NethackDS), but it sounds like an interesting side-project... |
I'd be up for that! (and maybe some non-scaled tiles...)
#127314 - STAKED - Tue May 01, 2007 5:21 pm
Excellent little tool, nice work. I was looking for exactly this kind of thing for slot-1 just yesterday.
#127415 - josath - Wed May 02, 2007 9:05 am
If you can manage compiling libnds yourself, you might be interested in this:
http://h.davr.org/eeprom.patch
It adds proper support for more eeprom savetypes, both read & write. the code is taken from the last version of rein, and integrated with libnds coding styles.
one of these days wintermute will get around to accepting my patch, and put it in real libnds :)
#127427 - GizmoTheGreen - Wed May 02, 2007 11:46 am
could you alsop implement sending the sav file back to the cart?
then this would be a complete tool
_________________
Starter of the project TrueLoveDS :D
Will you find True Love?
#127555 - shadowofdarkness - Thu May 03, 2007 6:54 am
Awesome program, I have wanted something like this for along time. I tested it on my R4 by backing up my New Super Mario Brothers save from my official cart. Then padded it to 512K and tested it using a rom which worked great.
For anyone who might be trying this on Linux I used the following commands
netcat -l -p 3333 > test.sav #I randomly chose port 3333 when making the config file
dd if=/dev/zero of=test2.sav bs=448K count=1
cat test.sav test2.sav > final.sav
the dd command may need changed if your game has a save with a size other then 64K
Please make a version of this to put the saves back on the official carts.
#127759 - Abcd1234 - Fri May 04, 2007 4:50 pm
Whoops, I should've checked back here sooner... been too busy fiddling with Nethack. :)
Anyway, I'll take a look at save restoring over the weekend. It should be a trivial enough change.
I'll also look at incorporating that patch, Josath. Hopefully, in addition to more save types, it'll fix the type-3 reading bug I came across.
#128045 - Abcd1234 - Tue May 08, 2007 1:00 am
Thanks very much for the patch, Josath! It works like a charm. Much better than my hacks, and simplifies my code *greatly*.
I've posted a new savsender binary using the EEPROM patch. It should support more EEPROM types (4 and 8MB EEPROMs), as well as fixing that type 3 EEPROM reading bug.
#128582 - H8TR - Sun May 13, 2007 2:29 am
How do you get this to work. I keep getting errors. My comps IP is 192.168.0.100 (using command ipconfig) and put that in the config file with the part 9999.
#128587 - dantheman - Sun May 13, 2007 3:33 am
I'm not sure if I'm allowed to post a link to where I made a full guide (I'll ask the mods) but here's a quote of it:
Quote: |
Up until now, REINMOON and EEPINATOR have been the most widely used tools used to backup savegames from original DS cartridges. However, REINMOON requires a supported slot-2 device, and while EEPINATOR could theoretically be used on a slot-1 device through cart-swapping, this fails on most slot-1 devices. The R4 and M3 Simply do not reinitalize the FAT filesystem until the DS is power cycled, which means that the save file cannot be written to the filesystem, while the DS-Xtreme simply reboots the entire DS upon reinsertion.
However, this is now changing due to a new program that transfers the save file wirelessly to your computer. This program is called SavSender. Currently it only backs up original game saves and does not restore them.
The method proposed in this guide, which uses NetCat, is confirmed to work on Windows Vista.
What You Need
1. A homebrew device capable of DLDI (read-only is fine)
2. The actual SavSender program itself. Download the DS binary from http://frodo.dyn.gno.org/~brettk/savsender
3. Netcat - Netcat is a "Swiss Army Knife" utility for reading and writing data across a network. Originating on the UNIX operating system, it has been ported to Windows. Download it from http://www.vulnwatch.org/netcat/ and copy or move the nc.exe program to your working folder.
4. knowledge of the command-line and how to navigate through directories using the "cd" command.
5. A DS game cartridge
6. Your DS must already work with other wireless homebrew apps.
--See this GBAdev thread and this DS-X wiki article if you need help with this step
How to do it
1. Ensure that file extensions are visible by default. In Windows Explorer, go to Tools - Folder Options - "View" tab - uncheck "hide extensions for known filetyes"
2. Patch savsender.nds with the correct DLDI patch for your device and place it on your media card
3. On the root of your media card, create a "DATA" folder if not already present. In this folder, create a "SETTINGS" folder.
4. In this "SETTINGS" folder, create a new text document called "savsender.conf" and open it with Notepad.
5. press Start - Run - type "CMD" and hit Enter - type "IPCONFIG /all" and ht Enter
6. In the savsender.conf file, enter the IP address that ipconfig tells you, press Enter, and type the port number you wish to use. A sample config file may look like this:
Quote: | 192.168.1.123
5000 |
7. Open your router's settings page and find the section for Port Forwarding. Create a new setting that forwards all traffic on the designated port (in my example, 5000) to your computer's IP address (in my example, 192.168.1.123)
8. Open a command prompt and navigate to the location where nc.exe is. If you don't know how to do this, do the following:
--8.1. Put nc.exe on your desktop
--8.2. press Start - Run - type "cmd" and hit Enter
--8.3. type "cd desktop" and hit Enter
9. type the following command:
Code: | nc.exe -l -p 1234 > savefile.sav |
(note that that is a lowercase L, not a number one) where 1234 is the port number you specified in savsender.conf (in my example, 5000) and "savefile.sav" is the name of the file you wish to save as. If your firewall asks you to allow traffic by the program, accept it. Leave this window running even though it looks like it's doing nothing.
10. Put your microSD card in your slot-1 device and boot it up.
11. It will ask you to insert your game card and press A, so swap to the official DS cartridge and press A.
12. It will automatically detect the save file and send it over Wifi to your computer. Once it says "Done!" you may turn off your DS.
13. Go to the command prompt window that has netcat running and press CTRL+C to kill it if necessary before typing "exit" and hitting Enter.
Screenshots
[Images not permitted - Click here to view it] |
Last edited by dantheman on Sun May 13, 2007 8:51 pm; edited 1 time in total
#128608 - H8TR - Sun May 13, 2007 1:28 pm
#128614 - fli_guy84 - Sun May 13, 2007 2:23 pm
Hey thanks for this excellent homebrew! Finally I've been able to backup my AW:DS save (clocked at more than 150 hours!). Phew :)
Also, if any of you guys keep getting any errors, it must be that you entered the wrong IP address (like your router's IP address).
#128625 - shadowofdarkness - Sun May 13, 2007 4:25 pm
There is no need to setup port forwarding on the router. I have no idea why someone would put that in the instructions. Although it will not hurt the process in anyway, it just makes this software look more complicated.
#128627 - H8TR - Sun May 13, 2007 5:04 pm
WTF? I'm still getting error! Everything is set up properly. Then why do I keep getting error? If anyone can help me, my router is a D-Link DI-524.
#128635 - fli_guy84 - Sun May 13, 2007 5:52 pm
The way I made it work is like this:
First, make sure that your your DS can work properly with wifi homebrews like Beup or DSOrganize's IRC.
Second, know your computer's IP address (which is set by your wireless router). Put this in the config file. For example, my Linksys gave my computer 192.168.1.100 as the IP address.
Lastly, disable firewall in Windows and router. I don't know if you must do port forwarding, but I used my already forwarded port for WC3: TFT (6112) as the port #.
#128638 - H8TR - Sun May 13, 2007 7:00 pm
Still wont work. How do I know what port to use because that is the only thing I can think of left as a problem. Internet/IRC in DSO works.
It's always the same damn thing to. Connects to AP. I put in the game cart I'm using (Pokemon Pearl) and it read the save type (type 3 Flash 2Mbit) and reads the amount of data (256KB/262144bytes) then it says
Resolving host
Resolved to192.168.0.100
Connecting to server...
Error!
Heres a list of ports that my router forwards
[Images not permitted - Click here to view it]
#128641 - dantheman - Sun May 13, 2007 7:52 pm
I think the issue is that in the command to launch it you put "-1" instead of "-l" which is a lowercase L and tells netcat to listen for incoming data.
#128643 - H8TR - Sun May 13, 2007 7:56 pm
Thanks for that. I'll try it.
#128644 - H8TR - Sun May 13, 2007 7:58 pm
Dan, I think I could kiss you right now. Thanks you to everyone who helped me even though it was my mistake.
#128648 - fli_guy84 - Sun May 13, 2007 8:31 pm
Ah, so the typo is the only fault?
Glad that you got it sorted out :)
#128651 - dantheman - Sun May 13, 2007 8:51 pm
I've edited the post to make it a bit clearer.
#129358 - Abcd1234 - Tue May 22, 2007 3:32 am
Well, I've just released version 1.1 of savsender on my website. This version supports writing the EEPROM, in addition to the regular dumping functions. I've tested this with both MKDS, SM64, and Brain Age, and it seems to work properly.
In addition, I've fixed the config file parsing so it'll deal with whitespace at the start and end of config lines. This should make Mac users happy, as it will now handle any line-ending style, as well as extra spaces, etc.
Enjoy!
#129361 - dantheman - Tue May 22, 2007 3:51 am
Thanks for the update! Could you give us an example of how to use netcat with the new uploading functionality? I can still backup my save files fine, but the only game I'm willing to sacrifice the save file of is this game called Brain Boost Beta Wave (type 1, EEPROM 512 bytes), and I can't seem to get it to work correctly, so I don't want to test Mario Kart DS until I can verify that it works for another game.
I'm using the command
nc.exe -w 1 192.168.1.125 5000 < savefile.sav
Where 192.168.1.125 is the IP address of my DS and 5000 is the port specified in my config file. Am I using the wrong syntax? I see the following message:
Quote: |
Resolving host...
Resolved to 192.168.1.123
Connecting to server...
Error!
Reading data from server
Error during recv!
Done! |
I can dump the save file to my computer fine using "nc.exe -l -p 5000 > savefile.sav" so I'm guessing I'm using the wrong netcat command, since the connection appears to be good.
#129363 - Abcd1234 - Tue May 22, 2007 3:55 am
Ah, sorry, I should have made that clear. :) Use something like:
netcat -l -p 5000 < savfile.sav
Basically, flip the > to a <. That's it!
#129364 - dantheman - Tue May 22, 2007 4:02 am
Ah, that was much simpler than I expected. Thank you. It works fine for this Brain Boost game at least. Updating my guide now.
EDIT: guide updated - http://scdev.org/forum/viewtopic.php?t=9915
#129370 - shadowofdarkness - Tue May 22, 2007 4:31 am
Thanks, I just tested v1.1 and was able to restore my New Super Mario Bros save.
On funny thing happened thought. When I backed up the save with the original release of savsender it gave me a 64K file which was a over dump but I did not notice since I had to add extra padding to run it on my R4.
I found that out when I cut away the padding so it was 64K again and tried to restore it and lost what was on the cart. After re-dumping with v1.1 I found out the correct size was 8K so cut my original save even further and got it to work.
Moral of the story if anyone got a over dump with the old version the backups are not junk they can be fixed.
Also a suggestion for other new people to this program you should add instructions to put in the original game cart right before it prompts for dump or restore.
#129372 - Abcd1234 - Tue May 22, 2007 5:00 am
Yeah, the original version was built against an older version of the libnds EEPROM code, and also performed it's own EEPROM type detection. It suffices to say this code was broken. :) The result was overdumps, no support for 512K EEPROMs, etc. The latest builds incorporate much better EEPROM read/write code, which corrects these problems.
As for the directions, I'm just linking to dantheman's tutorial, now. He's done a good job of capturing the directions (including your suggestion), so why duplicate the effort? Translation: I'm very lazy.
#129377 - dantheman - Tue May 22, 2007 5:41 am
I added a note in the tutorial regarding the restoration of 1.0 dumps using 1.1 and how to fix that problem. And with that, I'm off to bed.
#132102 - dantheman - Sat Jun 23, 2007 2:08 pm
On another forum, a user had this to say:
Quote: |
Hi,
I just want to inform you that I've wrote a savsender client for XP called savreceiver.
To turn it in English, edit savsender.ini and replace Fran?ais by English.
It download automaitaclly the save file from savsender and make a file compatible with any linker (actually M3Simply/R4 and DSLink but others will be added in few days)
Actual version is 0.1b.
You could found it and ask me about it on my HQ french forum Gueux
I hope you will enjoy it. |
I thought you might find it interesting.
#132848 - Bungoo - Sat Jun 30, 2007 5:49 am
Hi, I'm really new to this program of savesender. I was wnering if anyone can help me with working this program. I have read the tutorials on the forums, but its still not working. I do not know what to do after I have successfully dumped a save. After it says "sending eeprom data...done", what do I do from there? Do I access the "savefile.sav" and place it into my flashcart? Please help?
#132852 - FifthE1ement - Sat Jun 30, 2007 9:21 am
Here is the new link to the guide:
http://www.scdev.info/forum/index.php?topic=9915.0
And yes copy the sav format onto your memory. Depending on what type of device you have you might need to convert it first though.
I hope that helps,
FifthE1ement
_________________
Moddz Network: News | Homebrew Database |Developer Blogs | Wiki | Downloads
#132869 - Bungoo - Sat Jun 30, 2007 8:17 pm
I have the DS-Xtreme. I don't know how to convert. I went to the save converter site, but I dont know what to put as my source format. I know I put the target format as "ds-x 4 gb", but what do i do from there??
#132875 - tepples - Sat Jun 30, 2007 9:28 pm
Most of the save/restore programs that work with authentic DS Game Cards can handle the raw format. What did you plan on doing with the converted file?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#132883 - Bungoo - Sun Jul 01, 2007 12:59 am
I plan on using the savefile from the original gamecart, then transfer onto my ds-x so I can resume my file on my new flashcard. I tried puttng in the raw file that savsender created, but my ds-x still wont recognize any saved file when I boot it up
#132886 - tepples - Sun Jul 01, 2007 1:51 am
Bungoo wrote: |
I plan on using the savefile from the original gamecart, then transfer onto my ds-x so I can resume my file on my new flashcard. |
Per forum policy, we're not supposed to help you play copied games. Backing up save files is for rental games, save editors, and nondestructive game world experimentation, not for use with copied games.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.