GithubHelp home page GithubHelp logo

bambu-cli's People

Contributors

davglass avatar gh-action-bump-version 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

Watchers

 avatar

bambu-cli's Issues

A1 Mini - AMS Lite Failure

Nice work! I love it!

i have a A1 Mini with AMS Lite - but at the status overview, the script stop working at this point:

`root@BambuClient:~/.config/bambu-cli# bambu-cli status speedy
Showing only, xxxx
Checking connectivity for 1 machine(s)

ID Name IP Address FTP MQTT AMS Nozzle Printing Task Percent Remaining Speed
xxxx Speedy 192.168.178.140 โœ” โœ” A RUNNING Brio Schiene Duplo k ... 30% 58m Normal

Model Machine firm
A1 mini 01.07.21.46

/usr/lib/node_modules/bambu-cli/lib/status.js:146
if (tray.cols.length > 1) { //Mulicolor
^

TypeError: Cannot read properties of undefined (reading 'length')
at /usr/lib/node_modules/bambu-cli/lib/status.js:146:31
at Array.forEach ()
at /usr/lib/node_modules/bambu-cli/lib/status.js:127:19
at Array.forEach ()
at showDetails (/usr/lib/node_modules/bambu-cli/lib/status.js:122:13)
at /usr/lib/node_modules/bambu-cli/lib/status.js:75:17
at statusMQTT (/usr/lib/node_modules/bambu-cli/lib/status.js:276:9)
at MqttClient. (/usr/lib/node_modules/bambu-cli/lib/status.js:271:17)
at MqttClient.emit (node:events:514:28)
at handlePublish (/usr/lib/node_modules/bambu-cli/node_modules/mqtt/build/lib/handlers/publish.js:97:20)
at handle (/usr/lib/node_modules/bambu-cli/node_modules/mqtt/build/lib/handlers/index.js:28:35)
at work (/usr/lib/node_modules/bambu-cli/node_modules/mqtt/build/lib/client.js:216:40)
at writable._write (/usr/lib/node_modules/bambu-cli/node_modules/mqtt/build/lib/client.js:241:13)
at writeOrBuffer (/usr/lib/node_modules/bambu-cli/node_modules/readable-stream/lib/internal/streams/writable.js:334:12)
at _write (/usr/lib/node_modules/bambu-cli/node_modules/readable-stream/lib/internal/streams/writable.js:283:10)
at Writable.write (/usr/lib/node_modules/bambu-cli/node_modules/readable-stream/lib/internal/streams/writable.js:286:10)

Node.js v20.10.0
root@BambuClient:~/.config/bambu-cli#`

Hangs when attempting to pull ip addresses

Logging in as: [email protected]
Fetching devices from their API.
Found 2 devices.

Device One
Device Two
Attempting to find device IP addresses, please wait, this may take a few seconds..
Found IP for Device-One: null

Response from /v1/iot-service/api/user/bind

"devices": [
		{
			"dev_id": "",
			"name": "A1 Mini",
			"online": true,
			"print_status": "SUCCESS",
			"dev_model_name": "N1",
			"dev_product_name": "A1 mini",
			"dev_access_code": "",
			"nozzle_diameter": 0.4
		},
		{
			"dev_id": "",
			"name": "X1C",
			"online": true,
			"print_status": "FAIL",
			"dev_model_name": "BL-P001",
			"dev_product_name": "X1 Carbon",
			"dev_access_code": "",
			"nozzle_diameter": 0.4
		}
	]

CLI Crash

Hello,

I built a fresh VM on AlmaLinux 9.3, installed Docker in preparation for bambu-farm, installed NodeJS 20. When I attempt to log in, I get the following:

[dge@farmstand ~]$ bambu-cli login
/usr/local/lib/node_modules/bambu-cli/bin/cli.js:114
if (!args.id && machines.length === 1) {
^

TypeError: Cannot read properties of undefined (reading 'length')
at Object. (/usr/local/lib/node_modules/bambu-cli/bin/cli.js:114:26)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47

Node.js v20.9.0
[dge@farmstand ~]$

The same error occurs with bambu-cli status and bambu-cli ls

Login needs 2FA

Hi!

When I try to log in it never asks me for the 2FA code I have set up in my account.

I had to edit the "getTokens" function in the "login.js" file to make it ask me for the code so I can use the CLI. I would like to be able to open a PR with the modified changes, but given the structure of the project I don't know how to approach it in the best way.

I leave you the piece of code I made:

// (in line 10)
const TFA = 'https://bambulab.com/api/sign-in/tfa'; 

// (in line 138)
if (code === 200) {
            res.on('data', d => {
                const json = JSON.parse(d);
                logger.debug(`JSON`, JSON.stringify(json, null, 4));
                if (json.tfaKey) {
                    const tfa = rl.question(`[bambulab.com] 2FA code: `);
                    const tfaPayload = JSON.stringify({ tfaKey: json.tfaKey, tfaCode: tfa });
                    const tfaEndpoint = parse(TFA);
                    tfaEndpoint.method = 'POST';
                    tfaEndpoint.headers = {
                        'content-type':   'application/json',
                        'content-length': tfaPayload.length
                    };
                    const tfaReq = https.request(tfaEndpoint, (tfaRes) => {
                      ...
                    });
                    tfaReq.write(tfaPayload);
                    tfaReq.end();
                }
            });
        }

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.