Skip to content
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

RaspberryPi issue #1841

Open
technic404 opened this issue Feb 17, 2024 · 8 comments
Open

RaspberryPi issue #1841

technic404 opened this issue Feb 17, 2024 · 8 comments

Comments

@technic404
Copy link

I'm using Raspberry Pi 4B.

code:

var five = require("johnny-five");
var board = new five.Board();

board.on("ready", function() {
    console.log('Ready!');
});

Error:

internal/deps/acorn/acorn/dist/acorn.js:4015
      (ch >= 0x41 /* A */ && ch м쀽 0聸耵C  *РØ 肪࠯, ɼ|逊 Ȩ   0䀨䡣jĠ>= 0x¶1 /ЪĠá */(&₦耠䁣聨ࠨ¼耿 8¸‷䉁Ƞ/쀪ဠࡺ */)
                                ^^

SyntaxError: Unexpected identifier

at Object.<anonymous> (/home/user/Desktop/node_modules/johnny-five/lib/repl.js:2:14)

As i was testing the issue, error is displayed in the first line (var five = require("johnny-five");).

@scottgonzalez
Copy link
Contributor

I have no issues with my Pi 400s.

But the provided error code looks more like a broken source file than an issue with Johnny-Five. It should be impossible for a Johnny-Five error to produce a SyntaxError.

@scottgonzalez
Copy link
Contributor

I'd try rm -rf node_modules && npm install.

@lbineau
Copy link

lbineau commented Mar 29, 2024

In addition you can try to install the main branch instead of npm (npm last update is 3years ago, while github is 1year ago).
https://github.com/rwaldron/johnny-five?tab=readme-ov-file#source-code

@PizzaProgram
Copy link

(npm last update is 3years ago, while github is 1year ago)

But the Release version number here matches the one at npm : 2.1.0
I think @johnny-five would update on npm too, if anything would change.

IMHO this issue can be closed.

@PizzaProgram
Copy link

@scottgonzalez I take it back. I see now that Serial has been updated in 2023, but no new release has been presented.
So you are right, the source downloaded directly from here (and not from "release" page) is newer than the one on npm.

Maybe we should ask to make a new 2.2.20250201 release ?
(it is always a good practice to include a date in the numbering)

@scottgonzalez
Copy link
Contributor

I wouldn't hold your breath for a release. I gave up waiting for one a long time ago and started using my own fork (also forked firmata to use an updated serialport which gets pulled into johnny-five). I point to the tip of https://github.com/scottgonzalez/johnny-five/tree/blue-owl (currently using "johnny-five": "scottgonzalez/johnny-five#f548f9aed5b1992cb8f847e95b5a4583f952fc73" as my dependency) for my projects.

As for using a date as a patch version, that is definitely not a good practice. If you want to include a date in the version, it should be in the build metadata, e.g., 2.2.0+20250201, but I personally would not recommend that either.

@dtex can you close this issue?

@dtex
Copy link
Collaborator

dtex commented Feb 1, 2025

I should ping @rwaldron. I think he believes I can publish releases at npm, but that's the one privilege I don't have.

@PizzaProgram
Copy link

@scottgonzalez Actually my real goal is to find a stable Node-Red module, that would properly handle Firmata.
(Currently I'm using RPi-Pico boards with Configurable-Firmata firmware on them.)

The Node-Red's built-in module called: 35-aruino, based on Firmata-io, can not properly handle:

  • Re-Deploy /
  • USB-disconnect /
  • reconnect /
  • wrong pin number / << the whole NR is crashing
  • (temp reading)

The whole Arduino module is freezing down. I've checked the codebase of those files, and I think the main problem is:

  • there is not any serial.on('error')... present,
  • no timeout of data flow
  • nor enough try..catch .

So I thought what if Johnny-five can handle it better? (Was big fan of the movie as a child 🤖 .)

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

5 participants