Serial Interface

501 views
Skip to first unread message

savanevery

unread,
Oct 15, 2009, 12:41:02 AM10/15/09
to Processing.js
Hi All,

One thing that Processing has that Processing JS is missing is Serial
access. I wrote a Java Applet to JavaScript bridge to allow that..
Perhaps it could be adopted by Processing.js?

http://www.walking-productions.com/jsserial/new/JSSerial.html

-shawn

Tom Longson (nym)

unread,
Oct 15, 2009, 2:02:48 PM10/15/09
to proces...@googlegroups.com
Wow cool!

Not sure if this makes sense to be part of the main library, since it's a bit specialized, but thank you for adding to the processing-js community. I think at least a few people will have a lot of fun with this.

Maybe it would be worth putting together a python or ruby server side client too? Then you could do dynamic server driven stuff similar to http://lethain.com/entry/2008/may/20/updating-processing-js-graphics-via-ajax/

Cheers,
Tom Longson (nym)
------------------------------
http://tomlongson.com

@F1LT3R

unread,
Oct 15, 2009, 6:10:51 PM10/15/09
to proces...@googlegroups.com
Nice! This is really useful.

Cary Hull

unread,
Oct 15, 2009, 6:17:22 PM10/15/09
to proces...@googlegroups.com
On Thu, Oct 15, 2009 at 3:10 PM, @F1LT3R <f1l...@hyper-metrix.com> wrote:

Nice! This is really useful.

Really? What are the use cases for such a thing?
 



--
01100011 01100001 01110010 01111001

Tom Longson (nym)

unread,
Oct 15, 2009, 6:20:09 PM10/15/09
to proces...@googlegroups.com
Off the top of my head, standalone art pieces, although I suppose Processing (minus the .js) would work for this too.

Cheers,
Tom Longson (nym)
------------------------------
http://tomlongson.com




Cary Hull

unread,
Oct 15, 2009, 6:24:58 PM10/15/09
to proces...@googlegroups.com
On Thu, Oct 15, 2009 at 3:20 PM, Tom Longson (nym) <tom...@gmail.com> wrote:
Off the top of my head, standalone art pieces, although I suppose Processing (minus the .js) would work for this too.

That's what I mean. I can't imagine what I'd want to communicate with over serial from a web browser.
 

Cheers,
Tom Longson (nym)
------------------------------
http://tomlongson.com




On Thu, Oct 15, 2009 at 3:17 PM, Cary Hull <cary...@gmail.com> wrote:


On Thu, Oct 15, 2009 at 3:10 PM, @F1LT3R <f1l...@hyper-metrix.com> wrote:

Nice! This is really useful.

Really? What are the use cases for such a thing?
 

savanevery wrote:
> Hi All,
>
> One thing that Processing has that Processing JS is missing is Serial
> access.  I wrote a Java Applet to JavaScript bridge to allow that..
> Perhaps it could be adopted by Processing.js?
>
> http://www.walking-productions.com/jsserial/new/JSSerial.html
>
> -shawn
>
> >
>
>






--
01100011 01100001 01110010 01111001






@F1LT3R

unread,
Oct 15, 2009, 6:36:19 PM10/15/09
to proces...@googlegroups.com
*Primary use case:*
To plug your brain into Processing.js Carry, and delete your locally
scoped 'I must tell everyone this is pointless.' reflex.

*Secondary use case:*
One of my clients builds web apps for teaching in the classroom, and
uses <Canvas> because it runs well in their environments; they find that
using Flash or Java for graphics causes refreshing problems to the point
of actual in-usability. Part of their work involves interactive charts,
built in real-time from scientific measuring equipment. These measuring
devices plug in to... well... serial ports.

Cary Hull

unread,
Oct 15, 2009, 6:39:35 PM10/15/09
to proces...@googlegroups.com
On Thu, Oct 15, 2009 at 3:36 PM, @F1LT3R <f1l...@hyper-metrix.com> wrote:

*Primary use case:*
To plug your brain into Processing.js Carry, and delete your locally
scoped 'I must tell everyone this is pointless.' reflex.

I didn't say it was pointless, just that use cases weren't obvious. :)
 

