In some dark corner of the house, I found an old LeapPad2 that hadn't been used for years. Before sending it to Goodwill, I wanted to wipe any data off of it, but before I could get to that, I found a number of old photos on the it. The OEM software (LeapFrog Connect) would download some of them, but not all of them. Do we have any other options for saving these crude, blurry, sentimental photos and videos?!
I am not an expert in USB devices, nor embedded Linux, nor even Linux. This worked for me, and I'm writing it up in case it works for someone else, but if you try it and run into a problem, there is functionally no chance that I will be able to help you. Please proceed at your own caution.
The steps below involve putting your LeapPad2 into "developer" mode. If you are unable to complete these steps, this may make the device impossible to use. (This was not the case for me, but I repeat the warning out of an abundance of caution.) Again, proceed at your own caution.
This was all done in early 2019, with a LeapPad2 Explorer and a Raspberry Pi 3 B+ running Raspbian Stretch 9.6. If your software or hardware are different than that, proceed at your own caution.
Some searching turned up a number of resources, none of which were able to help me completely. Rather, I was able to piece together portions of each of them to get the job done. These are some of the resources that kept me moving forward:
https://blog.katharsys.com/?p=4091
https://github.com/jrspruitt/OpenLFConnect
https://spiffyhacks.com/thread-215.html
https://elinux.org/LeapPad2_Explorer
I had hoped to be able to just noodle around with exotic block device formats, mount the device like a USB drive and copy the files directly, but ... no dice. Something about UBI formats on embedded Linux devices with USB mode switching. In the end, I was able to put the device into developer mode, which boots it with a USB networking interface and an FTP server, and I was able to use this to download the files I wanted.
-
Power on your LeapPad,
sshto your pi and plug in your LeapPad to one of it's USB ports. Confirm it's recognized by running theusb-devicescommand, which should print an entry for the LeapPad. (Look for "Vendor: LeapFrog" or something similar.) -
Clone the OpenLFConnect repo:
git clone https://github.com/jrspruitt/OpenLFConnect.git -
cd OpenLFConnect -
make sure SCSI generic utils are installed:
sudo apt install sg3-utils(OpenLFConnect requires access to thesg_rawcommand.) -
OpenLFConnect has not been maintained for ~5 years as I write this. In that time, some of the device management rules have changed for Linux, and the
/dev/leapfrogdevice will not be automatically created for you. So... create it manually:sudo ln -s /dev/sda /dev/leapfrog(My LeapPad connected as/dev/sda, check the output ofusb-devicesorlsusbto see where yours in parked.) -
Ditto for making sure that the normal user can access the device:
sudo chmod 666 /dev/sda(optional, you can also just run the followingOpenLFConnect.pycommands as root) -
Start OpenLFConnect:
./OpenLFConnect.py -
OK, now quit:
exit(It will have created some default files for you.) -
touch files/developer(We'll use this later, in step 15.) -
OK, back in:
./OpenLFConnect.py -
Load the LeapPad2 configuration:
device_profile_load Extras/Profiles/leappad2.cfgand while you're at it, make it the default for next time you start:device_profile_default -
Now connect to the device:
dftp_connect- after a short pause your prompt should change toremote>. If it doesn't something went wrong. If you see "File not found" or "No such file or directory" or such, make sure thatsg_rawis installed (see step 4) -
At this point, you can poke around the device with
ls. I found all of the data that I wanted was stored in/LF/Bulk/Data/Local/All/Photosand.../Videos. OpenLFConnect also includes a command todownloadfiles, but I found that it wouldn't work. It would act like it was working, but it would fail or hang or just produce corrupt output. -
cd /flags -
OK, the point of no return: instruct the device to reboot into developer mode:
upload developer -
Confirm the file was uploaded:
ls- you should see several files, including one called "developer" -
Disconnect:
dftp_disconnect -
Now unplug the LeapPad, power it down (press the power button) and then turn it back on (press the power button again).
-
While it's starting, install an old school ftp client:
sudo apt install ftp(optional if you already have an ftp client installed. Note the sftp, ftps, etc will not work, and also that you have to ftp to the LeapPad from the device that it's plugged into, not from another device (eg the laptop you're ssh'ing from)) -
OK, now try
usb-devicesagain. You should see that something has changed: instead of connecting as ausb-storagedevice, it will have connected as a networking device. (You'll see something aboutethin the Driver section.) -
List your network interfaces:
ifconfig- you should see aneth0and aneth1entry (and possibly others). For me,eth0was the built in interface on the Pi, andeth1was new and exciting. You should see that it's bound to a192.168.x.xaddress. -
OK, heres another point of no return: in developer mode, the LeapPad will bind to a static IP of
192.168.0.111. In order to connect to the LeapPad, I had to reconfigureeth1to bind to the192.168.0.xsubnet. (The terminology may be wrong here.) If you're already using192.168.0.xviaeth0or wifi (wlan0), then PROCEED WITH CAUTION. I was fortunate and my wifi is on a subnet of192.168.254.x, so I was able to seteth1to192.168.0.1without issue. If you're already using192.168.0.x, be careful and make sure you know what you're doing, lest you lose access to your Pi or other devices.Anyway, assuming you're comfortable with it:
sudo ifconfig eth1 192.168.0.1 -
Now FTP like it's '93:
ftp 192.168.0.111(username:root(yeah!), password: <none, blank, nada> (hell yeah!)) -
If all goes well, you should be in. Now you can
lsandcdaround. I was able tocd /LF/Bulk/Data/Local/All/Photosand thenls, thengeteach of the files viaget lf_photo_000000.jpg. (Remember, old schoolftpdoesn't support wildcards. If you have a lot of files, you may want to find another client. I only had ~40, so it didn't seem worth it.) -
Done? Don't forget
../Videosor art or sound files. -
Double check your files. You have downloaded them from the LeapPad to the Pi, so you'll have to now get them to your regular computer. I used
scp pi@pi:OpenLFConnect/\*.jpg .from my laptop but you can do whatever you normally do to copy files from your Pi. Double check that they all look good and that you can view them all. -
OK, now done? Great. Still in
ftp, you will need to remove the "developer" mode file we uploaded previously. Start withcd /flagsthendelete developer. If that doesn't work, you can tryrm developer. For some reason, these didn't work for me, so I just renamed the file:rename developer foo -
Done! Now:
exit -
Now unplug the USB cord and power cycle the LeapPad again.
-
Double check that it's not in developer mode: plug it back in and use
usb-devicesto confirm that it's using theusb-storagedriver again. -
OK, now finally done for real! Connect the LeapPad back to your computer and use the OEM LeapFrog Connect software to reset the device to factory settings before sending it off into the hands of some other deserving family.
Just wanted to say thank you so much for writing this whole guide up. I was able to get very old candid photos of my family and my grandfather. It means the world to me!
Just some things to note, some issues I ran into while doing this (also on a LeapPad2 Explorer). When I initially ran the script I was getting an error:
Of course, if you read the documentation for OpenLFConnect, this is because it requires installing Python 2. As I was using Debian 12 Bookworm on a Raspberry Pi 5, Python 2 is not longer available. As such I had to compile Python 2.7 on-device like so:
Despite doing step 6, I ran into a weird error when trying to run
dftp_connect:After digging in and debugging the code, I realized that it all came down to
/dev/leapfrog(i.e./dev/sda) requiring elevated privileges to access so no data was coming through. Runningsudo python2.7 OpenLFConnect.pycompletely fixed it. Doh!When I finally got to step 15 and ran the command
upload developer, it returned with an error, something along the lines of'bytes' was referenced before assignment. Initially I thought this made it so that it was not booting into developer mode, because although the ethernet interface appeared, no IP was assigned and I could not connect to it. I eventually came across someone online saying that if you go into parent mode (with the device on and not connected by USB, hold volume up and home buttons at the same time) you should see "debug" and "cheats" in the list (which I did see, so that indicated it was in developer mode).My
ifconfig eth1looked like this:No IPv4 assigned as you can see. Pinging 192.168.0.111 returned:
And my routing table (
route -n) looked like:To fix this, I ran:
sudo ifconfig eth1 192.168.0.1 netmask 255.255.255.0This resulted it changing to:
As you can see, I could now ping the device. From this point I was able to resume at step 23 and onwards without issue.
Also, I found a way to pull all the files (had a lot of images). Use the following when in
ftpenvironment:Just
cdinto the folders, soPhotos,Videos, andArtfor me, turn off prompts (yes/no), and run mget with a wildcard to pull them all.Thanks again Clayton for all your work on this!