rwaldron / galileo-io

Intel Galileo & Intel Edison IO Plugin for Johnny-Five
http://johnny-five.io
MIT License
101 stars 26 forks source link

Pin name undefined? (Issues regarding a fork) #52

Open virgilvox opened 8 years ago

virgilvox commented 8 years ago

I get this error in my fork of galileo-io since I added pinModes for the intel joule.

Please see https://github.com/virgilvox/galileo-io

1471987477682 Device(s) unknown
1471987477686 Connected undefined
1471987477691 Repl Initialized
>> Ready!!
/home/root/.node_app_slot/node_modules/johnny-five/lib/board.pins.js:238
    return pin.name === needle || pin.id === needle || pin.port === needle;
              ^

TypeError: Cannot read property 'name' of undefined
    at /home/root/.node_app_slot/node_modules/johnny-five/lib/board.pins.js:238:15
    at Pins.findIndex (native)
    at Function.Pins.identity (/home/root/.node_app_slot/node_modules/johnny-five/lib/board.pins.js:237:23)
    at Pins.(anonymous function) [as isPwm] (/home/root/.node_app_slot/node_modules/johnny-five/lib/board.pins.js:256:40)
    at Led.Controllers.DEFAULT.initialize.value (/home/root/.node_app_slot/node_modules/johnny-five/lib/led/led.js:74:30)
    at new Led (/home/root/.node_app_slot/node_modules/johnny-five/lib/led/led.js:203:10)
    at Board.<anonymous> (/home/root/.node_app_slot/main.js:11:13)
    at emitNone (events.js:72:20)
    at Board.emit (events.js:166:7)
    at nextTickCallbackWith0Args (node.js:420:9)
rwaldron commented 8 years ago

If only I knew what code you ran that produced this result... :P

rwaldron commented 8 years ago

Looks like your condition that determines platform 13 is stuck inside the condition for platform 2

https://github.com/virgilvox/galileo-io/blob/42bd5502e39c774d4edefaa85b6a6082c6c17320/lib/index.js#L50-L129

virgilvox commented 8 years ago

I did fix that a few commits ago and still have the issue :/

Also used the blink example from galileo-io and changed the pin to 103 which corresponds to an onboard LED

rwaldron commented 8 years ago

It would be useful to me if whatever code you wanted me to look at was the most recent ;)

My guess is that you don't have an entry for that index. I don't know what else to say ¯(ツ)/¯ if I can't see the whole picture then I can't be any help. My joule came today but I can't get a serial connection.

virgilvox commented 8 years ago

It was current, its possible the history didnt show right away o.O

I suggest following the windows guide for updating the firmware. Rex said he has yet to update the guide for screen, I was recommended to try minicom on osx. - PM if you need help getting into it.

Want me to PR what I have if you're gonna hack on it anyway? Saves you the trouble of going through all the pins haha

rwaldron commented 8 years ago

I've pulled your branch locally and the first thing I noted was that the pinModes array had an entry at the zeroth index, but there is no pin 0, which I determined was actually the definition for pin 1. That meant that the whole array was "off by one" and since the definition for pin 103 was not actually at index 103, but "off by one" at index 102, the result was "undefined"

virgilvox commented 8 years ago

picardfacepalm.jpg

Have you given it a go on the board?

virgilvox commented 8 years ago

That fixed it :)

Blinking the onboard LEDs!

rwaldron commented 8 years ago

Have you given it a go on the board?

Yes. I have a branch ready for you right now actually (I had to write tests and what-not)

npm install rwaldron/galileo-io#joule

It's your branch with my changes, ready for testing

rwaldron commented 8 years ago

We'll close this when https://github.com/rwaldron/galileo-io/tree/joule lands

rwaldron commented 8 years ago

Just a heads up: Right now Johnny-Five not working correctly, but you can use galileo-io on its own. I will fix the issue shortly

rwaldron commented 7 years ago

Apparently, there are alot of regressions in the latest os image.

virgilvox commented 7 years ago

Such as ?

rwaldron commented 7 years ago