bonescript@0.7.4-beta1 published

Realized I hadn’t published the work already done on putting BeagleBone AI GPIO pins into the node.js BoneScript library.

Any testing on this version would really be appreciated.

debian@beaglebone:/var/lib/cloud9/sensors$ cd /usr/local/lib
debian@beaglebone:/usr/local/lib$ sudo npm install --unsafe-perm bonescript@0.7.4-beta1
npm WARN deprecated coffee-script@1.9.1: CoffeeScript on NPM has moved to “coffeescript” (no hyphen)
npm WARN deprecated json3@3.2.6: Please use the native JSON object instead of JSON 3
npm WARN deprecated json3@3.3.2: Please use the native JSON object instead of JSON 3
colors@1.0.3 node_modules/winston/node_modules/colors → node_modules/colors
cycle@1.0.3 node_modules/winston/node_modules/cycle → node_modules/cycle
eyes@0.1.8 node_modules/winston/node_modules/eyes → node_modules/eyes
isstream@0.1.2 node_modules/winston/node_modules/isstream → node_modules/isstream
pkginfo@0.3.1 node_modules/winston/node_modules/pkginfo → node_modules/pkginfo
stack-trace@0.0.10 node_modules/winston/node_modules/stack-trace → node_modules/stack-trace
/usr/local/lib
└─┬ bonescript@0.7.4-beta1
└── winston@2.1.1

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“arm”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: xpc-connection@~0.1.4 (node_modules/sensortag/node_modules/noble/node_modules/xpc-connection):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for xpc-connection@0.1.4: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“arm”})
npm WARN enoent ENOENT: no such file or directory, open ‘/usr/local/lib/package.json’
npm WARN lib No description
npm WARN lib No repository field.
npm WARN lib No README data
npm WARN lib No license field.
debian@beaglebone:/usr/local/lib$ node -pe "require(‘bonescript’).bone.getPinObject(‘p9.15’).ai.gpio"
76

Thanks so much! This will help my Element14 Contest immensely!

blinkLED.js works with p9.15.

You wouldn’t have a PWM out and analog in mapping would you?

Thanks,
Sean

Jason,

I added this to my BB AI and ran the .js script from the Cloud9 IDE and it did in fact blink an LED connected to P9.15 as well as the usrx LEDs.

Now, I did set P9.15 as an Output pin in the am5729-beagleboneai.dts file so I am not sure if this is necessary in this case.

Also, from the Cloud9 IDE, the nodejs script stays active and causes the BB AI to become very in console response.
This is what is left behind.

debian@beaglebone:~/developement$ ps -aef |grep .js
root 569 1 0 21:44 ? 00:00:01 /usr/bin/nodejs autorun.js
debian 22055 1 2 22:18 ? 00:00:06 /usr/bin/nodejs server.js --packed -w /var/lib/cloud9
debian 22105 22055 1 22:18 ? 00:00:03 /opt/cloud9/.c9/node/bin/node /opt/cloud9/build/standalonebuild/node_modules/vfs-child/child.js {“root”:"/",“metapath”:"/.c9/metadata",“wsmetapath”:"/.c9/metadata/workspace",“readOnly”:false,“debug”:false,“homeDir”:"/home/debian",“projectDir”:"/var/lib/cloud9",“nakBin”:"/opt/cloud9/build/standalonebuild/node_modules/nak/bin/nak",“nodeBin”:["/opt/cloud9/.c9/node/bin/node","/usr/bin/nodejs"],“tmuxBin”:"/usr/bin/tmux",“defaultEnv”:{“CUSTOM”:43},“inProcess”:false}

Perhaps there is a way to reset the function of the usrx LEDs after the script runs?

Cheers,

Jon

After a fresh reboot, I get the following error on first run of blinkLED.js, but it then runs fine when I run again until the next reboot:

Debugger listening on 127.0.0.1:15454
fs.js:642
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^

Error: EACCES: permission denied, open ‘/sys/class/gpio/gpio122/direction’
at Error (native)
at Object.fs.openSync (fs.js:642:18)
at Object.fs.writeFileSync (fs.js:1356:33)
at Object.exportGPIOControls (/usr/local/lib/node_modules/bonescript/src/hw_mainline.js:231:8)
at Object.f.pinMode (/usr/local/lib/node_modules/bonescript/src/index.js:234:19)
at Object. (/var/lib/cloud9/BeagleBone/AI/blinkLED.js:16:7)
at Module._compile (module.js:577:32)
at Object.Module._extensions…js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)

Process exited with code: 1

-Sean

I found if I remove all of the usrx LED entries in the blinkLED.js except usr3 and the system does not seem to become unresponsive after running the example. I did move to P8_23 gpio22 to attempt to set a PWM pin for anther example.
Ex:

const leds = [“USR3”, “P8_23”];
//const leds = [“USR0”, “USR1”, “USR2”, “USR3”, “P9_15”];

Cheers,

Jon