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,
ssh
to your pi and plug in your LeapPad to one of it's USB ports. Confirm it's recognized by running theusb-devices
command, 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_raw
command.) -
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/leapfrog
device 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-devices
orlsusb
to 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.py
commands 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.cfg
and 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_raw
is 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/Photos
and.../Videos
. OpenLFConnect also includes a command todownload
files, 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-devices
again. You should see that something has changed: instead of connecting as ausb-storage
device, it will have connected as a networking device. (You'll see something abouteth
in the Driver section.) -
List your network interfaces:
ifconfig
- you should see aneth0
and aneth1
entry (and possibly others). For me,eth0
was the built in interface on the Pi, andeth1
was new and exciting. You should see that it's bound to a192.168.x.x
address. -
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 reconfigureeth1
to bind to the192.168.0.x
subnet. (The terminology may be wrong here.) If you're already using192.168.0.x
viaeth0
or 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 seteth1
to192.168.0.1
without 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
ls
andcd
around. I was able tocd /LF/Bulk/Data/Local/All/Photos
and thenls
, thenget
each of the files viaget lf_photo_000000.jpg
. (Remember, old schoolftp
doesn'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
../Videos
or 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 /flags
thendelete 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-devices
to confirm that it's using theusb-storage
driver 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.