Giter VIP home page Giter VIP logo

ld-toypad-emulator's Introduction

Toy Pad Emulator for Lego Dimensions

Buy Me A Coffee donate button

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

Features

  • 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

Demo

image

Videos

Installation

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


Option 1: Virtual Machine (only for emulators)

Prerequisites

Guide

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

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

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

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

    sudo apt update
    sudo apt install -y git usbip hwdata curl python build-essential libusb-1.0-0-dev libudev-dev
    echo "usbip-core" | sudo tee -a /etc/modules
    echo "usbip-vudc" | sudo tee -a /etc/modules
    echo "vhci-hcd" | sudo tee -a /etc/modules
    
    echo "dtoverlay=dwc2" | sudo tee -a /boot/config.txt
    echo "dwc2" | sudo tee -a /etc/modules
    echo "libcomposite" | sudo tee -a /etc/modules
    echo "usb_f_rndis" | sudo tee -a /etc/modules
    
    git config pull.rebase false
    git clone https://github.com/Berny23/LD-ToyPad-Emulator.git
    cd LD-ToyPad-Emulator
    
    printf '\necho "usbip-vudc.0" > UDC\nusbipd -D --device\nsleep 2;\nusbip attach -r debian -b usbip-vudc.0\nchmod a+rw /dev/hidg0' >> usb_setup_script.sh
    sudo curl https://raw.githubusercontent.com/virtualhere/script/main/install_server | sudo sh
    
    sudo cp usb_setup_script.sh /usr/local/bin/toypad_usb_setup.sh
    sudo chmod +x /usr/local/bin/toypad_usb_setup.sh
    (sudo crontab -l 2>/dev/null; echo "@reboot sudo /usr/local/bin/toypad_usb_setup.sh") | sudo crontab -
  5. Reboot you device with this command:

    sudo shutdown -r now
  6. Log in again and run the following commands in the terminal:

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
    [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
    
    nvm install 11
    sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``
    npm install --global [email protected]
    npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js
    
    cd LD-ToyPad-Emulator
    npm install

Usage

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

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

    node index.js
  3. Type http://debian in a browser to use the emulator.

    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.

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


Option 2: Single Board Computer

Prerequisites

  • 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.
  • USB Type-A to micro-USB 2.0 Type-B cable that supports data transmission (e. g. your phone's charging cable)
  • 2 GB+ Micro SD card
  • Internet connection on your PC and single board computer

Guide

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

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

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

    sudo apt update
    sudo apt install -y git libusb-1.0-0-dev libudev-dev
    echo "dtoverlay=dwc2" | sudo tee -a /boot/config.txt
    echo "dwc2" | sudo tee -a /etc/modules
    echo "libcomposite" | sudo tee -a /etc/modules
    echo "usb_f_rndis" | sudo tee -a /etc/modules
    
    git config pull.rebase false
    git clone https://github.com/Berny23/LD-ToyPad-Emulator.git
    cd LD-ToyPad-Emulator
    
    printf '\necho "$UDC" > UDC\nsleep 2;\nchmod a+rw /dev/hidg0' >> usb_setup_script.sh
    
    sudo cp usb_setup_script.sh /usr/local/bin/toypad_usb_setup.sh
    sudo chmod +x /usr/local/bin/toypad_usb_setup.sh
    (sudo crontab -l 2>/dev/null; echo "@reboot sudo /usr/local/bin/toypad_usb_setup.sh") | sudo crontab -
  4. Reboot you device with this command:

    sudo shutdown -r now
  5. Connect via SSH again and run the following commands:

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
    [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
    
    nvm install 11
    sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``
    npm install --global [email protected]
    npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js
    
    cd LD-ToyPad-Emulator
    npm install

Usage

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

    node index.js
  2. 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.

Update

To update this software, just get the latest changes by running the following commands while inside the LD-ToyPad-Emulator folder:

git fetch
git checkout origin/HEAD && git checkout origin/HEAD package-lock.json
npm install

Troubleshooting

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

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

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.

git reset --hard ; printf '\necho "usbip-vudc.0" > UDC\nusbipd -D --device\nsleep 2;\nusbip attach -r YOUR_IP_ADDRESS -b usbip-vudc.0\nchmod a+rw /dev/hidg0' >> usb_setup_script.sh ; sudo cp usb_setup_script.sh /usr/local/bin/toypad_usb_setup.sh

VirtualHere shows LEGO READER V2.10, but fails with "Operation not permitted"

When double clicking on "LEGO READER V2.10", if it returns Error "Operation not permitted" (-1) trying to use this device.. Try these steps:

  1. Right click the device in the VirtualHere Client and select "Custom Event Handler..."
  2. Add onReset.$VENDOR_ID$.$PRODUCT_ID$=

Then try using the device again.

Webpage not reachable under http://debian/

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.

Acknowledgements

  • ags131 for writing one of the main NodeJS libraries I'm using: https://www.npmjs.com/package/node-ld. My project would've been impossible to create without this guy's research.

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

  • benlucaslaws for improving the user experience and implementing a complete filtering system for vehicle/character abilities and game worlds.

  • DaPiMan for helping with missing or misplaced vehicle IDs and other improvements.

  • Luigimeansme for adding/fixing character and vehicle abilities and other data improvements.

  • VladimirKuletski for creating/updating CI workflows for automated testing via GitHub Actions.

License

MIT

ld-toypad-emulator's People

Contributors

amitzohar42 avatar benlucaslaws avatar berny23 avatar cort1237 avatar dapiman avatar dependabot[bot] avatar dverzolla avatar iristallite avatar l3ennji avatar luigimeansme avatar pablo5425 avatar vladimirkuletski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ld-toypad-emulator's Issues

game is freezing

idk if this should go here but whenever i get to the cutscene after beating the 1st level it freezes.
help?

Syntax Error - How to fix?

I was just playing LEGO Dimensions via CEMU and was using Benny, but when I took him off the ToyPad directly to the delete tab, all my toy tags disappeared and I got this error:

undefined:137
]25": 4026531839
^

SyntaxError: Unexpected number in JSON at position 3159
at JSON.parse ()
at initalizeToyTagsJSON (/home/sonicprimus/LD-ToyPad-Emulator/index.js:140:25)
at Object. (/home/sonicprimus/LD-ToyPad-Emulator/index.js:27:1)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
at internal/main/run_main_module.js:21:11

I have since tried to reconnect to the Emulator but get this same error. Is there a way to fix this?

i did everything and even started the emulator on my ip address but doesn't connect to cemu or LD

so i just completed your tutorial and got to
node index.js
and it made me a ip address on the web with the emulator
now when i start lego dimensions i get the "Please Connect the ToyPad to the Console"
message i even placed Batman for example on the emulator and got this:

pi@raspberrypi:~ $ node LD-ToyPad-Emulator/
Server running on port 80
Placing character: 1
Character placed: 1
(node:1959) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
EVENT: Event { pad: '2', index: 1, dir: 0, uid: '04A31DD42B4980' }
events.js:170
throw er; // Unhandled 'error' event
^

Error: ESHUTDOWN: cannot send after transport endpoint shutdown, write
Emitted 'error' event at:
at errorOrDestroy (internal/streams/destroy.js:107:12)
at onwriteError (_stream_writable.js:436:5)
at onwrite (_stream_writable.js:461:5)
at fs.write (internal/fs/streams.js:307:14)
at FSReqCallback.wrapper [as oncomplete] (fs.js:525:5)

Suggestion: Custom ToyBox order

I think adding in an ability to rearrange the Toybox layout as you choose and save it so it doesn't reset whenever you reload the page or rewrite a vehicle tag could help a lot for finding who you want at any given time

dlc problem

whenever i try to go into the sonic adventure world (with sonic duh) it says i need to buy it from the ps store and i have also used the pkg file and it still doesnt work. fix?

Raspberry Pi B3 -bash: cd: LD-ToyPad-Emulator: No such file or directory

I'm probably just missing something, but when I run cd LD-ToyPad-Emulator it returns -bash: cd: LD-ToyPad-Emulator: No such file or directory When continuing on and trying npm install, I get:

npmWARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'

npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'

npm WARN pi No description

npm WARN pi No repository field.

npm WARN pi No README data

npm WARN pi No license f

I'm probably doing something wrong, but it seems to be a great program, and I would love to try and perhaps recommend it.

Add labels to Ecto-1's

I know they don't do it in-game, but adding 2016 label to at least the new Ecto-1 would make it way easier to tell them apart when there's no images

Can't find files

pi@raspberrypi:~ $ sudo cp usb_setup_script.sh /usr/local/bin/toypad_usb_setup.sh
cp: cannot stat 'usb_setup_script.sh': No such file or directory
pi@raspberrypi:~ $ sudo chmod +x /usr/local/bin/toypad_usb_setup.sh
chmod: cannot access '/usr/local/bin/toypad_usb_setup.sh': No such file or directory

This is what pops up when trying to do step 3, don't have any knowledge into code so if you can tell me why it's doing this it would be a big help!

The lego told me to connect to toypad

Help me i follow all the tutorial + emulated toypad Lego dimension...after i emulated the lgo saya "Please Connect Toypad to the console" i don't know what that mean and i already connect LEGO READER in Virtual Box,help me to connect it

Confirm it works great on ps3

We were about to mothball our ps3 when we found this project. Got it running on a pi 4B and hooked to our old first generation ps3.

Suggestion: Rename tokens feature or edit Gollum's name

This is INCREDIBLY minor, but I've been getting bothered by how Gollum's name on his tag goes past the boundaries of the tag. I'm suggesting either a feature to let you rename tags how you please, or changing his name so that it's on two layers rather than one, or just call him Gollum since that's what the game refers to him as. If this isn't a big enough issue to mess with, don't worry. I just wanted to post it and see what happens

Thoughts after a 100% run

I just recently finished my 100% run on PS5 using this emulator, and I figured I'd give some thoughts of what could still use some changes:

  • Pick up and drop action. For example, someone being on the middle pad when activating Shift and they need to go to the yellow. Adding in a way to do this would make it much simpler rather than having to move the character to the left or right panel, then back to the middle to trigger the right movement
  • Move the delete button to the bottom right rather than the top right. The new smart scrolling system immediately starts to scroll down when you move a character, making it hard to drag something to the delete section on the top right.
  • Add in a way to alter and save the toybox list so you can organize characters and vehicles how you please

Other than those three, this emulator is glorious to use, and is very cost effective for those who want to experience the game without spending hundreds on sets on Ebay or Bricklink! Very good work so far, and I hope to see it grow even more!

Stuck on Step #4

image
When I paste in the code found in step 4 nothing happens. Unsure of what the issue is as I feel I've done all the previous steps correctly. This is my first time using a VM so help would be appreciated!

Suggestion: Add character and vehicle image toggle

One feature that would make navigation easier is adding in a toggle between the current blue and green tiles with just the name and tiles with images on them instead. It's a lot easier to find what you're looking for based on visual design rather than reading the names.

Can't get console to read emulator

I finally got my Pi in and was futzing around with it for a few hours, finally managing to get the emulator installed. Going to the IP address in my browser shows the emulator just fine, but I can't get either of my consoles (PS5 or Wii U) to read the emulator when I plug it in. What can I do to fix this?

Suggestion: Double click for re-drop

One thing I'm noticing with this emulator is that you can't trigger an action for a panel your character's already on unless you move them to another panel and then back to the original one. For example, a character being on the yellow center when you activate the Shift Keystone and having to move to the left or right side then back to the center in order to trigger the yellow portal. Adding in a double click function to trigger a quick pull off-put back on motion would be quite nice.

Error: ENOENT: no such file or directory, open '/dev/hidg0'

image
F:\LD-ToyPad-Emulator>node index.js
node:internal/fs/utils:344
throw err;
^

Error: ENOENT: no such file or directory, open '/dev/hidg0'
at Object.openSync (node:fs:585:3)
at new RawTransport (F:\LD-ToyPad-Emulator\node_modules\node-ld\dist\transports\raw.js:11:27)
at new ToyPadEmu (F:\LD-ToyPad-Emulator\node_modules\node-ld\dist\lib\ToyPadEmu.js:65:69)
at Object. (F:\LD-ToyPad-Emulator\index.js:24:10)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: '/dev/hidg0'
}

Using a phone

is there any way to use toypad on phone (with virtual machine)? Maybe even an application for the phone. Or use from another computer/laptop.

i cant install npm

every time i try running npm install it just gets stuck on this message or something similar

[ ................] \ fetchMetadata: sill pacote range manifest for object-inspect@^1.9.0 fetched in 250ms

Unable to scroll down while dragging

I've noticed that while dragging a square at the top of the page, it will start to scroll up but it doesn't do the same when dragging a square at the bottom of the page. With the ToyPad being at the bottom of the page, I'd like to know if I'm doing anything wrong or if this is a known issue that is in the works

does the real toypad and emulated both work at the same time?

i want to combine the fun of the both and i really am looking into this maybe we could figure it out together?
i know it sounds weird at first but just take a second and think about it, let's say you want to play extremely for fun (like me) when u use all of your minifigures but YOU ARE MISSING THE DAMN character that no-one has it anymore so the only thing is? EmUlAtOr
so if you combine these 2 IT WILL BE DOUBLE FUN!!!

node index.js wont work

I got this error
Error: Cannot find module 'node-ld'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15)
at Function.Module._load (internal/modules/cjs/loader.js:591:27)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/home/phoenix215/LD-ToyPad-Emulator/index.js:8:12)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
Can you help?

