{"id":17383006,"url":"https://github.com/berny23/ld-toypad-emulator","last_synced_at":"2025-04-05T18:06:50.939Z","repository":{"id":42984669,"uuid":"392134255","full_name":"Berny23/LD-ToyPad-Emulator","owner":"Berny23","description":"Toy Pad Emulator for Lego Dimensions (Unofficial Fan Project)","archived":false,"fork":false,"pushed_at":"2024-08-10T23:48:12.000Z","size":260,"stargazers_count":284,"open_issues_count":69,"forks_count":48,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-05T18:06:43.906Z","etag":null,"topics":["emulation","emulator","html","javascript","lego-dimensions-pad","lego-games","linux","nodejs","peripherals","raspberry-pi","server","shell-script","single-board-computers","single-page-app","single-page-applications","toypad","unofficial","usb","usb-gadget","webapp"],"latest_commit_sha":null,"homepage":"https://github.com/Berny23/LD-ToyPad-Emulator","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Berny23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-03T00:24:08.000Z","updated_at":"2025-04-05T08:54:52.000Z","dependencies_parsed_at":"2024-06-23T14:44:45.347Z","dependency_job_id":"ce2aea78-ea52-48a1-a286-0611c73fa78c","html_url":"https://github.com/Berny23/LD-ToyPad-Emulator","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berny23%2FLD-ToyPad-Emulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berny23%2FLD-ToyPad-Emulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berny23%2FLD-ToyPad-Emulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Berny23%2FLD-ToyPad-Emulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Berny23","download_url":"https://codeload.github.com/Berny23/LD-ToyPad-Emulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378141,"owners_count":20929296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emulation","emulator","html","javascript","lego-dimensions-pad","lego-games","linux","nodejs","peripherals","raspberry-pi","server","shell-script","single-board-computers","single-page-app","single-page-applications","toypad","unofficial","usb","usb-gadget","webapp"],"created_at":"2024-10-16T07:40:13.386Z","updated_at":"2025-04-05T18:06:50.922Z","avatar_url":"https://github.com/Berny23.png","language":"HTML","funding_links":["https://www.buymeacoffee.com/Berny23"],"categories":[],"sub_categories":[],"readme":"# Toy Pad Emulator for Lego Dimensions\n\n\u003ca href=\"https://www.buymeacoffee.com/Berny23\" title=\"Donate to this project using Buy Me A Coffee\"\u003e\u003cimg src=\"https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg\" alt=\"Buy Me A Coffee donate button\" /\u003e\u003c/a\u003e\n\u003c/span\u003e\n\nAllows you to connect an emulated Toy Pad to your PC or video-game console.\n\n## Features\n\n- Confirmed working on **[Cemu](https://www.youtube.com/watch?v=7CBa9u2ip-Y)**, **real Wii U**, [**RPCS3**](#rpcs3-cannot-detect-the-toy-pad), [**real PS3**](https://github.com/Berny23/LD-ToyPad-Emulator/issues/10#issuecomment-933027554), [**real PS4**](https://www.reddit.com/r/Legodimensions/comments/pb32zg/comment/hamfj29/?utm_source=share\u0026utm_medium=web2x\u0026context=3) and [**real PS5**](https://github.com/Berny23/LD-ToyPad-Emulator/issues/45)\n- Supports **all available characters and vehicles**\n- Saves **vehicle upgrades**\n- Displays the Toy Pad's **light effects**\n- Supports smart scrolling for **mobile devices**\n- Can be run in a **virtual machine** on Windows, macOS and Linux\n- **No copyrighted game files are required**, nor are any included\n- Can be configured easily by following the instructions below\n\n## Demo\n\n![image](https://user-images.githubusercontent.com/36038743/151242123-8dee84e5-6276-4ac2-ba58-c09bff121419.png)\n\n## Videos\n\n- First demo video on Cemu emulator: https://www.youtube.com/watch?v=7CBa9u2ip-Y\n\n- Installation tutorial on a virtual machine: https://www.youtube.com/watch?v=5PARAnrt1jU\n\n- Quick usage showcase on RPCS3: https://www.youtube.com/watch?v=KIKDO0dxYl4\n\n## Installation\n\n**There are two options.** Please choose the installation method that suits your needs best.\n\n\u003chr\u003e\n\n### Option 1: Virtual Machine (only for emulators)\n\n#### Prerequisites\n\n* Either [VMware Player](https://www.vmware.com/products/workstation-player.html) (free), [VMware Workstation Pro](https://www.vmware.com/products/workstation-pro.html) (paid) or [Oracle VirtualBox](https://www.virtualbox.org/wiki/Downloads) (free)\n* [Debian 11.1 ISO](https://cdimage.debian.org/mirror/cdimage/archive/11.1.0/amd64/iso-cd/debian-11.1.0-amd64-netinst.iso) (newer versions not tested)\n* [VirtualHere USB Client](https://www.virtualhere.com/usb_client_software) for Windows, Linux or MacOS\n\n#### Guide\n\n1. Make a new virtual machine with Debian in your software of choice. Select your ISO file and choose the appropriate operating system (Linux -\u003e Debian 11.x 64-bit) if you're asked. **To make sure your VM is accessible on the network, please follow the instructions in the troubleshooting section on this page (either for [VirtualBox](#webpage-not-reachable-oracle-virtualbox) or [VMware](#webpage-not-reachable-vmware)).**\n\n2. When first booting the Debian VM, select `Graphical install`. In the configuration, leave everything on default. Only change your language, set `debian` as hostname, don't set a root password, choose an account name and password, set partition to \"yes\" and `/dev/sda` for the GRUB bootloader.\n\n3. After rebooting, log in with your password. Then click the menu on the upper left corner, search for \"Terminal\" and open it.\n\n4. Run the following commands (you can copy and paste with right click):\n   ```bash\n   sudo apt update\n   sudo apt install -y git usbip hwdata curl python build-essential libusb-1.0-0-dev libudev-dev\n   echo \"usbip-core\" | sudo tee -a /etc/modules\n   echo \"usbip-vudc\" | sudo tee -a /etc/modules\n   echo \"vhci-hcd\" | sudo tee -a /etc/modules\n   \n   echo \"dtoverlay=dwc2\" | sudo tee -a /boot/config.txt\n   echo \"dwc2\" | sudo tee -a /etc/modules\n   echo \"libcomposite\" | sudo tee -a /etc/modules\n   echo \"usb_f_rndis\" | sudo tee -a /etc/modules\n   \n   git config pull.rebase false\n   git clone https://github.com/Berny23/LD-ToyPad-Emulator.git\n   cd LD-ToyPad-Emulator\n   \n   printf '\\necho \"usbip-vudc.0\" \u003e UDC\\nusbipd -D --device\\nsleep 2;\\nusbip attach -r debian -b usbip-vudc.0\\nchmod a+rw /dev/hidg0' \u003e\u003e usb_setup_script.sh\n   sudo curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh\n   \n   sudo cp usb_setup_script.sh /usr/local/bin/toypad_usb_setup.sh\n   sudo chmod +x /usr/local/bin/toypad_usb_setup.sh\n   (sudo crontab -l 2\u003e/dev/null; echo \"@reboot sudo /usr/local/bin/toypad_usb_setup.sh\") | sudo crontab -\n   ```\n\n5. Reboot you device with this command:\n   ```bash\n   sudo shutdown -r now\n   ```\n\n6. Log in again and run the following commands in the terminal:\n   ```bash\n   curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash\n   export NVM_DIR=\"$HOME/.nvm\"\n   [ -s \"$NVM_DIR/nvm.sh\" ] \u0026\u0026 \\. \"$NVM_DIR/nvm.sh\"\n   [ -s \"$NVM_DIR/bash_completion\" ] \u0026\u0026 \\. \"$NVM_DIR/bash_completion\"\n   \n   nvm install 11\n   sudo setcap cap_net_bind_service=+ep `readlink -f \\`which node\\``\n   npm install --global node-gyp@8.4.1\n   npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js\n   \n   cd LD-ToyPad-Emulator\n   npm install\n   ```\n\n#### Usage\n\n1. Start the virtual machine if it's not already running. Then start the **VirtualHere USB Client** and double click on `LEGO READER V2.10`.\n\n2. Run the emulator server with this command if you are in the correct folder (otherwise run `cd    LD-ToyPad-Emulator` first):\n   ```bash\n   node index.js\n   ```\n\n3. Type `http://debian` in a browser to use the emulator.\n\n   If you want to turn it off, just press `Ctrl + C` in the terminal, then use the command `sudo shutdown now` to power off the virtual machine or just pause it from the host.\n   \n4. Finally, start your console emulator and the game itself (e.g. Cemu).\n\n#\n\n\u003chr\u003e\n\n### Option 2: Single Board Computer\n\n#### Prerequisites\n* **Raspberry Pi Zero W** ($10) or **Raspberry Pi 4 B** (with `USB/Power Splitter for Raspberry Pi` from Ali or `USB-C/PWR Splitter` from pishop.us) or similar single board computer with Network support\n  * **NOTE**: Will NOT work with Rapsberry Pi: 2, 3, 3A, 3A+, 3B, 3B+. These models lack the ability to become a usb gadget.\n* **USB Type-A to micro-USB 2.0 Type-B cable** that supports data transmission (e. g. your phone's charging cable)\n* 2 GB+ Micro SD card\n* Internet connection on your PC and single board computer\n\n#### Guide\n\n1. If you're using a Raspberry Pi Zero W, flash Raspberry Pi OS Lite to your SD card using [the Raspberry Pi Imager tool](https://www.raspberrypi.org/software/) and follow [this](https://www.raspberrypi.org/documentation/configuration/wireless/headless.md) as well as [this](https://www.raspberrypi.org/documentation/remote-access/ssh/README.md) instruction for headless installation.\n\n2. Connect your device to your PC via USB cable (don't use the port on the edge of the Pi Zero!).\n\n4. Use SSH to run the following commands (Don't know the IP address? Try [this IP scanner](https://www.advanced-ip-scanner.com/).):\n   ```bash\n   sudo apt update\n   sudo apt install -y git libusb-1.0-0-dev libudev-dev\n   [[ -f /boot/firmware/config.txt ]] \u0026\u0026 ( echo \"dtoverlay=dwc2\" | sudo tee -a /boot/firmware/config.txt ) || ( echo \"dtoverlay=dwc2\" | sudo tee -a /boot/config.txt )\n   echo \"dwc2\" | sudo tee -a /etc/modules\n   echo \"libcomposite\" | sudo tee -a /etc/modules\n   echo \"usb_f_rndis\" | sudo tee -a /etc/modules\n   \n   git config pull.rebase false\n   git clone https://github.com/Berny23/LD-ToyPad-Emulator.git\n   cd LD-ToyPad-Emulator\n   \n   printf '\\necho \"$UDC\" \u003e UDC\\nsleep 2;\\nchmod a+rw /dev/hidg0' \u003e\u003e usb_setup_script.sh\n   \n   sudo cp usb_setup_script.sh /usr/local/bin/toypad_usb_setup.sh\n   sudo chmod +x /usr/local/bin/toypad_usb_setup.sh\n   (sudo crontab -l 2\u003e/dev/null; echo \"@reboot sudo /usr/local/bin/toypad_usb_setup.sh\") | sudo crontab -\n   ```\n   \n5. Reboot you device with this command:\n   ```bash\n   sudo shutdown -r now\n   ```\n   \n6. Connect via SSH again and run the following commands:\n   ```bash\n   curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash\n   export NVM_DIR=\"$HOME/.nvm\"\n   [ -s \"$NVM_DIR/nvm.sh\" ] \u0026\u0026 \\. \"$NVM_DIR/nvm.sh\"\n   [ -s \"$NVM_DIR/bash_completion\" ] \u0026\u0026 \\. \"$NVM_DIR/bash_completion\"\n   \n   nvm install 11\n   sudo setcap cap_net_bind_service=+ep `readlink -f \\`which node\\``\n   npm install --global node-gyp@8.4.1\n   npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js\n   \n   cd LD-ToyPad-Emulator\n   npm install\n   ```\n\n#### Usage\n1. Run the emulator server with this command if you are in the correct folder (otherwise run `cd    LD-ToyPad-Emulator` first):\n   ```bash\n   node index.js\n   ```\n\n2. Type **your single board computer's IP address** in a browser to use the emulator.\n\n   If you want to turn it off, just press `Ctrl + C` in the cmd window, then use the command `sudo shutdown now` to safely power off the device.\n\n## Update\nTo update this software, just get the latest changes by running the following commands while inside the `LD-ToyPad-Emulator` folder:\n````bash\ngit fetch\ngit checkout origin/HEAD \u0026\u0026 git checkout origin/HEAD package-lock.json\nnpm install\n````\n\n## Adding Images\nIf you would like your tags to have custom images over them to personalize your experience, name your image (ID).png and place them in server/images inside the Toypad Emulator folder. If you want them to cover the entirety of the tag with no blank space, make sure your image is either 100x100 or can be scaled to that size. \n\nCharacter IDs can be found [here](https://github.com/Berny23/LD-ToyPad-Emulator/blob/master/server/json/charactermap.json)\n\nVehicle IDs can be found [here](https://github.com/Berny23/LD-ToyPad-Emulator/blob/master/server/json/tokenmap.json)\n\n## Troubleshooting\n\n### RPCS3 cannot detect the Toy Pad\n**This solution works only for RPCS3 and will break the Toy Pad detection with every other emulator!**\n\nDownload and run [Zadig](https://zadig.akeo.ie).\n\nClick on `Options` and tick `List All Devices`. Select `LEGO READER V2.10` in the dropdown menu, then select `WinUSB` if it's not already selected, click on the `Replace Driver` button and on `Yes` in the dialog.\n\nAfter the installation has finished, exit Zadig and restart RPCS3. If you get stuck on the main menu, just close the game, right-click on it in the RPCS3 games list, select `Change Custom Configuration`, switch to the `Network` tab and choose `Disconnected` in both drop-down menus. The game will now correctly detect the Toy Pad.\n\nTo undo the changes from Zadig, you have to rollback the driver:\n1. Open `Device Manager`, scroll down to `USB devices` and expand the section.\n2. Double-click `LEGO READER V2.10`.\n3. Switch to the `Driver` tab, click `Previous Driver`, select the first option and click yes.\n\n**Solution for Linux systems**\n\nIn order to fix this, you will need to add a custom udev rule in your system, so the software can comunicate with the game. The udev rule is in the root of the server folder. (thanks to wof for sharing the rule).\n\nTo add the rule, simply just move the `99-dimensions.rules` file to `/etc/udev/rules.d/` (a reboot might be required)\n\nIf moving the file is not allowed, just open a terminal inside the `rules.d` folder and run this command: `sudo nano 99-dimensions.rule`, open the rule file in the server root in a text editor, copy the contents and paste it in the terminal then press Ctrl + X to save the file.\n\n### Webpage not reachable (Oracle VirtualBox)\nShutdown your virtual machine (icon in the upper right corner). In VirtualBox's manager, click your image and open `Settings`. Under `Network` change `Attached to:` to `Bridged Adapter` and click `ok`. Start your virtual machine.\n\n### Webpage not reachable (VMware)\nShutdown your virtual machine (icon in the upper right corner). Right-click on your virtual machine's name in VMware Workstation or VMware Player and click `Settings...`. Click on `Network Adapter` and select `Bridged`. Click `OK` and start your virtual machine.\n\n### Error: listen EADDRINUSE: address already in use :::80\nEither close any other software that is using the port 80 or manually edit the last line of index.js (with `nano index.js`, edit the line, then press `Ctrl + O`, `Enter` and `Ctrl + X`).\n\nIf you did this, you may need to append your selected port to the address in the browser (like `http://debian:500` or `http://192.168.0.165:500` if your port is 500).\n\n### VirtualHere USB Client doesn't show LEGO READER V2.10\nWhen installing the virtual machine, you have to set the hostname to `debian`.\n\nAlternatively, copy the following command and replace `YOUR_IP_ADDRESS` with your virtual machine's IP address (it looks like `192.168.X.X`, run `hostname -I` to show it). After you've done this, run the modified command while you're inside the `LD-ToyPad-Emulator` folder.\n````bash\ngit reset --hard ; printf '\\necho \"usbip-vudc.0\" \u003e UDC\\nusbipd -D --device\\nsleep 2;\\nusbip attach -r YOUR_IP_ADDRESS -b usbip-vudc.0\\nchmod a+rw /dev/hidg0' \u003e\u003e usb_setup_script.sh ; sudo cp usb_setup_script.sh /usr/local/bin/toypad_usb_setup.sh\n````\n\n### VirtualHere shows LEGO READER V2.10, but fails with \"Operation not permitted\"\nWhen double clicking on \"LEGO READER V2.10\", if it returns `Error \"Operation not permitted\" (-1) trying to use this device.`. Try these steps:\n\n1. Right click the device in the VirtualHere Client and select \"Custom Event Handler...\"\n2. Add `onReset.$VENDOR_ID$.$PRODUCT_ID$=` \n\nThen try using the device again. \n\n### Webpage not reachable under http://debian/\nIf you're using a virtual machine, make sure you've applied the solution specific to your software first ([VirtualBox](#webpage-not-reachable-oracle-virtualbox) or [VMware](#webpage-not-reachable-vmware))!\n\nAfter that, run the command `hostname -I` in your virtual machine (or on your single board computer) and type the IP address that looks like `192.168.X.X` in your webbrowser.\n\n## Acknowledgements\n* **ags131** for writing one of the main NodeJS libraries I'm using: [https://www.npmjs.com/package/node-ld](https://www.npmjs.com/package/node-ld). My project would've been impossible to create without this guy's research.\n\n* **cort1237** for implementing writing data (like vehicle upgrades) to toy tags, as well as several user interface updates and support for saving toy tags locally.\n\n* **benlucaslaws** for improving the user experience and implementing a complete filtering system for vehicle/character abilities and game worlds.\n\n* **DaPiMan** for helping with missing or misplaced vehicle IDs and other improvements.\n\n* **Luigimeansme** for adding/fixing character and vehicle abilities and other data improvements.\n\n* **VladimirKuletski** for creating/updating CI workflows for automated testing via GitHub Actions.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberny23%2Fld-toypad-emulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberny23%2Fld-toypad-emulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberny23%2Fld-toypad-emulator/lists"}