rwaldron / johnny-five

JavaScript Robotics and IoT programming framework, developed at Bocoup.
http://johnny-five.io
Other
13.28k stars 1.76k forks source link

How about making johnny-five inside PhoneGap/Cordova? #1132

Closed iszufu closed 6 years ago

iszufu commented 8 years ago

Have you ever tried to build a PhoneGap or Cordova app for mobile with johnny-five to control an arduino borad by bluetooth serial? If you do have, please send me the link for toturial. But if you haven't, can you please think about it and give me some solutions to achieve this? I would like to use blockly from google to build an mobile app for controlling an arduino based car. By the way, I know that cylon.js have done this. But I prefer to use johnny-five, cause I am more familiar with it and I think it should achieve this as well.

monteslu commented 8 years ago

@iszufu its definitely possible. I did this a while back for bean-io and bean-serial. Wrote about it here: http://iceddev.com/blog/beanbots-rise-of-the-swarm/ The code linked in that post is pretty out of date though.

The key is to get a serial type interface such as https://github.com/monteslu/ble-serial with a custom firmata sketch on a board such as the Arduino 101.

This is somewhat straight forward using Web Bluetooth on new browsers with https://github.com/sandeepmistry/noble/pull/238

For cordova/phonegap though, we either need a cordova-noble-shim + ble-serial or we need a new ble-serial type of interface using the cordova BLE API.
@don Would better be able to eloborate on the cordova part.

dtex commented 6 years ago

@iszufu Assuming @monteslu's advice put you on the right path so I'm going to close this issue. Please re-open if necessary.