*Secondary use case:*
One of my clients builds web apps for teaching in the classroom, and
uses <Canvas> because it runs well in their environments; they find that
using Flash or Java for graphics causes refreshing problems to the point
of actual in-usability. Part of their work involves interactive charts,
built in real-time from scientific measuring equipment. These measuring
devices plug in to... well... serial ports.


Ok. Anything else?
 


Cary Hull wrote:
>
>
> On Thu, Oct 15, 2009 at 3:10 PM, @F1LT3R <f1l...@hyper-metrix.com
> <mailto:f1l...@hyper-metrix.com>> wrote:
>
>
>     Nice! This is really useful.
>
>
> Really? What are the use cases for such a thing?
>
>
>
>     savanevery wrote:
>     > Hi All,
>     >
>     > One thing that Processing has that Processing JS is missing is
>     Serial
>     > access.  I wrote a Java Applet to JavaScript bridge to allow that..
>     > Perhaps it could be adopted by Processing.js?
>     >
>     > http://www.walking-productions.com/jsserial/new/JSSerial.html
>     >
>     > -shawn
>     >
>     > >
>     >
>     >
>
>
>
>
>
>
> --
> 01100011 01100001 01110010 01111001
>
> >



@F1LT3R

unread,
Oct 15, 2009, 6:47:31 PM10/15/09
to proces...@googlegroups.com
| Anything else?

A web based multi-player Processing arcade-style game where the looser
gets an electric shock. If I build it Carry, will you play? Even better,
would you agree to be filmed playing against me on YouTube? Where do you
live?

Al


Cary Hull wrote:
>
>
> On Thu, Oct 15, 2009 at 3:36 PM, @F1LT3R <f1l...@hyper-metrix.com
> <mailto:f1l...@hyper-metrix.com>> wrote:
>
>
> *Primary use case:*
> To plug your brain into Processing.js Carry, and delete your locally
> scoped 'I must tell everyone this is pointless.' reflex.
>
>
> I didn't say it was pointless, just that use cases weren't obvious. :)
>
>
>
> *Secondary use case:*
> One of my clients builds web apps for teaching in the classroom, and
> uses <Canvas> because it runs well in their environments; they
> find that
> using Flash or Java for graphics causes refreshing problems to the
> point
> of actual in-usability. Part of their work involves interactive
> charts,
> built in real-time from scientific measuring equipment. These
> measuring
> devices plug in to... well... serial ports.
>
>
> Ok. Anything else?
>
>
>
>
> Cary Hull wrote:
> >
> >
> > On Thu, Oct 15, 2009 at 3:10 PM, @F1LT3R
> <f1l...@hyper-metrix.com <mailto:f1l...@hyper-metrix.com>
> > <mailto:f1l...@hyper-metrix.com

Cary Hull

unread,
Oct 15, 2009, 6:48:57 PM10/15/09
to proces...@googlegroups.com
On Thu, Oct 15, 2009 at 3:47 PM, @F1LT3R <f1l...@hyper-metrix.com> wrote:

 | Anything else?

A web based multi-player Processing arcade-style game where the looser
gets an electric shock. If I build it Carry, will you play? Even better,
would you agree to be filmed playing against me on YouTube? Where do you
live?

Hmm, this isn't a very convincing use case.
 

Tom Longson (nym)

unread,
Oct 15, 2009, 7:29:30 PM10/15/09
to proces...@googlegroups.com
F1LT3R, if Cary doesn't, I will :-)


Cheers,
Tom Longson (nym)
------------------------------
http://tomlongson.com




@F1LT3R

unread,
Oct 15, 2009, 9:25:03 PM10/15/09
to proces...@googlegroups.com
Really? Are you mad??
You'll get totally pwnd!

Tom Longson (nym) wrote:
> F1LT3R, if Cary doesn't, I will :-)
>
> Cheers,
> Tom Longson (nym)
> ------------------------------
> http://tomlongson.com
>
>
>
>
> On Thu, Oct 15, 2009 at 3:48 PM, Cary Hull <cary...@gmail.com
> <mailto:cary...@gmail.com>> wrote:
>
>
>
> On Thu, Oct 15, 2009 at 3:47 PM, @F1LT3R <f1l...@hyper-metrix.com
> <mailto:f1l...@hyper-metrix.com>> wrote:
>
>
> | Anything else?
>
> A web based multi-player Processing arcade-style game where
> the looser
> gets an electric shock. If I build it Carry, will you play?
> Even better,
> would you agree to be filmed playing against me on YouTube?
> Where do you
> live?
>
>
> Hmm, this isn't a very convincing use case.
>
>
>
> Al
>
>
> Cary Hull wrote:
> >
> >
> > On Thu, Oct 15, 2009 at 3:36 PM, @F1LT3R
> <f1l...@hyper-metrix.com <mailto:f1l...@hyper-metrix.com>