Arduino Support?

Is there any chance this could be done with an Arduino Leonardo?

Note for installation: Incompatible node-gyp version

I thought it'd be worth mentioning this in case someone else runs into a similar problem.

When attempting to install the emulator on my Pi Zero, I received the following error:

> @serialport/[email protected] install /home/pi/LD-ToyPad-Emulator/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=11.15.0 runtime=node arch=arm libc= platform=linux)
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                       ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack 
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:299:12)
gyp ERR! stack     at ChildProcess.emit (events.js:193:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:999:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:403:11)
gyp ERR! stack     at Socket.emit (events.js:193:13)
gyp ERR! stack     at Pipe._handle.close (net.js:614:12)
gyp ERR! System Linux 5.10.63+
gyp ERR! command "/home/pi/.nvm/versions/node/v11.15.0/bin/node" "/home/pi/.nvm/versions/node/v11.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/LD-ToyPad-Emulator/node_modules/@serialport/bindings
gyp ERR! node -v v11.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/[email protected] install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @serialport/[email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-11-14T00_24_01_387Z-debug.log

I was able to determine that it had to do with npm using node-gyp v3.8.0. As per the README of this repo, the installation guide describes installing node 11. Which comes shipped with node-gyp v3.8.0 as default. I attempted to install a newer version of node-gyp, but npm still was using the old version when I ran it again. I was able to resolve it after following the instructions from this node-gyp issue, which describes modifying which version of node-gyp that npm uses. The rest of the installation worked fine following this change.

Please connect the Toy Pad to the console.

issue
No matter what I try, I cant seem to get cemu to recognize the toy pad. Ive made sure to connect the emulator first, Im using Firefox on Windows. Ive even done the RPCS3 compatibility thing. Now what? any help would be appreciated

Pi Zero installation erroring

I'm performing a fresh install on a Pi Zero and getting some errors which isn't allowing me to run ToyPad.
I've used the new Raspberry Pi Imager to flash OS lite x64 and also using the advanced options to set up headerless install.

Stepping through the code line by line, everything seems fine until Step 5 and running 'npm install'. When I run this I get the following in the SSH log:

alex@raspberrypi:~/LD-ToyPad-Emulator $ npm install

[email protected] install /home/alex/LD-ToyPad-Emulator/node_modules/node-hid
prebuild-install --runtime napi || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=3 runtime=napi arch=arm64 libc= platform=linux)
Package libusb-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing libusb-1.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libusb-1.0' found gyp: Call to 'pkg-config libusb-1.0 --cflags-only-I | sed s/-I//g' returned exit status 0 while in binding.gyp. whi le trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/home/alex/.nvm/versions/node/v11.15.0/lib/node_modules/node-gyp/lib/c onfigure.js:259:16)
gyp ERR! stack at ChildProcess.emit (events.js:193:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:255:12)
gyp ERR! System Linux 5.15.32-v8+
gyp ERR! command "/home/alex/.nvm/versions/node/v11.15.0/bin/node" "/home/alex/.nvm/versions/node/v11.15.0/lib/node _modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/alex/LD-ToyPad-Emulator/node_modules/node-hid
gyp ERR! node -v v11.15.0
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yo urself.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencie s yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: prebuild-install --runtime napi || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/alex/.npm/_logs/2022-08-06T11_13_55_847Z-debug.log

