Currently I am playing with Bonescript with BB.
I'll assume BB = BeagleBone, since that is the only board supported by
Bonescript currently (though others are planned).
When I tried to run
blinkled.js, a message ‘optional package ‘./misc’ not loaded’ showed up and
the program stopped. If I commented out the lines with misc in index.js,
then the message is gone, but the led did not blink and the program stopped
after one second.Actually before I updated bonescript, blinkled.js ran quite well. Anything
new in the lastest bonescript may cause this problem.
misc.node includes some native C routines that are required for some
of the Bonescript functions now. I've changed it to be required,
instead of optional. index.js doesn't have a direct dependency on
'misc' and uses the 'myrequire' function [1] to have alternate
implementations, but 'gpioint.js' has a hard requirement [2].
You should see misc.node under
node_modules/bonescript/build/Release/misc.node. Also, you shouldn't
see a "require('./misc')" anywhere; it should be
"require('./build/Release/misc')".
Can you tell me the revision of Bonescript you are using? What I'd
want is the git commit id via something like 'git show | head'. It
should be 'debd593b47b85cab58f69a8b526160e3754e5bb5', which is about 2
months old and includes the OSCON demo [3].
If not, can you find the offending line and tell me what file it is
in? The file that gets loaded is 'misc.node' which should be under
that build/Release folder or can be built using node-waf and the
provided wscript build file. npm will also build the script if you
used that to install Bonescript yourself, rather than using the
pre-installed version in /var/lib/cloud9 directory on the shipping
Angstrom Distribution image.
[1] https://github.com/jadonk/bonescript/blob/master/node_modules/bonescript/index.js#L33
[2] https://github.com/jadonk/bonescript/blob/master/node_modules/bonescript/gpioint.js#L2
[3] http://beaglebone.local/oscon.html