Lego dimensions toy pad emulator

Обновлено: 04.05.2024

Joined Jan 4, 2007 Messages 625 Trophies 0 XP 2,370 Country

Lego Dimensions ToyPad Emulator in stead of D.I.R.E. project solution.

Disclaimer: This is not my project. All credit go to the creators.
Everything below is my opinion and experience.

Lego Dimensions however also uses the toys as part of the experience. During the game you need the move the characters around and the toypad lights up in three colors.
The D.I.R.E. project solution with a tiny screen and buttons to activate characters and vehicles just seems to fiddly.

This uses a Raspeberry Pi and a webbrowser to emulate the toypad. On a tablet, laptop or big phone instantiating a toy is just a pulldown, pick character and a drag-drop action. Moving a character on the toypad is also a drag-and-drop action.
You can imagine that this works much better and for this solution you do not even need to solder anything.

Setting up the raspberry pi is a bit of a hassle and if interested I could add the steps I made to make everything work.

Kfkboys

Member

Joined Jun 27, 2020 Messages 15 Trophies 0 XP 239 Country

Lego Dimensions ToyPad Emulator in stead of D.I.R.E. project solution.

Disclaimer: This is not my project. All credit go to the creators.
Everything below is my opinion and experience.

Lego Dimensions however also uses the toys as part of the experience. During the game you need the move the characters around and the toypad lights up in three colors.
The D.I.R.E. project solution with a tiny screen and buttons to activate characters and vehicles just seems to fiddly.

This uses a Raspeberry Pi and a webbrowser to emulate the toypad. On a tablet, laptop or big phone instantiating a toy is just a pulldown, pick character and a drag-drop action. Moving a character on the toypad is also a drag-and-drop action.
You can imagine that this works much better and for this solution you do not even need to solder anything.

Setting up the raspberry pi is a bit of a hassle and if interested I could add the steps I made to make everything work.

I've never seen this one before
I really really like the way this works.
I too have found the interface on the LD part of Project D.I.R.E. a bit tedious for normal use.

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Toy Pad Emulator for Lego Dimensions

Allows you to connect an emulated Toy Pad to your PC or video-game console.

  • Confirmed working on Cemu, real Wii U, RPCS3, real PS3, real PS4 and real PS5
  • Supports all available characters and vehicles
  • Saves vehicle upgrades
  • Displays the Toy Pad's light effects
  • Supports smart scrolling for mobile devices
  • Can be run in a virtual machine on Windows, macOS and Linux
  • No copyrighted game files are required, nor are any included
  • Can be configured easily by following the instructions below

There are two options. Please choose the installation method that suits your needs best.

Option 1: Virtual Machine (only for emulators)

  • Either VMware Player (free), VMware Workstation Pro (paid) or Oracle VirtualBox (free) (newer versions not tested) for Windows, Linux or MacOS

Make a new virtual machine with Debian in your software of choice. Select your ISO file and choose the appropriate operating system (Linux -> 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 or VMware).

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.

After rebooting, log in with your password. Then click the menu on the upper left corner, search for "Terminal" and open it.

Run the following commands (you can copy and paste with right click):

Reboot you device with this command:

Log in again and run the following commands in the terminal:

Start the virtual machine if it's not already running. Then start the VirtualHere USB Client and double click on LEGO READER V2.10 .

Run the emulator server with this command if you are in the correct folder (otherwise run cd LD-ToyPad-Emulator first):

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.

Finally, start your console emulator and the game itself (e.g. Cemu).