Tom Longson (nym)

unread,
Oct 15, 2009, 9:30:27 PM10/15/09
to proces...@googlegroups.com
Dude, I pwn noobs.

Cheers,
Tom Longson (nym)
------------------------------
http://tomlongson.com




@F1LT3R

unread,
Oct 15, 2009, 9:52:33 PM10/15/09
to proces...@googlegroups.com
Bring it soldier! I will even let you make the game. :) (if you promise
not to cheat)

Tom Longson (nym) wrote:
> Dude, I pwn noobs.
>
> Cheers,
> Tom Longson (nym)
> ------------------------------
> http://tomlongson.com
>
>
>
>
> On Thu, Oct 15, 2009 at 6:25 PM, @F1LT3R <f1l...@hyper-metrix.com
> <mailto:f1l...@hyper-metrix.com>> wrote:
>
>
> Really? Are you mad??
> You'll get totally pwnd!
>
> Tom Longson (nym) wrote:
> > F1LT3R, if Cary doesn't, I will :-)
> >
> > Cheers,
> > Tom Longson (nym)
> > ------------------------------
> > http://tomlongson.com
> >
> >
> >
> >
> > On Thu, Oct 15, 2009 at 3:48 PM, Cary Hull <cary...@gmail.com
> <mailto:cary...@gmail.com>
> > <mailto:cary...@gmail.com <mailto:cary...@gmail.com>>> wrote:
> >
> >
> >
> > On Thu, Oct 15, 2009 at 3:47 PM, @F1LT3R
> <f1l...@hyper-metrix.com <mailto:f1l...@hyper-metrix.com>
> > <mailto:f1l...@hyper-metrix.com
> <mailto:f1l...@hyper-metrix.com>>> wrote:
> >
> >
> > | Anything else?
> >
> > A web based multi-player Processing arcade-style game where
> > the looser
> > gets an electric shock. If I build it Carry, will you play?
> > Even better,
> > would you agree to be filmed playing against me on YouTube?
> > Where do you
> > live?
> >
> >
> > Hmm, this isn't a very convincing use case.
> >
> >
> >
> > Al
> >
> >
> > Cary Hull wrote:
> > >
> > >
> > > On Thu, Oct 15, 2009 at 3:36 PM, @F1LT3R
> > <f1l...@hyper-metrix.com
> <mailto:f1l...@hyper-metrix.com> <mailto:f1l...@hyper-metrix.com
> <mailto:f1l...@hyper-metrix.com>>

Greg Leppert

unread,
Oct 15, 2009, 6:30:43 PM10/15/09
to proces...@googlegroups.com
On Oct 15, 2009, at 5:24 PM, Cary Hull wrote: 
That's what I mean. I can't imagine what I'd want to communicate with over serial from a web browser.

I can imagine plenty of applications, for instance a physical gallery piece affected by participants across the web.

--Greg

Cary Hull

unread,
Oct 16, 2009, 11:30:17 AM10/16/09
to proces...@googlegroups.com
On Thu, Oct 15, 2009 at 3:30 PM, Greg Leppert <gr...@letsbequiet.com> wrote:
On Oct 15, 2009, at 5:24 PM, Cary Hull wrote: 
That's what I mean. I can't imagine what I'd want to communicate with over serial from a web browser.

I can imagine plenty of applications, for instance a physical gallery piece affected by participants across the web.

Hmm, why not just do that server side?
 

--Greg


 

Cheers,
Tom Longson (nym)
------------------------------
http://tomlongson.com




On Thu, Oct 15, 2009 at 3:17 PM, Cary Hull <cary...@gmail.com> wrote:


On Thu, Oct 15, 2009 at 3:10 PM, @F1LT3R <f1l...@hyper-metrix.com> wrote:

Nice! This is really useful.

Really? What are the use cases for such a thing?
 

