Yun 17.11 Reboot prerelease

GPIO /PWM FROM NODEJS :

As I said, i'm a nodejs dev and with the earlier versions (LININO), I could access gpio & pwm pins directly from my node js scripts :
The best way to do that for me was using lininoio method http://wiki.linino.org/doku.php?id=wiki:upgradetolininoio :
the command 'lininoio start' upload a 'bathos-xxx.hex' sketch. and change 'Arduino console to 'spicons' and other things that I didn't succès to redo, but with lininoio I could acces gpio pin directly with linux command as explained here http://wiki.linino.org/doku.php?id=wiki:lininoio_sysfs
Is there a way to access the arduino pins (gpio, pwm...) in the same way with the new Reboot 17-11 ?
It would be a good thing for me if I could :wink: .

Because I was blocked, I tried to use cylon Arduino YUN with Cylon.js and Cylon.js Fun With The Arduino Yun

with this simple script :

var Cylon = require('cylon');

Cylon.robot({
connections: {
arduino: { adaptor: 'firmata', port: '/dev/ttyATH0' }
},

devices: {
led: { driver: 'led', pin: 13 }
},

work: function(my) {
every((1).second(), function(){
my.led.toggle();
});
}
}).start();

so I have installed node-cylon-firmata :
...
Downloading http://downloads.arduino.cc/openwrtyun/17.11/packages/packages/mips_24kc/packages/node-cylon_0.22.0-7_mips_24kc.ipk
[...]
Configuring node-cylon.
Configuring node-arduino-firmata.
Configuring node-cylon-i2c.
Configuring node-cylon-gpio.
Configuring node-cylon-firmata.
root@Arduino:~# node cylontest.js
Cannot find the 'cylon-firmata' module.
This problem might be fixed by installing it with 'npm install cylon-firmata' and trying again.
Terminated

but cylon-firmata is not found : I thought that node-cylon-firmata was the remplacement of cylon-firmata but ???


So I installed 'cylon-firmata' 'firmata' as describe here https://cylonjs.com/documentation/platforms/yun/
installing on my windows (uninstall node 9 & install node 6), then transfering with winscp : 

mkdir cyloninstall
cd cyloninstall
npm init
npm install firmata

remove cylonfirmata/serialport , then transfert to /usr/lib/node

and then .... got that : 

root@Arduino:~# opkg install node-cylon
Installing node-cylon (0.22.0-7) to root...
Downloading http://downloads.arduino.cc/openwrtyun/17 .11/packages/packages/mips_24kc/packages/node-cylon_0 .22.0-7_mips_24kc.ipk
Installing node (v6.11.2-3) to root...
Downloading http://downloads.arduino.cc/openwrtyun/17 .11/packages/packages/mips_24kc/packages/node_v6.11.2 -3_mips_24kc.ipk
Installing node-npm (v6.11.2-3) to root...
Downloading http://downloads.arduino.cc/openwrtyun/17 .11/packages/packages/mips_24kc/packages/node-npm_v6. 11.2-3_mips_24kc.ipk
Configuring node.
Configuring node-npm.
Configuring node-cylon.
root@Arduino:~# opkg install node-cylon-firmata
Installing node-cylon-firmata (0.22.0-7) to root...
[...]
Configuring node-serialport.
Configuring node-arduino-firmata.
Configuring node-cylon-i2c.
Configuring node-cylon-gpio.
Configuring node-cylon-firmata.
root@Arduino:~# touch cylontest.js
root@Arduino:~# node cylontest.js
(node) v8::ObjectTemplate::Set() with non-primitive v alues is deprecated
(node) and will stop working in the next major releas e.

==== JS stack trace ================================= ========

Security context: 0x5be2a925 #0#
1: .node [module.js:597] [pc=0x5e763744] (this=0x 5bef84dd <an Object with map 0x2341fde1>#1#,module=0x 57edb2b5 <a Module with map 0x234206fd>#2#,filename=0 x57eda53d <String[54]: /usr/lib/node/serialport/build /Release/serialport.node>)
2: load [module.js:487] [pc=0x236e8bb8] (this=0x5 7edb2b5 <a Module with map 0x234206fd>#2#,filename=0x 57eda53d <String[54]: /usr/lib/node/serialport/build/ Release/serialport.node>)
3: tryModuleLoad(aka tryModuleLoad) [module.js:44 6] [pc=0x236e8480] (this=0x5be08121 ,modul e=0x57edb2b5 <a Module with map 0x234206fd>#2#,filena me=0x57eda53d <String[54]: /usr/lib/node/serialport/b uild/Release/serialport.node>)
[...]
71: /* anonymous /(aka / anonymous /) [module.j s:604] [pc=0x236d570c] (this=0x5be08121 )
72: run(aka run) [bootstrap_node.js:389] [pc=0x236 d5514] (this=0x5be08121 ,entryFunction=0x5 bed0565 <JS Function Module.runMain (SharedFunctionIn fo 0x5bebadcd)>#41#)
73: startup(aka startup) [bootstrap_node.js:149] [ pc=0x236919b0] (this=0x5be08121 )
74: /
anonymous /(aka / anonymous */) [bootstra p_node.js:504] [pc=0x2368e6e4] (this=0x5be08109 ,process=0x5bef8ab9 <a process with map 0x23413705># 42#)

I, [2017-12-15T00:16:55.648Z] INFO -- : [Robot 1] - Starting connections.
/usr/lib/node/firmata/lib/firmata.js:554
this.transport = new com.SerialPort(port, setting s.serialport);
^

TypeError: com.SerialPort is not a constructor
at new Board (/usr/lib/node/firmata/lib/firmata.j s:554:22)
at Adaptor.connect (/usr/lib/node/cylon-firmata/l ib/firmata.js:42:16)
at Robot. (/usr/lib/node/cylon/lib/rob ot.js:299:27)
at /usr/lib/node/cylon/lib/utils/helpers.js:237:3 6
at Array.forEach (native)
at Object.parallel (/usr/lib/node/cylon/lib/utils /helpers.js:237:13)
at Robot.startConnections (/usr/lib/node/cylon/li b/robot.js:303:12)
at next (/usr/lib/node/cylon/lib/utils/helpers.js :266:22)
at Object.series (/usr/lib/node/cylon/lib/utils/h elpers.js:270:3)
at Robot.start (/usr/lib/node/cylon/lib/robot.js: 235:5)
at Object. (/root/cylontest.js:17:4)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:1 0)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
root@Arduino:~#


trying to put the 'serialport' from the 'firmata' folder & got this : 

root@Arduino:~# node cylontest.js
It looks like serialport didn't compile properly. This is a common problem and its fix is well documented here https://github.com/voodootikigod/node-serialport#to-install
The result of requiring the package is: undefined

/usr/lib/node/cylon/lib/registry.js:39
throw e;
^
Missing serialport dependency
root@Arduino:~#

no more idea I'm blocked.

It was so simple with the lininoio method !!!
HOW COULD I 'SIMPLY' ACCESS GPIO/ PWM from the nodejs programs I've developped ???????????

DOn't please tell me it's not possible...