RE: Making uEnv.txt Suit My Needs and Running Software/How Do I Put 'bonescript' in My Path...

49 views
Skip to first unread message

Mala Dies

unread,
Aug 12, 2017, 10:00:05 PM8/12/17
to BeagleBoard
Hello,

As many of us already know, I am working with the TMP36 and failing harder than ever for some reason on my BBB. I just noticed my error code for the software. It is stating that the BBB cannot find the 'bonescript' language that I am invoking. 

Seth

P.S. How can I put the 'bonescript' language in my PATH so when I run the .js file, 'bonescript' is "noticed" and can be used? I am working directly in the /home/debian directory. Send guidance or assistance, i.e. either/or. 

Dennis Lee Bieber

unread,
Aug 13, 2017, 1:40:27 PM8/13/17
to beagl...@googlegroups.com
On Sat, 12 Aug 2017 19:00:05 -0700 (PDT), Mala Dies
<fun...@gmail.com> declaimed the following:

>Hello,
>
>As many of us already know, I am working with the TMP36 and failing harder
>than ever for some reason on my BBB. I just noticed my error code for the
>software. It is stating that the BBB cannot find the 'bonescript' language
>that I am invoking.

Cut & paste the exact error message (along with the command line being
used to invoke the program).

Bonescript is not a "language" per se, so much as an import
library/module for node.js which activates access to the BBB hardware. It
corresponds to the Python BBIO (various over the years) library.

>
>Seth
>
>P.S. How can I put the 'bonescript' language in my PATH so when I run the
>.js file, 'bonescript' is "noticed" and can be used? I am working directly
>in the /home/debian directory. Send guidance or assistance, i.e. either/or.

If the bonescript module is not being found by node.js, that is one
thing, and changing your normal PATH variable probably won't help -- PATH
tells the OS where to look for executable programs; where those programs
look for import libraries is a different matter. If node.js is not being
found, then your PATH is likely really trashed, since it should be in one
of the standard directories (/bin, /usr/bin, etc.)

root@ELUSIVEUNICORN:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

(the above is from Windows 10 "BASH on Ubuntu on Windows" add-in, Debian
should be similar)


Seeing the exact error message would help identify the type of problem
you have.

Unfortunately I can't help with node.js -- the whole way of programming
in it just doesn't fit my mindset. A problem with Python would be more in
my realm.

--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Mala Dies

unread,
Aug 13, 2017, 1:54:09 PM8/13/17
to BeagleBoard
Hello,

Here is the error message when I use sudo node tryTemp.js to run the .js file on my BBB in PuTTY. 

module.js:491
    throw err;
    ^

Error: Cannot find module 'bonescript'
    at Function.Module._resolveFilename (module.js:489:15)
    at Function.Module._load (module.js:439:25)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/debian/tryTemp.js:1:71)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)

Oh and sir, the software I am using to invoke 'bonescript' is:

var b = require('bonescript');

function readTemp() {
    b.analogRead('P9_40', displayTemp);
}

function displayTemp(reading) {
    var millivolts = reading.value * 1800;
    var Celsius = (millivolts - 500) / 10;
    var Fahrenheit = (Celsius * 9/5) + 32
    console.log("Celsius=" + Celsius + "/tFahrenheit=" + Fahrenheit;
}

setInterval(readTemp, 8000);

Seth

P.S. Thank you for any support. 

Robert Nelson

unread,
Aug 13, 2017, 2:03:04 PM8/13/17
to Beagle Board, Mala Dies
export NODE_PATH=/usr/local/lib/node_modules

Regards,

--
Robert Nelson
https://rcn-ee.com/

Mala Dies

unread,
Aug 13, 2017, 2:05:51 PM8/13/17
to BeagleBoard, fun...@gmail.com
Hello,

Thank you again, sir.

Seth

Dennis Lee Bieber

unread,
Aug 13, 2017, 2:40:53 PM8/13/17
to beagl...@googlegroups.com
On Sun, 13 Aug 2017 10:54:08 -0700 (PDT), Mala Dies
<fun...@gmail.com> declaimed the following:

>Hello,
>
>Here is the error message when I use *sudo node tryTemp.js* to run the .js
>file on my BBB in PuTTY.
>
Hmmm, I thought more recent OS had renamed "node" to "nodejs" due to a
conflict with an amateur radio packet program.


>module.js:491
> throw err;
> ^
>
>Error: Cannot find module 'bonescript'

Not a PATH error itself -- PATH found node.js (by whatever name).

I'd have to study node.js documentation to find the answer (but since I
peaked ahead, I won't bother -- I'll just save that answer to my own
archive for future)

Mala Dies

unread,
Aug 13, 2017, 5:48:28 PM8/13/17
to BeagleBoard, fun...@gmail.com
Hello Sir,

I tried this out. I used that BASH command and it did not locate my node_modules under /usr/local/lib for some reason. I have the 2 GB version: Linux beaglebone 4.9.37-ti-r47 #1 SMP PREEMPT Thu Jul 13 22:48:49 UTC 2017 armv7l GNU/Linux. Should I update to the latest release of Stretch?

Seth

P.S. I do not even have node on my system right now for some reason. Oh and I do not have bonescript located anywhere on my machine either. This is the issue since I am using an invocation of 'bonescript' via var b = require('bonescript'); in a .js file.


On Sunday, August 13, 2017 at 1:03:04 PM UTC-5, RobertCNelson wrote:
Reply all
Reply to author
Forward
0 new messages