savanevery wrote:
> Hi All,
>
> One thing that Processing has that Processing JS is missing is Serial
> access.  I wrote a Java Applet to JavaScript bridge to allow that..
> Perhaps it could be adopted by Processing.js?
>
> http://www.walking-productions.com/jsserial/new/JSSerial.html
>
> -shawn
>
> >
>
>






--
01100011 01100001 01110010 01111001









--
01100011 01100001 01110010 01111001





nuxdie

unread,
Oct 16, 2009, 12:16:01 PM10/16/09
to Processing.js
So, guys, have you any thoughts on how to implement this in
JavaScript?
Really usefull and awesome plugin, thx.)

Cary Hull

unread,
Oct 16, 2009, 12:32:22 PM10/16/09
to proces...@googlegroups.com
On Fri, Oct 16, 2009 at 9:16 AM, nuxdie <nux...@gmail.com> wrote:

So, guys, have you any thoughts on how to implement this in
JavaScript?

What do you mean exactly? jsserial simply acts as a bridge to java code, which needs to
be granted access to system resources.

Also, folks, getting the applet setup so it can access the serial port is more involved than one might think:
http://forums.sun.com/thread.jspa?messageID=9984491

 
Really usefull and awesome plugin, thx.)

On Oct 16, 2:10 am, "@F1LT3R" <f1l...@hyper-metrix.com> wrote:
> Nice! This is really useful.
>
>
>
> savanevery wrote:
> > Hi All,
>
> > One thing that Processing has that Processing JS is missing is Serial
> > access.  I wrote a Java Applet to JavaScript bridge to allow that..
> > Perhaps it could be adopted by Processing.js?
>
> >http://www.walking-productions.com/jsserial/new/JSSerial.html
>
> > -shawn


@F1LT3R

unread,
Oct 16, 2009, 1:14:25 PM10/16/09
to proces...@googlegroups.com

>
> Hmm, why not just do that server side?
>
>
>
> --Greg
>

If I understand your thoughts correctly... it's actually slower to push
data from hardware through a server like Apache and you have to assume
your user will be running a server also. Using a plug in you are getting
closer to hardware speeds with less disk writing etc. You could set up
some back end services to listen and hold something in memory, but I bet
you it would still be slower than using a Java pugin.

I was pushing MIDI through PHP that was then pushed into the Window
through an iFrame. Which was quick enough really, but not as fast as it
could have been Java hardware access.

Cary Hull

unread,
Oct 16, 2009, 1:18:03 PM10/16/09
to proces...@googlegroups.com
On Fri, Oct 16, 2009 at 10:14 AM, @F1LT3R <f1l...@hyper-metrix.com> wrote:


>
> Hmm, why not just do that server side?
>
>
>
>     --Greg
>

If I understand your thoughts correctly... it's actually slower to push
data from hardware through a server like Apache and you have to assume
your user will be running a server also. Using a plug in you are getting
closer to hardware speeds with less disk writing etc. You could set up
some back end services to listen and hold something in memory, but I bet
you it would still be slower than using a Java pugin.

No. In the case of an art exihibit - the web (server side) app itself could be hooked to whatever the serial device is.
Greg's scenerio would involve getting the updates to the serial enabled browser somehow (comet, etc). You'd still
have some kind of specialized server component in that setup.
 

I was pushing MIDI through PHP that was then pushed into the Window
through an iFrame. Which was quick enough really, but not as fast as it
could have been Java hardware access.



savanevery

unread,
Oct 17, 2009, 8:45:13 AM10/17/09
to Processing.js
Hi Tom,

Yes, in a couple of weeks I plan on putting together a PHP script and
an example using AJAX to grab data from serial through JavaScript..

I agree that it doesn't belong in the main project, just something
that people who are using Processing.js might be interested in since
it one of those things that Processing itself has but Processing.js
doesn't.

-s

On Oct 15, 2:02 pm, "Tom Longson (nym)" <toml...@gmail.com> wrote:
> Wow cool!
>
> Not sure if this makes sense to be part of the main library, since it's a
> bit specialized, but thank you for adding to the processing-js community. I
> think at least a few people will have a lot of fun with this.
>
> Maybe it would be worth putting together a python or ruby server side client
> too? Then you could do dynamic server driven stuff similar tohttp://lethain.com/entry/2008/may/20/updating-processing-js-graphics-...
>
> Cheers,
> Tom Longson (nym)
> ------------------------------http://tomlongson.com

