Skip to content

Cannot connect to Move Hub #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zzbazza opened this issue Nov 15, 2024 · 1 comment
Open

Cannot connect to Move Hub #190

zzbazza opened this issue Nov 15, 2024 · 1 comment

Comments

@zzbazza
Copy link

zzbazza commented Nov 15, 2024

When trying to use with Move Hub (88006) got error:
libc++abi: terminating due to uncaught exception of type Napi::Error

const PoweredUP = require('node-poweredup');
const poweredUP = new PoweredUP.PoweredUP();

let hub;

async function connectToHub() {
    return new Promise((resolve, reject) => {
        poweredUP.on("discover", async (discoveredHub) => {
            hub = discoveredHub;
            console.log("Hub connecting");
            // console.log(hub);
            try {
                await hub.connect();
                console.log("Hub connected");
                resolve();
            } catch (error) {
                reject("Connection to hub failed");
            }
        });
        poweredUP.scan();
    });
}

I was able to connect and work with small hub 88009

@fatlard1993
Copy link

Unsure if its your issue; but something to try is to make sure the hub is up-to-date. You can use the lego powered up app to update it by opening any set (ex. sw bots) and clicking the BT connect button inside there (It'll auto-update once it connects)

I'm able to connect to my Move Hub that is fully up-to-date and using the latest version of this library built with node 20.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants