rwaldron / nino-io

Linino One & Arduino Yun IO Plugin for Johnny-Five
http://johnny-five.io
MIT License
8 stars 2 forks source link

LininoIO - TypeError: Bad argument #6

Closed Elpayet closed 8 years ago

Elpayet commented 8 years ago

Hi,

Since last feedbacks of similar problems were posted already a few times ago, and since I'm actually not sure they are related, I decided to open a new one.

Here is my test on the YUN / LininoIO (tested with lininoio start and stop) of nino-io :

root@arduino:/data/workspace# cat ./b
blink_j5.js  board
root@arduino:/data/workspace# cat ./blink_j5.js
var five = require("johnny-five");
var Nino = require("nino-io");
var board = new five.Board({
  io: new Nino({
     layout: "Arduino Yun"
  })
});

board.on("ready", function() {
  console.log("Ready");
  var led = new five.Led(13);
  led.blink(500);
});

And here is the output :1234:

root@arduino:/data/workspace# node blink_j5.js
1468187976960 Device(s) Arduino Yun
Failed to export PWM: (ENOENT ENOENT, open '/sys/class/pwm/pwmchip0/export') { ENA: true,
  DEF: 'D3',
  TYP: 'digital',
  NUM: '116',
  MAP: 'D3',
  servo: null,
  pwm:
   { ENA: true,
     DEF: 'P3',
     TYP: 'pwm',
     MAP: 'D3',
     BIT: '8',
     NUM: '0',
     TIM: { DEF: 'T0', SET: false, USE: [], SHARED: false },
     MAX: 4000000,
     RES: 15625 } }
Failed to export PWM: (ENOENT ENOENT, open '/sys/class/pwm/pwmchip0/export') { ENA: true,
  DEF: 'D5',
  TYP: 'digital',
  NUM: '114',
  MAP: 'D5',
  servo:
   { ENA: true,
     DEF: 'P5',
     TYP: 'pwm',
     MAP: 'D5',
     BIT: '16',
     NUM: '4',
     TIM: { DEF: 'T1', SET: false, USE: [], SHARED: false },
     MAX: 32768000,
     RES: 500 },
  pwm:
   { ENA: true,
     DEF: 'P5',
     TYP: 'pwm',
     MAP: 'D5',
     BIT: '16',
     NUM: '4',
     TIM: { DEF: 'T1', SET: false, USE: [], SHARED: false },
     MAX: 32768000,
     RES: 500 } }
Failed to export PWM: (ENOENT ENOENT, open '/sys/class/pwm/pwmchip0/export') { ENA: true,
  DEF: 'D6',
  TYP: 'digital',
  NUM: '123',
  MAP: 'D6',
  servo: null,
  pwm:
   { ENA: true,
     DEF: 'P6',
     TYP: 'pwm',
     MAP: 'D6',
     BIT: '16',
     NUM: '5',
     TIM: { DEF: 'T2', SET: false, USE: [], SHARED: false },
     MAX: 16384000,
     RES: 64000 } }
Failed to export PWM: (ENOENT ENOENT, open '/sys/class/pwm/pwmchip0/export') { ENA: true,
  DEF: 'D9',
  TYP: 'digital',
  NUM: '105',
  MAP: 'D9',
  servo:
   { ENA: true,
     DEF: 'P9',
     TYP: 'pwm',
     MAP: 'D9',
     BIT: '16',
     NUM: '1',
     TIM: { DEF: 'T3', SET: false, USE: [], SHARED: true },
     MAX: 32768000,
     RES: 500 },
  pwm:
   { ENA: true,
     DEF: 'P9',
     TYP: 'pwm',
     MAP: 'D9',
     BIT: '16',
     NUM: '1',
     TIM: { DEF: 'T3', SET: false, USE: [], SHARED: true },
     MAX: 32768000,
     RES: 500 } }
Failed to export PWM: (ENOENT ENOENT, open '/sys/class/pwm/pwmchip0/export') { ENA: true,
  DEF: 'D10',
  TYP: 'digital',
  NUM: '106',
  MAP: 'D10',
  servo:
   { ENA: true,
     DEF: 'P10',
     TYP: 'pwm',
     MAP: 'D10',
     BIT: '16',
     NUM: '2',
     TIM: { DEF: 'T3', SET: false, USE: [], SHARED: true },
     MAX: 32768000,
     RES: 500 },
  pwm:
   { ENA: true,
     DEF: 'P10',
     TYP: 'pwm',
     MAP: 'D10',
     BIT: '16',
     NUM: '2',
     TIM: { DEF: 'T3', SET: false, USE: [], SHARED: true },
     MAX: 32768000,
     RES: 500 } }
Failed to export PWM: (ENOENT ENOENT, open '/sys/class/pwm/pwmchip0/export') { ENA: true,
  DEF: 'D11',
  TYP: 'digital',
  NUM: '107',
  MAP: 'D11',
  servo:
   { ENA: true,
     DEF: 'P11',
     TYP: 'pwm',
     MAP: 'D11',
     BIT: '16',
     NUM: '3',
     TIM: { DEF: 'T3', SET: false, USE: [], SHARED: true },
     MAX: 32768000,
     RES: 500 },
  pwm:
   { ENA: true,
     DEF: 'P11',
     TYP: 'pwm',
     MAP: 'D11',
     BIT: '16',
     NUM: '3',
     TIM: { DEF: 'T3', SET: false, USE: [], SHARED: true },
     MAX: 32768000,
     RES: 500 } }
Failed to export ADC: (ENOENT ENOENT, open '/sys/bus/iio/devices/iio:device0/enable')
1468187977676 Connected Arduino Yun
1468187977817 Repl Initialized
>> Ready

TypeError: Bad argument
    at Object.fs.write (fs.js:513:11)
    at Pin.write (/data/node_modules/nino-io/lib/nino-io.js:989:6)
    at Nino.digitalWrite (/data/node_modules/nino-io/lib/nino-io.js:467:23)
    at Led.Controllers.DEFAULT.write.value (/data/node_modules/johnny-five/lib/led/led.js:110:19)
    at Led.Controllers.DEFAULT.update.value (/data/node_modules/johnny-five/lib/led/led.js:101:14)
    at Led.on (/data/node_modules/johnny-five/lib/led/led.js:239:8)
    at Led.toggle (/data/node_modules/johnny-five/lib/led/led.js:263:40)
    at Led.<anonymous> (/data/node_modules/johnny-five/lib/led/led.js:480:10)
    at wrapper [as _onTimeout] (timers.js:252:14)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

The output suggests that the connection to the YUN was actually established, so I guess that my setup is correct, but if you have any suggestion, it will be very welcome :)

Thanks

rwaldron commented 8 years ago

Thanks for the report. Unfortunately the folks that make the Arduino Yun and LininoIO have failed to provide me with any answers as to why the Yun doesn't actually work. Over the last two years I've repeatedly emailed them for help with this and the best response I received was that they sent me a box containing several Linino One boards & add-ons.

I should've updated this project a long time ago and I'm sorry that I didn't and that you were mislead :(

rwaldron commented 8 years ago

W/r to the error yours seeing: it's "connected" because it's running on the board. Unfortunately, everything has failed to initialize. I've never been able to get a straight answer about it from the LininoOS team