Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Manish2208
@Manish2208
how to use multiple buttons to control multiple o/p using johnny -five?
Donovan Buck
@dtex
@misterzirillo It supports a few expanders, but not that particular one and no I2C multiplexers that I'm aware of. I think you're the first person to ask about it. There's a good infrastructure there to build upon, but it would require a champion to come in and write the code.
@Manish2208 What is "o/p"? Also, it is better to ask your questions on Github. Gitter doesn't see a lot of action and I will never respond to DM's for support.
Jake Harris
@jake-harris
Would anyone be interested in a quick tutoring session for hire? I'm able to make some servos sweep() but not step() or to(). Not quite sure what I'm doing wrong.
Donovan Buck
@dtex
I'm not available for hire, but I know the Servo class pretty well and can probably help. Can you a) Share your code and b) Describe what's happening?
Jake Harris
@jake-harris
Thanks so much for responding. I was just about to come here and post back: I was unable to step() without first setting the servo position (e.g. using the constructor props or center(), etc.)
Donovan Buck
@dtex
That makes sense. Standard servos don't provide feedback, so if you haven't set the position J5 can't know the position to step from. It's operating with NaN as the current position so I suspect it's just failing silently.
Danilo Gacevic
@danilogacevic
Hi. Is it possible to program controllino with J5 ? If anyone tried it..
Donovan Buck
@dtex
Not out of the box, but it isn't a Johnny-Five issue. Firmata would need to be modified to run on the Controllino. Totally doable I'm sure, but I don't really know how much work it would be.
Danilo Gacevic
@danilogacevic
Ok, thank you.
Donovan Buck
@dtex
@danilogacevic the repo you’ll want to open an issue on is firmata/arduino
Danilo Gacevic
@danilogacevic
@dtex But firmata/firmata.js is the repo that should be modified ?
mg-snake
@mg-snake
anyone know what I'm doing wrong with using interchange? i try running interchange install and it says interchange is not recognized
:(
trying to get a led strip working with johnny five
mg-snake
@mg-snake
i installed interchange globablly
so shouldnt it be here? C:\Program Files\nodejs\
this is in my PATH
Joshua Scott Oxner
@Bohemus307
Is there a way to access a ph sensor that is connected via usb to a rpi3 with Johnny-five?
Vini Dalvino
@ViniDalvino
I know it sound stupid to say but would it be possible to use the johnny five library and express js on a Espduino board to make a web server?
markirgang
@markirgang
I tried running the Phoenix.js program from the Javascript Robotics book. I received multiple errors running the code:

Running the Phoenix.js the errors were Microsoft Windows [Version 10.0.18363.1256]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\HP>node phoenix.js
1609566836800 Available COM7
1609566836806 Connected COM7
1609566837872 Repl Initialized

The 'isInverted' property has been renamed 'invert'
C:\Users\HP\phoenix.js:99
phoenix.r1 = new five.Servo.Array([ phoenix.r1c, phoenix.r1f, phoenix.r1t ]);
^

TypeError: five.Servo.Array is not a constructor
at Board.<anonymous> (C:\Users\HP\phoenix.js:99:16)
at Board.emit (events.js:323:22)
at Board.EventEmitter.emit (domain.js:482:12)
at C:\Users\HP\node_modules\johnny-five\lib\board.js:428:39
at processTicksAndRejections (internal/process/task_queues.js:79:11)

C:\Users\HP>

C:\Users\HP>

C:\Users\HP>

Donovan Buck
@dtex
Try ‘new five.Servos’ instead of ‘new five.Servo.Array’
markirgang
@markirgang
Ok,thanks. What about the The 'isInverted' property has been renamed 'invert'
C:\Users\HP\phoenix.js:99
phoenix.r1 = new five.Servo.Array([ phoenix.r1c, phoenix.r1f, phoenix.r1t ]);
Is that 'isInverted' property has been renamed 'invert' a warning or a critical error that will stop the program from executing?
Donovan Buck
@dtex
Yes
markirgang
@markirgang
Ok,thanks!
markirgang
@markirgang
Getting closer! The Phoenix code compiles now with no errors or warnings and the Raspberry Pi running Node 14 and Johnny-five connects to the Arduino Mega flashed with standard Plus Firmata and connected directly to the servos w/no sensor shield When I type ph.walk or ph.sleep through he REPL it says it's running the function but yet the servos don't move. Any idea what could be wrong? As a test I tried flashing "sweep" in the Arduino IDE ID and the servo worked fine.
markirgang
@markirgang
I also tried running a simple servo sweep program in node.js/Johnny-5 on the raspberry Pi connected by USB to the Arduino Mega. The simple sweep program worked fine and the receive light on the Mega flickered as the servo swept. Yet, nothing is received by the Mega when I tried the Phoenix program.
markirgang
@markirgang
I even tried as a test inserting code for a servo sweep on pin 10. The receive light on the Mega flickered and the servo swept. Yet, the Phoenix code doesn't seem to send an commands to the servos.
Donovan Buck
@dtex
Hmmm, I'll take a look. Were talking about the Phoenix code in the J5 repo, correct?
Not from the Javascript Robotics book repo.
markirgang
@markirgang
It's from that excellent Make: Javascript Robotics book. The code is on GitHub at https://github.com/rwaldron/javascript-robotics. I used to read that book to my son several years ago. Now he is an engineering student at RPI.
Sorry, I meant Drexel. My daughter did RPI engineering.
Donovan Buck
@dtex
First, I'd try switching to the code in the J5 repo. It's a couple of years more up to date. I know the Servo.Array collection constructor was deprecated a while back. That could be the culprit.
markirgang
@markirgang

pi@raspberrypi:~ $ node phoenix
node:internal/modules/cjs/loader:928
throw err;
^

Error: Cannot find module '../lib/johnny-five.js'
Require stack:

  • /home/pi/phoenix.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/home/pi/phoenix.js:17:12)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/home/pi/phoenix.js' ]
    }
Sorry, the preceeding was the error I got trying to run the newer J5 code
Donovan Buck
@dtex
It assumes it's in the eg folder. Just change the require statement for J5 so that it doesn't use a relative path:
var five = require("johnny-five"),
markirgang
@markirgang
Yes. The errors are gone. Still not sending servo messages to the mega,though
Donovan Buck
@dtex
I'm at the day job right now so I can't test, but I'm thinking that maybe the 'degrees' property name isn't being converted to 'value'. This means the servo value never changes. J5 won't try to update the servo if the value doesn't change so no command is sent to the mega. I'll try after work.
markirgang
@markirgang
Interesting!- I tried inserting function calls like "ph.walk();" from inside the code itself instead of trying to call the "ph.walk(); function by typing the commands into the command window as follows:>>ph.walk();. The board is now receiving data and moving the servos! Is it possible I'm not using the command window correctly?
Donovan Buck
@dtex
Hmm... there’s no magic in using the repl. What do you get if you just type ‘ph’?
markirgang
@markirgang

just prints out stuff like this:pwmRange: [Array],
range: [Array],
deadband: [Array],
fps: 100,
offset: 0,
mode: 4,
interval: null,
value: 103.29333333333332,
type: 'standard',
invert: true,
startAt: 180,

  [Symbol(kCapture)]: false
},
length: 6

},
coxa: Servos {
'0': Servo {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
board: [Board],
io: [Firmata],
id: 'FC0C1A77-1F7F-4726-8419-90C6BF96E894',
custom: {},
pin: 23,
degreeRange: [Array],
pwmRange: [Array],
range: [Array],
deadband: [Array],
fps: 100,
offset: 10,
mode: 4,
interval: null,
value: 56.80000000000001,
type: 'standard',
invert: false,
startAt: 45,

  [Symbol(kCapture)]: false
},

...etc etc

Interestingly, one side's legs don't move at all while the other side's legs move normally when calling ph.walk();. Is something wrong with the "invert" function?
markirgang
@markirgang
Sorry!My mistake. I connected the servos to the pins specified in the Javascript Robotics book. I should have verified that the pins specified in the phoenix.js code match the pins specified in the book. I hooked up the pins to match the code and it worked! Should teach me to never assume anything.Now I will trim the servos and repair the stripped joints w/ epoxy and I should be good to go. Thanks for this amazing animation code!
Where does the Sparkfun Joystick shield and UNO get connected here?
RYeah Sh
@pantchox
Hi everyone, how do you get real time push notification from your devices? I am asking for development research - ANY input will be great! thanks
reconbot
@reconbot:matrix.org
[m]
wohh gitter is matrix?
@pantchox: mqtt is a common protocol, but even an HTTP get request to a server that does the "push" will work
onesocialinbox
@onesocialinbox
Can Johnny-Five library run on browser DOM? When I browserify/webpack it has some problems running in browser... Any hints??