bonescript@0.7.4-beta1 published

219 views
Skip to first unread message

Jason Kridner

unread,
Oct 24, 2019, 2:01:25 PM10/24/19
to BeagleBoard
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 bones...@0.7.4-beta1                                                     
npm WARN deprecated coffee...@1.9.1: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated js...@3.2.6: Please use the native JSON object instead of JSON 3
npm WARN deprecated js...@3.3.2: Please use the native JSON object instead of JSON 3
col...@1.0.3 node_modules/winston/node_modules/colors -> node_modules/colors
cy...@1.0.3 node_modules/winston/node_modules/cycle -> node_modules/cycle
ey...@0.1.8 node_modules/winston/node_modules/eyes -> node_modules/eyes
isst...@0.1.2 node_modules/winston/node_modules/isstream -> node_modules/isstream
pkg...@0.3.1 node_modules/winston/node_modules/pkginfo -> node_modules/pkginfo
stack...@0.0.10 node_modules/winston/node_modules/stack-trace -> node_modules/stack-trace
/usr/local/lib
└─┬ bones...@0.7.4-beta1
  └── win...@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 fsev...@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-con...@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


jonnymo

unread,
Oct 25, 2019, 1:29:25 AM10/25/19
to Beagle Board
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


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/28ae9679-ddb7-42e3-9437-aa56dacb147d%40googlegroups.com.

jonnymo

unread,
Oct 26, 2019, 12:46:56 PM10/26/19
to Beagle Board
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

sjmi...@gmail.com

unread,
Oct 28, 2019, 5:19:40 AM10/28/19
to BeagleBoard
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.<anonymous> (/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
To unsubscribe from this group and stop receiving emails from it, send an email to beagl...@googlegroups.com.

sjmi...@gmail.com

unread,
Oct 28, 2019, 5:20:17 AM10/28/19
to BeagleBoard
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
Reply all
Reply to author
Forward
0 new messages