Option 2: Single Board Computer

  • Raspberry Pi Zero W ($10) or similar single board computer with Network support
    • NOTE: Will NOT work with Rapsberry Pi: 2, 3, 3A, 3A+, 3B, 3B+. These models lack the ability to become a usb gadget.

    If you're using a Raspberry Pi Zero W, flash Raspberry Pi OS Lite to your SD card using the Raspberry Pi Imager tool and follow this as well as this instruction for headless installation.

    Connect your device to your PC via USB cable (don't use the port on the edge of the Pi Zero!).

    Use SSH to run the following commands (Don't know the IP address? Try this IP scanner.):

    Reboot you device with this command:

    Connect via SSH again and run the following commands:

    Run the emulator server with this command if you are in the correct folder (otherwise run cd LD-ToyPad-Emulator first):

    Type your single board computer's IP address in a browser to use the emulator.

    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.

    To update this software, just pull the latest changes by running the following 3 commands:

    Only use the following command if you get an error, then run the last two lines from above again:

    RPCS3 cannot detect the Toy Pad

    This solution works only for RPCS3 and will break the Toy Pad detection with every other emulator!

    Download and run Zadig.

    Click 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.

    After 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.

    To undo the changes from Zadig, you have to rollback the driver:

    1. Open Device Manager , scroll down to USB devices and expand the section.
    2. Double-click LEGO READER V2.10 .
    3. Switch to the Driver tab, click Previous Driver , select the first option and click yes.

    Webpage not reachable (Oracle VirtualBox)

    Shutdown 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.

    Webpage not reachable (VMware)

    Shutdown 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.

    Error: listen EADDRINUSE: address already in use . 80

    Either 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 ).

    VirtualHere USB Client doesn't show LEGO READER V2.10

    When installing the virtual machine, you have to set the hostname to debian .

    Alternatively, 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.

    If you're using a virtual machine, make sure you've applied the solution specific to your software first (VirtualBox or VMware)!

    After 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.

    cort1237 for implementing writing to toy tags as well as several UI updates and support for saving toy tags locally. He has made the emulator more user-friendly.

    This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

    • Open with Desktop
    • View raw
    • Copy raw contents Copy raw contents

    Copy raw contents

    Copy raw contents

    Toy Pad Emulator for Lego Dimensions

    Allows you to connect an emulated Toy Pad to your PC or video-game console.

    • Confirmed working on Cemu, real Wii U, RPCS3, real PS3, real PS4 and real PS5
    • Supports all available characters and vehicles
    • Saves vehicle upgrades
    • Displays the Toy Pad's light effects
    • Supports smart scrolling for mobile devices
    • Can be run in a virtual machine on Windows, macOS and Linux
    • No copyrighted game files are required, nor are any included
    • Can be configured easily by following the instructions below

    There are two options. Please choose the installation method that suits your needs best.

    Option 1: Virtual Machine (only for emulators)

    • Either VMware Player (free), VMware Workstation Pro (paid) or Oracle VirtualBox (free) (newer versions not tested) for Windows, Linux or MacOS

    Make a new virtual machine with Debian in your software of choice. Select your ISO file and choose the appropriate operating system (Linux -> 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 or VMware).

    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.

    After rebooting, log in with your password. Then click the menu on the upper left corner, search for "Terminal" and open it.

    Run the following commands (you can copy and paste with right click):

    Reboot you device with this command:

    Log in again and run the following commands in the terminal:

    Start the virtual machine if it's not already running. Then start the VirtualHere USB Client and double click on LEGO READER V2.10 .

    Run the emulator server with this command if you are in the correct folder (otherwise run cd LD-ToyPad-Emulator first):

    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.

    Finally, start your console emulator and the game itself (e.g. Cemu).

    Option 2: Single Board Computer

    • Raspberry Pi Zero W ($10) or similar single board computer with Network support
      • NOTE: Will NOT work with Rapsberry Pi: 2, 3, 3A, 3A+, 3B, 3B+. These models lack the ability to become a usb gadget.

      If you're using a Raspberry Pi Zero W, flash Raspberry Pi OS Lite to your SD card using the Raspberry Pi Imager tool and follow this as well as this instruction for headless installation.

      Connect your device to your PC via USB cable (don't use the port on the edge of the Pi Zero!).

      Use SSH to run the following commands (Don't know the IP address? Try this IP scanner.):

      Reboot you device with this command:

      Connect via SSH again and run the following commands:

      Run the emulator server with this command if you are in the correct folder (otherwise run cd LD-ToyPad-Emulator first):

      Type your single board computer's IP address in a browser to use the emulator.

      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.

      To update this software, just pull the latest changes by running the following 3 commands:

      Only use the following command if you get an error, then run the last two lines from above again:

      RPCS3 cannot detect the Toy Pad

      This solution works only for RPCS3 and will break the Toy Pad detection with every other emulator!

      Download and run Zadig.

      Click 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.

      After 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.

      To undo the changes from Zadig, you have to rollback the driver:

      1. Open Device Manager , scroll down to USB devices and expand the section.
      2. Double-click LEGO READER V2.10 .
      3. Switch to the Driver tab, click Previous Driver , select the first option and click yes.

      Webpage not reachable (Oracle VirtualBox)

      Shutdown 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.

      Webpage not reachable (VMware)

      Shutdown 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.

      Error: listen EADDRINUSE: address already in use . 80

      Either 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 ).

      VirtualHere USB Client doesn't show LEGO READER V2.10

      When installing the virtual machine, you have to set the hostname to debian .

      Alternatively, 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.

      If you're using a virtual machine, make sure you've applied the solution specific to your software first (VirtualBox or VMware)!

      After 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.

      cort1237 for implementing writing to toy tags as well as several UI updates and support for saving toy tags locally. He has made the emulator more user-friendly.

      This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

      • Open with Desktop
      • View raw
      • Copy raw contents Copy raw contents

      Copy raw contents

      Copy raw contents

      The LEGO Dimensions game makes use of NFC technology to allow some interaction between physical LEGO creations (characters, vehicles and gadgets) and the videogame.

      The LEGO Toy Pad is in fact just a custom USB triple NFC reader that can read NFC tags (not only the LEGO Toy Tags but also several other tags including those used in other games like Disney Infinity) and change the color of the RGB light associated to each reader.

      Since the beginning of 2015 several people have been reverse engineering the LEGO Toy Pad. This tutorial is strongly based on @woodenphone work available at GitHub.

      • a proper LEGO Dimensions Toy Pad
      • a Mindstorms EV3
      • an available USB port
      • python and pysub
      • udev rule

      Several people reported a difference between PS3/PS4/Wii devices and Xbox so this tutorial most probably will not work with the Xbox type.

      You don't really need a Mindstorms EV3 as this tutorial can be used on almost any recent linux system (like my Ubuntu laptop or my Raspberry Pi). If using ev3dev, just be sure to use a recent version - this tutorial was tested with kernel 4.4.15-13-ev3dev-ev3 .

      Of course, you need an available USB port so if you're already using the Mindstorms EV3 with an USB Wi-Fi dongle you will also need an USB Hub.

      After you connect the LEGO Toy Pad it should be recognized as an HID device:

      You can also check with lsusb:

      You also need python and pyusb. Most Linux distributions already include python as default so you probably only need to install the pyusb library with:

      To allow python script to access USB without running with root privileges we need to add an udev rule:

      with the following rule inside:

      then unplug and replug the LEGO Toy Pad again.

      The following script will check for the presence of a LEGO Toy Pad and initializes it, turning the middle (round) pad red for one second:

      import usb.core import usb.util from time import sleep

      TOYPAD_INIT = [0x55, 0x0f, 0xb0, 0x01, 0x28, 0x63, 0x29, 0x20, 0x4c, 0x45, 0x47, 0x4f, 0x20, 0x32, 0x30, 0x31, 0x34, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]

      PAD1_RED = [0x55, 0x0e, 0xc8, 0x06, 0x01, 0xff, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]

      PADS_OFF = [0x55, 0x06, 0xc0, 0x02, 0x00, 0x00, 0x00, 0x00, 29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]

      def init_usb(): global dev

      def main(): init_usb() dev.write(1,PAD1_RED) sleep(1) dev.write(1,PADS_OFF) return

      If everything was OK the output should be:

      and of course the center pad should stay red for one second.

      Changing pad colors

      In the above script we've seen that all commands sent to the LEGO Toy Pad have the same size: 32 bytes.

      The first bytes define the command, some other bytes the arguments and the remaining bytes are just to assure proper communication (checksum).

      I'll show just how to change the color of each pad but there are some other commands available (switch on/off, fade, flash. ). You can see these commands in @woodenphone's lego_dimensions_gateway.py script.

      import usb.core import usb.util from time import sleep

      TOYPAD_INIT = [0x55, 0x0f, 0xb0, 0x01, 0x28, 0x63, 0x29, 0x20, 0x4c, 0x45, 0x47, 0x4f, 0x20, 0x32, 0x30, 0x31, 0x34, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]

      OFF = [0,0,0] RED = [255,0,0] GREEN = [0,255,0] BLUE = [0,0,255]

      ALL_PADS = 0 CENTER_PAD = 1 LEFT_PAD = 2 RIGHT_PAD = 3

      def init_usb(): global dev

      def switch_pad(pad, colour): send_command(dev,[0x55, 0x06, 0xc0, 0x02, pad, colour[0], colour[1], colour[2],]) return

      def main(): init_usb() switch_pad(ALL_PADS,RED) sleep(1) switch_pad(ALL_PADS,GREEN) sleep(1) switch_pad(ALL_PADS,BLUE) sleep(1) switch_pad(ALL_PADS,OFF) return

      if name == 'main': main()

      Whenever a tag is inserted or removed the LEGO Toy Pad sends a 32-byte message starting with 0x56. The message also contains:

      • the number of the pad affected
      • the UID of the tag inserted or removed
      • the action itself (tag was inserted or removed)

      So if we already know the UID of a tag we can track it with the LEGO Toy Pad (I use my Android phone to read my tags but we can also use the LEGO Toy Pad). For the next script we'll track Darth Vader from Disney Infinity 3.0 (a Mifare Classic Mini tag) but we can track several types of NFC tags - LEGO Toy Tags are Mifare Ultralight C (also known as NTAG213) and Nintendo amiibo are also Mifare Ultralight (but not C, so NTAG215).

      The script also tracks unknown UIDs. So:

      • if it recognizes Darth Vader, it turns the corresponding pad RED;
      • if it doesn't recognize the tag, it turns the pad GREEN;
      • whenever a tag is removed it turns the pad OFF:

      import usb.core import usb.util from time import sleep

      TOYPAD_INIT = [0x55, 0x0f, 0xb0, 0x01, 0x28, 0x63, 0x29, 0x20, 0x4c, 0x45, 0x47, 0x4f, 0x20, 0x32, 0x30, 0x31, 0x34, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]

      OFF = [0,0,0] RED = [255,0,0] GREEN = [0,255,0] BLUE = [0,0,255]

      ALL_PADS = 0 CENTER_PAD = 1 LEFT_PAD = 2 RIGHT_PAD = 3

      TAG_INSERTED = 0 TAG_REMOVED = 1

      UIDs can be retrieved with Android App (most probably in hexadecimal)

      def init_usb(): global dev

      def switch_pad(pad, colour): send_command(dev,[0x55, 0x06, 0xc0, 0x02, pad, colour[0], colour[1], colour[2],]) return

      def uid_compare(uid1, uid2): match = True for i in range(0,7): if (uid1[i] != uid2[i]) : match = False return match

      def main(): init_usb() if dev != None : while True: try: in_packet = dev.read(0x81, 32, timeout = 10) bytelist = list(in_packet)

      👇 Here are 6 public repositories matching this topic.

      Berny23 / LD-ToyPad-Emulator

      lego-dimensions-pad,Toy Pad Emulator for Lego Dimensions

      meltaxa / musicfig

      lego-dimensions-pad,A Raspberry Pi jukebox that uses LEGO Dimensions and Minifigures to play Spotify or MP3 tracks.

      VincentXE / Lego-Dimensions-Pad-Scripts

      lego-dimensions-pad,Scripts to interact with your Lego Dimensions pad

      dolmen-go / legodim

      lego-dimensions-pad,LEGO Dimensions Toy Pad interaction with Go

      MaxHasADHD / LD-ToyPad-iOS

      lego-dimensions-pad,iOS toy pad client for Lego Dimensions

      Recommend Projects

      React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

      Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

      Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

      TensorFlow

      An Open Source Machine Learning Framework for Everyone

      Django

      The Web framework for perfectionists with deadlines.

      Laravel

      A PHP framework for web artisans

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

      Recommend Topics

      javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

      Some thing interesting about web. New door for the world.

      server

      A server is a program made to process requests and deliver data to clients.

      Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

      Visualization

      Some thing interesting about visualization, use data art

      Some thing interesting about game, make everyone happy.

      Recommend Org

      Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

      Читайте также: