
Johnny-Five v1.0 – JavaScript Robotics and IoT Framework - bpierre
http://johnny-five.io/news/v1_0/
======
lxe
Johnny Five doesn't let JavaScript (Node) run on the microcontrollers
themselves -- it requires a USB (or serial) link firmware installed in the
board.

The program runs on your computer and issues commands to the firmware via the
link. This makes the board "tethered" to the PC so to speak.

That said, hooking up a Raspberry PI running node to an Arduino sort of
alleviates the "tethered-ness" and I believe it is the lowest effort barrier
to entry into robotics and presents endless creative opportunities.

~~~
tcgarvin
I believe you're incorrect, Johnny five supports both runtime models.

Was playing with Johnny Five yesterday (while they were releasing 1.0, fun to
watch), and was deploying my node project code to my Tessel 2, which then ran
independently of my laptop.

I was amazed at how easy it was to go from 0 to deployed code running reliably
on the (detached, untethered) dev board. At least when working with the Tessel
2, they really think through the dev experience end-to-end.

[Edit: Tessel, not Tessle]

~~~
lxe
This is true for some boards. For realtime OS-less microcontroller boards like
Arduino, the execution model is what I've described: [http://johnny-
five.io/platform-support/#arduino-uno](http://johnny-five.io/platform-
support/#arduino-uno)

For beefier linux boards, like Tessel and Beagle Board, it's what you've
described: [http://johnny-five.io/platform-support/#beaglebone-
black](http://johnny-five.io/platform-support/#beaglebone-black)
[http://johnny-five.io/platform-support/#tessel-2](http://johnny-
five.io/platform-support/#tessel-2)

------
nullbyte
As much as I love JavaScript, I have always preference synchronous languages
(like, say, Python) for robotics programming.

~~~
newfocogi
In what way is Python any more of a synchronous langues than JavaScript?

~~~
netinstructions
The next line of code in JavaScript isn't always going to be executed after
the previous line is complete. This is unlike Python, which generally executes
each line after the previous line is complete.

Hence all the callbacks, promises, async/awaits patterns to learn in
JavaScript..

~~~
bsimpson
This feels intellectually dishonest.

The next line in JS is guaranteed to execute immediately after the preceding
one; except in the case of callbacks (including sugar, like promises), which
are also executed sequentially, but deferred until they are explicitly called
by whatever they're passed to. In fact, one of the biggest complaints about
JavaScript (that it can block the main thread if it tries to do too much in
one frame) is a consequence of this guarantee.

Granted, I've written primarily JavaScript for the last five years, but it's
pretty straightforward to reason about. Any language that lets you respond to
events, I/O, etc. is going to require that you reason about things over time -
JavaScript is no outlier here.

The way you've written your remark, it sounds as if JavaScript executes lines
out of order, or will wait an arbitrary amount of time to move from one line
to the next. Obviously, neither of those is true.

------
DiabloD3
So, in fact, Johnny-Five is alive?

------
applecrazy
This is awesome. I met some of the Johnny-Five devs at Maker Faire a couple
years ago, and they were demoing an interesting web-application controlled
robot with a camera at the Intel booth. Glad to see that they've finally hit
1.0.

But as the top commenter mentions, still no standalone support on devices like
Arduino, which is what prevented me from using it in my projects. (I don't
know if it's possible to fit a node runtime onto something as small as an
Arduino, anyways)

~~~
anonyxyz
Check out espruino

------
eksemplar
We use IoT quite a bit in the public sector, especially for things like
traffic, weather and parking data, and we’ve been running much of it on our
lorawan setup, using node on the actual devices.

I wouldn’t have thought it at first, but JavaScript is turning out to be our
most important language for driving IoT, and while I haven’t heard about
Johnny-five before, it looks pretty good.

~~~
miketery
What are you finding the advantages of using JavaScript over another language
like say python for those IoT applications?

~~~
hartbeatnt
same benefit for using JavaScript for anything -- much larger pool of
engineers to draw from

------
LandoCalrissian
They have increased board support quite a bit since the last time I checked it
out, very cool.

------
wiradikusuma
So is this like MicroPython (but for JS)?
[https://micropython.org/](https://micropython.org/)

~~~
ianbicking
My understanding of Johnny Five is that it's a way to drive an external board
from a "normal" computer. So you aren't putting any execution (or JavaScript)
onto the Arduino (or other embedded) controller. Instead you load their
premade firmware onto the controller, hook that controller up to your computer
via some serial connection, and then the Johnny Five library lets you control
everything from the main computer.

It seemed kind of trivial when I first heard about it, but now that I've
experimented some with these things it's not that trivial, and it's a
reasonable approach. Especially for robotics – an Arduino board isn't a good
way to drive a robot (too limited), but it's a good way to drive many (but not
all) of the specific components you might want to control. Then the real brain
can be a Raspberry Pi or some other proper computer.

~~~
wiradikusuma
thank you for the explanation. so in production, it must be paired with
Pi/real computer?

but why use this if Pi has support for sensors and stuff already? (other than,
"because I've already bought Arduino")

~~~
ianbicking
My sense is that "devices" you hook up to a computer are themselves entire
computers with fancy high-level protocols to control them. Sure the Pi, unlike
a normal computer, has its GPIO ports. You can use those to directly control
hardware that is not smart (or is only a tiny bit smart). But still you run
out of ports really quickly, managing those ports isn't easy, and if you are
controlling things that need more power than the GPIO ports can provide then
you'll need additional circuitry. You usually need additional circuitry.

The obvious solution is to create higher-level hardware that the Pi can
control without, say, pulsing on a regular interval, or without having to
provide the full power requirements via GPIO. An Arduino board is a modular
way to do exactly that. The Arduino then becomes the "device".

------
eschaton
It’s really too bad people aren’t doing things like this in Lisp. There are so
many more tools for building useful abstractions and a rich history of real
work in the field to draw upon, performance is _very_ good, and CFFI works
great for interfacing with very low level C-callable code. (It didn’t take me
long at all to use CFFI to bridge to Intel’s MRAA on the Edison, for example.)

------
cweagans
Just what I've always wanted: another use-case to shoehorn javascript into.

:/

~~~
dang
"Please don't post shallow dismissals, especially of other people's work. A
good critical comment teaches us something."

[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

~~~
eschaton
This teaches us that “do everything with Node.js” isn’t as popular an opinion
as HN headlines might make one believe.

~~~
cweagans
Gonna have to agree with the others here. My comment wasn't that helpful and I
could have expressed my contempt for "Javascript-all-the-things" in a more
constructive way.

------
dmitripopov
Are you aware that there is a musician named John 5? He worked with Marilyn
Manson and now works with Rob Zombie.

