rwaldron/galileo-io

Pin name undefined? (Issues regarding a fork)

virgilvox opened this issue · 14 comments

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)

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

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

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

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.

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

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"

picardfacepalm.jpg

Have you given it a go on the board?

That fixed it :)

Blinking the onboard LEDs!

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

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

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

Such as ?