strange error when running simple *.js file setting a pin to output using beaglebone black Rev C.

Hello! How’s everything?

I encountered strange error when running simple *.js file
setting a pin to output using beaglebone black Rev C which I received this August.

I even reinstalled bonescript using
“npm install -g bonescript”
but still encounter the same error message.

led = “P9_11”, “9_12” worked
led = “P8_39”, “P8_40”, “P8_41”, and many other pins
do not work with error message listed below
following “simpleDigitalOut.js”:


var b = require(’/usr/local/lib/node_modules/bonescript’);

var led = “P8_41”;
b.pinMode(led, b.OUTPUT);

console.log(“end of program”);

root@beaglebone:/var/lib/cloud9/myProg# node simpleDigitalOut.js

if(slot[0]) {
TypeError: Cannot read property ‘0’ of null
at Object.exports.load_dt (/usr/local/lib/node_modules/bonescript/my.js:57:20)
at Object.exports.create_dt (/usr/local/lib/node_modules/bonescript/my.js:123:33)
at Object.exports.setPinMode (/usr/local/lib/node_modules/bonescript/hw_capemgr.js:83:12)
at Object.f.pinMode (/usr/local/lib/node_modules/bonescript/index.js:160:15)
at Object. (/var/lib/cloud9/myProg/simpleDigitalOut.js:4:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)

I googled but cannot find a solution to this problem.

It would be a great help if you can guide me through it.
your advice is very much appreciated.

Many thanks,
Fung Yang

Did you try the number zero rather than the letter Oh?


I use beaglebone-green and i try enable P8_15.

In folder /lib/firmware i found files bspm_P8_15_27-00A0.dts and bspm_P8_15_27-00A0.dtbo

I try enable PIN with command
echo bspm_P8_15_27 > /sys/devices/bone_capemgr.9/slots
but result was with error

Then I edit file bspm_P8_15_27-00A0.dts
change line
compatible = “ti,beaglebone”, “ti,beaglebone-black”;
compatible = “ti,beaglebone”, “ti,beaglebone-black”, “ti,beaglebone-green”;

Rebuilt file with command
dtc -@ -I dts -O dtb -o bspm_P8_15_27-00A0.dtbo bspm_P8_15_27-00A0.dts

Then I try command
echo bspm_P8_15_27 > /sys/devices/bone_capemgr.9/slots

and result is OK.

Content /sys/devices/bone_capemgr.9/slots is
0: 54:P—L 4D 7.0 LCD CAPE- 4DCAPE-70T ,00A3,4D SYSTEMS ,BB-BONE-LCD7-01
1: 55:PF—
2: 56:PF—
3: 57:PF—
4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
6: ff:P-O-L Override Board Name,00A0,Override Manuf,bspm_P8_15_27

Now i can use PIN P8_15.

Sorry for my english.

I wish help you.

Dne středa 20. srpna 2014 11:06:04 UTC+2 fung… napsal(a):