savanevery

unread,
Oct 17, 2009, 8:48:05 AM10/17/09
to Processing.js
Right.. A (self) signed Java Applet that acts as a bridge. The hard
part was getting through all of the Java and JavaScript sandbox
issues. Unfortunately when you use JavaScript to access Java Applets
the code that the JavaScript calls acts as if it is unsigned. This
Applet uses a thread to take care of those issues.

Cary Hull

unread,
Oct 17, 2009, 1:18:37 PM10/17/09
to proces...@googlegroups.com
On Sat, Oct 17, 2009 at 5:48 AM, savanevery <savan...@gmail.com> wrote:

Right..  A (self) signed Java Applet that acts as a bridge.  The hard
part was getting through all of the Java and JavaScript sandbox
issues.  Unfortunately when you use JavaScript to access Java Applets
the code that the JavaScript calls acts as if it is unsigned.  This
Applet uses a thread to take care of those issues.


So, what are you using it for? :)
 
On Oct 16, 12:32 pm, Cary Hull <cary.h...@gmail.com> wrote:
> On Fri, Oct 16, 2009 at 9:16 AM, nuxdie <nux...@gmail.com> wrote:
>
> > So, guys, have you any thoughts on how to implement this in
> > JavaScript?
>
> What do you mean exactly? jsserial simply acts as a bridge to java code,
> which needs to
> be granted access to system resources.
>
> Also, folks, getting the applet setup so it can access the serial port is
> more involved than one might think:http://forums.sun.com/thread.jspa?messageID=9984491
>
>
>
>
>
> > Really usefull and awesome plugin, thx.)
>
> > On Oct 16, 2:10 am, "@F1LT3R" <f1l...@hyper-metrix.com> wrote:
> > > Nice! This is really useful.
>
> > > savanevery wrote:
> > > > Hi All,
>
> > > > One thing that Processing has that Processing JS is missing is Serial
> > > > access.  I wrote a Java Applet to JavaScript bridge to allow that..
> > > > Perhaps it could be adopted by Processing.js?
>
> > > >http://www.walking-productions.com/jsserial/new/JSSerial.html
>
> > > > -shawn
>
> --
> 01100011 01100001 01110010 01111001

savanevery

unread,
Oct 18, 2009, 10:16:57 PM10/18/09
to Processing.js
I made it as I am teaching a class in JavaScript/PHP NYU's Interactive
Telecommunications Program that is normally taught in Processing and
one of the things that needs to be accomplished in the course is to
interface with devices via serial. JavaScript made more sense to me
than teaching how to setup a server and talk serial through PHP. I do
agree that it is arguable which is the better way to go..

I do think that it makes for an interesting space to explore
alternative input devices. One compelling thing that I can think of
is that it would work well for experimental assistive technology
(mouth control of a browser or single finger). In general, I think it
opens the door for a lot experimentation along these lines.

Browsers have been limited to a mouse and keyboard for way too long.
Perhaps certain pages should use physical dials and buttons and others
use gloves with accelerometers.. Isn't Google Maps just ripe for
that??

On Oct 17, 1:18 pm, Cary Hull <cary.h...@gmail.com> wrote:

Cary Hull

unread,
Oct 18, 2009, 10:38:41 PM10/18/09
to proces...@googlegroups.com
On Sun, Oct 18, 2009 at 7:16 PM, savanevery <savan...@gmail.com> wrote:

I made it as I am teaching a class in JavaScript/PHP NYU's Interactive
Telecommunications Program that is normally taught in Processing and
one of the things that needs to be accomplished in the course is to
interface with devices via serial.  JavaScript made more sense to me
than teaching how to setup a server and talk serial through PHP.  I do
agree that it is arguable which is the better way to go..

I do think that it makes for an interesting space to explore
alternative input devices.  One compelling thing that I can think of
is that it would work well for experimental assistive technology
(mouth control of a browser or single finger).  In general, I think it
opens the door for a lot experimentation along these lines.

Browsers have been limited to a mouse and keyboard for way too long.
Perhaps certain pages should use physical dials and buttons and others
use gloves with accelerometers..  Isn't Google Maps just ripe for
that??

Thanks. Quite visionary.
 
Reply all
Reply to author
Forward
0 new messages