How do I "call" a Bonescript server?

This is probably a really dumb question and maybe I'm not
understanding something fundamental about Bonescript.

There are several example Bonescript programs that create server
instances, e.g. this one..
http://groups.google.com/group/beaglebone/browse_thread/thread/1515d6d0f6c0f70c/9cff4e75d21d9268?hl=en&lnk=gst&q=bonescript#9cff4e75d21d9268

As far as I understand the code, it includes/pulls in the http and
server classes / objects (whatever the right terminology is)
   var http = require('http');
   var bb = require('./bonescript');

and then it creates an instance of a server
   http.createServer(function (req, res) { ..... }).listen(80);

and runs it:
   bb.run();

OK so far. When I press the "Run' button in Cloud9, this code is
running somewhere, right?

So my dumb question is how do I SEE, and INTERACT with the code???
Where is the UI of the server?

My 'Bone is on 192.168.1.99 (or 192.168.7.2 via USB). If I point my
PC web browser at that URL, I just get the standard Bone101
presentation

I've tried http://192.168.1.99/bonescript or http://192.168.1.99/my-app-name
etc or http://192.168.1.99:80 (the "listen(80)" is the port
number, right?)

Must be something very obvious but I can't find it documented anywhere

I see the Node.js docs but some "Bonescript on the Bone" getting
started docs would be great

Thanks
Richard

Richard,

I'm not sure if you're asking about the Cloud9 development IDE for
editing and debugging node.js code. If so, it is at http://192.168.1.99:3000.
If it isn't there, then you may need to start Cloud9:

systemctl start cloud9.service

If you just want to see the output of your node code, then perhaps the
problem is that you are running your server at the same port number as
bone101 (port 80, which as you say is the default web server port).

So, you should either stop the bone101 server:

systemctl stop bone101.service

or change the port number of your server

e.g.
....listen(81)

If you change the port number to something other than 80, then you'll
need to specify it in the browser URL:

http://192.168.1.99:81

Dan.

You're right, bone101 is on port 80, so just change the listen port
for your new program to another port, for instance 8000. Then browse
to <ip address>:8000.

hey,
can any post a link for arm ver ubuntu or linux download full pak ,thanks in advance

My 'Bone is on 192.168.1.99 (or 192.168.7.2 via USB). If I point my
PC web browser at that URL, I just get the standard Bone101
presentation

I’ve tried http://192.168.1.99/bonescript or http://192.168.1.99/my-app-name
etc or http://192.168.1.99:80 (the “listen(80)” is the port
number, right?)

Must be something very obvious but I can’t find it documented anywhere

You’re right, bone101 is on port 80, so just change the listen port
for your new program to another port, for instance 8000. Then browse
to :8000.

right now, each of the demo apps that has a server starts its own server. my vision for how this will end up is that they’ll eventually all run under the same server on port 80 and you’ll navigate to the individual applications. the challenge of generating too much getting started documentation is that it will change too much between here and the summer where I plan to lock down the interfaces.

yesterday, I added a shell on a branch that would allow you to invoke commands under bash. i plan to use that in some interactive command-line tutorials (and also because it still seems to me that GateOne is too slow even without the redirect issue found in some browsers).

anyway, as it stands today, here are the port addresses for the various demo apps (mostly contributed by Koen):
bone101: port 80
processing-dynamic-view: port 8000
schmux: port 8001
weatherstation: port 8000 (obviously can’t be run at the same time as processing-dynamic-view, but this one requires some additional hardware anyway)

Koen currently has a nice branch (https://github.com/koenkooi/bonescript/tree/ELC2012-koen) that shows a little bit about what the future will be like. He’s incorporated schmux into the bone101 presentation for use in his ELC2012 presentation. When the video is up, it’ll help explain it a bit. Anyway, my goal is to include live-working tutorials for all of the bonescript capabilities in the bone101 presentation.

One challenge I haven’t figured out is what to do when something requires wiring. I guess you’ll need to refer to some external document containing the wiring diagrams and come back to the presentation once you’ve wired it up.

Thank you to everyone but for some reason this still isn't letting me
"see" my running node.js program

Following this hint above, I ran "systemctl --all list-units"

and get this output (and lots of .device etc)

...
bone-tester.service loaded inactive
dead BeagleBone Tester
bone101.service loaded active
running Beaglebone 101 presentation
cloud9.service loaded active
running Cloud9 IDE
connman.service loaded active
running Connection service
crond.service loaded active
running Periodic Command Scheduler
dbus.service loaded active
running D-Bus System Message Bus
...

That's consistent with what I see
-- Cloud9 IS accessible at 192.168.1.99:3000
-- Bone101 IS accessible at 192.168.1.99 or 192.168.1.99:80

BUT
-- Schmux NEVER appears at 192.168.1.99:8001
-- my node.js server program NEVER appears at 192.168.1.99:81 (or any
other port # I've tried)

I pull up schmux.js on screen in Cloud9, I click the "run" button but
the browser never connects...
"Oops! Google Chrome could not connect to 192.168.1.99:8001"
Firefox same: "Firefox can't establish a connection to the server at
192.168.1.99:81"

I guessed it might be a firewall issue but I've tried turning off
Norton Firewall and makes no difference as far as I can see (Norton
Internet Security 2012, up to date definitions). My thought was port
81 or 8001 is an unusual port for http and might be being blocked. I
tried adding a firewall rule to allow all traffic on the local subnet
to and from 192.168.1.99 - no difference. Windows 7 is warning me I
have no firewall running (which is what I want) and makes no
difference

I am running BeagleBone A3 hardware with the latest 2/14/2012 "A5"
build on a new SD card. no "install update/upgrades" only a "git
pull" from inside Cloud9

Is there a Linux process that I need to start manually?

Any suggestions?

Thanks!

Richard

click the dropdown icon next to the run icon and add a config for your node app

Richard,

You won't see your node.js program in the systemctl output unless
you've converted it to run as a service. Cloud9 and bone101 run as a
service -- you'll see their configuration files in \lib\systemd
\system.

As for the reason why you can't connect to schmux or your program at
the specified port number, you should try running it from the command
line to make sure they aren't failing due to an error:

e.g.
/var/lib/cloud9# node schmux.js

If schmux and your program don't report any errors when run that way,
but you still can't connect, then the problem isn't something that
I've run into (but I've barely dabbled with node.js). I can tell you
that Windows 7 shouldn't have any firewall problems when connecting to
the BB on port 81 - that works on my Windows 7 PC.

Dan.

Koen - THAT'S what I was missing! Drop down menu to the right of
"Run" -- NOW it works great!

No Win 7 firewall issues

I'll worry about "running as a service" once I have something
worthwhile built! - thanks for the suggestion, Dan.

Only issue is when it now runs is EADRINUSE...
"warn - error raised: Error: EADDRINUSE, Address already in use"

I think I saw some reference to that in another thread but it clearly
works fine so I was going to ignore this

I had just assumed that "Run" by itself was sufficient. Is there some
beginners documentation that's BeagleBone specific? I see the Node.js
info and the Cloud9 home page but I got lost when they talked about
deploying it on their Cloud9 servers which clearly doesn't apply for
'Bone and what I missed.

I'm coming from Arduino and really looking forward to playing with the
power of Bone and good luck with Bonescript development

Richard