If I then try and run ToyBox I just get the following:

alex@raspberrypi:~/LD-ToyPad-Emulator $ node index.js
internal/modules/cjs/loader.js:670
throw err;
^

Error: Cannot find module 'node-ld'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15)
at Function.Module._load (internal/modules/cjs/loader.js:591:27)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/home/alex/LD-ToyPad-Emulator/index.js:8:12)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)

Any ideas on what could be happening? The npm log suggests there are dependencies missing, could this be the case?

Trouble installing on Pi 400 - WARN install No prebuilt binaries found

I'm trying to install this on a Raspberry Pi 400 (which is capable of USB gadget mode), but am having trouble on the last install step.

After trying 'npm install'

> @serialport/[email protected] install /home/pi/LD-ToyPad-Emulator/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=11.15.0 runtime=node arch=arm libc= platform=linux)
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                       ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:299:12)
gyp ERR! stack     at ChildProcess.emit (events.js:193:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:999:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5)
gyp ERR! System Linux 5.10.63-v7l+
gyp ERR! command "/home/pi/.nvm/versions/node/v11.15.0/bin/node" "/home/pi/.nvm/versions/node/v11.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/LD-ToyPad-Emulator/node_modules/@serialport/bindings
gyp ERR! node -v v11.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/[email protected] install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/[email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-11-20T05_51_58_466Z-debug.log

I'm assuming this means I need to compile my own build, but don't know what I need to do (I'm not a dev, just a geek with some passing familiarity with Linux). Can anyone point me towards what I need to do?

Search By Ability

Hi there, just wanted to say first off great job on this project. I've got a Pi Zero W on it's way right now so I can give this a shot, but I had an idea for a new update to this while I'm waiting; a search bar where you can just type in an ability (for example, Boomerang), and get a list of all characters and/or vehicles & gadgets that have it. If at all possible to implement, that could be a really good way to just grab a character you need at a specific point without having to fully memorize what abilities everyone has

"Connect ToyPad" message when loading on Cemu

So I've been trying to make this work for the past few days however, after following all the steps exactly, whenever I launch the game, Cemu doesn't recognises the toypad:

  • I load everything before opening the emulator and game
  • I had initially tried to use it on RPCS3 and the toypad worked there however the game itself was a bit laggy so I moved over to Cemu and now the toypad doesn't work
  • I've tried redownloading the files for the game multiple times so it's not that

Does anyone have an idea as to what the problem could be, like a setting or something I need to enable in Cemu?
(Incase, it's important, I'm using VMware for the virtual machine)

Suggestion: Portal of Power/Infinity Base emulation

Would it be possible to make a version of this that works for Skylanders portal or Disney Infinity portal as well?
I know RPCS3 already has Skylanders figure emulator included but only Giants is really playable on it while the other games are listed as "Perfect" on Cemu, plus having Skylanders support on Cemu means you can use the Bowser and DK figures. (Also RPCS3 figure emulation can't do Imaginator creation).
Additionally this is probably a long shot but it could lead to proper emulation of the 3DS Skylanders and Disney Infinity games.

Can't use Toy Pad emulator despite following all the steps provided.

I seem to have a problem with using this emulator with LD on either CEMU and RPCS3 on Linux. Maybe it's an issue with no proper udev rules provided to properly communicate with the device, much like how proper udev rules for dualshock 3/4 controllers are needed for rpcs3 to utilize said controllers. If you have a solution that is not what I mentioned, please reply as soon as you are able to. Thanks.

help i get an error on one of the commands

when i do nvm install 11
sudo setcap cap_net_bind_service=+ep readlink -f \which node``
npm install --global node-gyp@latest
npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js

cd LD-ToyPad-Emulator
npm install
it gives me an error

Way to disable light emulation?

Is there a way to disable this emulator's function of emulating the lights on the toypad? It seems to cause problems with repeated keystone usage where if you use keystones too much and the colors keep changing, it bugs out and makes it so every time you switch the character you're moving around on the toypad, you have to drag them to the toybox then back to the toypad to get them to respond.

Linux keeps throwing a Error: not found make

prebuild-install info begin Prebuild-install version 6.1.4

prebuild-install info looking for local prebuild @ prebuilds/usb-v2.0.0-alpha.2-napi-v4-linux-x64.tar.gz

prebuild-install info looking for cached prebuild @ /home/jackv/.npm/_prebuilds/743a58-usb-v2.0.0-alpha.2-napi-v4-linux-x64.tar.gz

prebuild-install http request GET https://github.com/tessel/node-usb/releases/download/v2.0.0-alpha.2/usb-v2.0.0-alpha.2-napi-v4-linux-x64.tar.gz

prebuild-install http 200 https://github.com/tessel/node-usb/releases/download/v2.0.0-alpha.2/usb-v2.0.0-alpha.2-napi-v4-linux-x64.tar.gz

prebuild-install info downloading to @ /home/jackv/.npm/_prebuilds/743a58-usb-v2.0.0-alpha.2-napi-v4-linux-x64.tar.gz.2667-48b09e2e07253.tmp

prebuild-install info renaming to @ /home/jackv/.npm/_prebuilds/743a58-usb-v2.0.0-alpha.2-napi-v4-linux-x64.tar.gz

prebuild-install info unpacking @ /home/jackv/.npm/_prebuilds/743a58-usb-v2.0.0-alpha.2-napi-v4-linux-x64.tar.gz

prebuild-install info unpack resolved to /home/jackv/LD-ToyPad-Emulator/node_modules/usb/build/Release/usb_bindings.node

prebuild-install info install Successfully installed prebuilt binary!



> @serialport/[email protected] install /home/jackv/LD-ToyPad-Emulator/node_modules/@serialport/bindings

> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild



prebuild-install WARN install No prebuilt binaries found (target=11.15.0 runtime=node arch=x64 libc= platform=linux)

gyp ERR! build error 

gyp ERR! stack Error: not found: make

gyp ERR! stack     at getNotFoundError (/home/jackv/.nvm/versions/node/v11.15.0/lib/node_modules/node-gyp/node_modules/which/which.js:10:17)

gyp ERR! stack     at Promise (/home/jackv/.nvm/versions/node/v11.15.0/lib/node_modules/node-gyp/node_modules/which/which.js:57:18)

gyp ERR! stack     at new Promise (<anonymous>)

gyp ERR! stack     at step (/home/jackv/.nvm/versions/node/v11.15.0/lib/node_modules/node-gyp/node_modules/which/which.js:54:21)

gyp ERR! stack     at Promise (/home/jackv/.nvm/versions/node/v11.15.0/lib/node_modules/node-gyp/node_modules/which/which.js:71:22)

gyp ERR! stack     at new Promise (<anonymous>)

gyp ERR! stack     at subStep (/home/jackv/.nvm/versions/node/v11.15.0/lib/node_modules/node-gyp/node_modules/which/which.js:69:33)

gyp ERR! stack     at isexe (/home/jackv/.nvm/versions/node/v11.15.0/lib/node_modules/node-gyp/node_modules/which/which.js:80:22)

gyp ERR! stack     at /home/jackv/.nvm/versions/node/v11.15.0/lib/node_modules/node-gyp/node_modules/isexe/index.js:42:5

gyp ERR! stack     at /home/jackv/.nvm/versions/node/v11.15.0/lib/node_modules/node-gyp/node_modules/isexe/mode.js:8:5

gyp ERR! System Linux 5.10.0-10-amd64

gyp ERR! command "/home/jackv/.nvm/versions/node/v11.15.0/bin/node" "/home/jackv/.nvm/versions/node/v11.15.0/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

gyp ERR! cwd /home/jackv/LD-ToyPad-Emulator/node_modules/@serialport/bindings

gyp ERR! node -v v11.15.0

gyp ERR! node-gyp -v v8.4.1

gyp ERR! not ok 

npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.

npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.



npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! @serialport/[email protected] install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the @serialport/[email protected] install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.



npm ERR! A complete log of this run can be found in:

npm ERR!     /home/jackv/.npm/_logs/2022-01-16T23_51_01_972Z-debug.log

Trying to set up in a virtualbox VM and this is the error I get when trying to go and do step 6.

Raspberry PI 4B not being detected on PS4 unless original pad is connected then removed?

I was able to install on RPi4B successfully but only after installing the latest node (v17.0.1) and npm (8.1.0) as prior to this using the exact instructions on this page [email protected] failed to install.

In the console after running "node index.js" I can see characters being added and placed on the pad etc that I activate via the web interface (see snip below of the log) however, the issue I have is the device isn't being detected as the toypad at all on the PS4 unless I connect the original pad and the RPi4B together. Once I remove the original pad from the PS4 the characters will pop onto the screen and I can use the web interface to change characters and vehicles etc.

I think it's because the device isn't showing as "LEGO READER 2.10" but instead in windows shows as "USB Input Device" - I completed the usb setup install.sh as instructed and followed everything, the only difference is the node/npm upgrades I needed to do to get [email protected] installed.

Any idea what I might need to do here? also, what's the easiest way for me to set the device to run "node index.js" at boot so the web interface is always available? will make it easier as I can then setup the kids tablet to control it :)

Windows Info:

Port_#0008.Hub_#0003 USB Input Device HID (Human Interface Device) No Yes No No P.D.P.000000 24/10/2021 10:30:45 PM 24/10/2021 8:02:29 PM 0e6f 0241 5.10 03 00 00 PCNAME 6&16d3832c&0 HidUsb @input.inf,%HID.SvcDesc%;Microsoft HID Class Driver hidusb.sys (Standard system devices) 2.00 USB Input Device 10.0.19041.868 HID_Inst.NT input.inf USB\VID_0E6F&PID_0241\P.D.P.000000 Removable, UniqueID, SurpriseRemovalOK

Console from RPi4B:

pi@raspberrypi:~/LD-ToyPad-Emulator $ node index.js
Server running on port 80
Placing tag: 1
Placed character tag: 1
(node:872) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use node --trace-deprecation ... to show where the warning was created)
EVENT: Event { pad: '1', index: '2', dir: 0, uid: '048603BC366F80' }
Placing tag: 2
Placed character tag: 2
EVENT: Event { pad: '2', index: '5', dir: 0, uid: '048FD09326E580' }
Creating character: 3
Character created: 3
File is written successfully!
Placing tag: 3
Placed character tag: 3
EVENT: Event { pad: '3', index: '6', dir: 0, uid: '0468C641D06980' }
REQUEST (CMD_WAKE)
REQUEST (CMD_SEED): seed: 2271759871 conf 549259637
REQUEST (CMD_CHAL): conf: 1384363337
EVENT: Event { pad: '3', index: '6', dir: 0, uid: '0468C641D06980' }
EVENT: Event { pad: '2', index: '5', dir: 0, uid: '048FD09326E580' }
EVENT: Event { pad: '1', index: '2', dir: 0, uid: '048603BC366F80' }
REQUEST (CMD_READ): index: 6 page 38
REQUEST (CMD_READ): index: 5 page 38
REQUEST (CMD_READ): index: 2 page 38
REQUEST (CMD_READ): index: 6 page 26
REQUEST (CMD_MODEL): index: 6 conf: 2303392543
REQUEST (CMD_READ): index: 5 page 26
REQUEST (CMD_MODEL): index: 5 conf: 1414677827
REQUEST (CMD_READ): index: 2 page 26
REQUEST (CMD_MODEL): index: 2 conf: 2744776015
Removing item: 2

Minor issue: some vehicles mislabeled

Looking at the list of vehicles, I'm seeing that Cragger's ship is out of order in organization. It's showing that Swamp Skimmer (the default) is one of the rebuilds and Cragger's Fireship (a rebuild) is the default. Some other typos include:
"Cloud Cukko Car" instead of "Cloud Cuckoo Car"
"Gyro Sphere" instead of "Gyrosphere"
"BIONIC STEED" in all caps
"The Jokers Chopper" instead of "The Joker's Chopper"
"K9" instead of "K-9"
These are incredibly minor, just thought I'd point it out anyway

Cemu not recognized

I use Cemu for playing Lego Dimensions because RPCS3 lags too much, i had to do the Zadig workaround to use the emulator on RPCS3, but i did the driver rollback for the Lego READER, now the problem is that the emulator doesn't recognize Cemu, also, my Cemu version is 1.26.2f

Can't connect to real Wii U with my 4B

Green LED does 2 long flashes. The Wii U's USB ports give barely any power and it's not enough for my Pi methinks.
Not an issue with the program per se, just sayin.
It does, however, boot when plugged into my PS4 Pro - I can SSH into it.
I'm meant to plug the USB C cable into the power port right? It shows up on my computer.

tl;dr you can't use this with real Wii U if you're using a Pi 4B

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

    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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.