Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not interacting with matrix #14

Open
demipixel opened this issue Mar 31, 2017 · 8 comments
Open

Not interacting with matrix #14

demipixel opened this issue Mar 31, 2017 · 8 comments

Comments

@demipixel
Copy link

I'm using node v7.8.0 and the matrix doesn't appear to be lighting up no matter what I use. I've confirmed the size (32x32) and it's clear it's at least trying because it fails without sudo (i.e. requiring permissions, isn't just doing nothing).

I've essentially just been trying this:

> const LedMatrix = require('node-rpi-rgb-led-matrix')
undefined
> const matrix = new LedMatrix(32);
undefined
> matrix.getWidth()
32
> matrix.getHeight()
32
> matrix.fill(255, 50, 100);
undefined
> matrix.setPixel(0, 0, 255, 255, 255)
undefined

The python API works. The demos don't work if I directly go through node_module's into this library's rpi-rgb-led-matrix. Copying/linking to an existing (working) one makes the demos work at that location, but the node library still doesn't function.

No errors, hence why I'm confuzzled.

@zeitungen
Copy link
Owner

Unfortunately, I have only tested the lib with nodejs 0.10 ..
So, maybe, this lib doesn't work for now with recent nodejs version.

I hope I can manage in this few days some time to look into that problem ...

To reproduce this issue, can you tell me how you have install the lib into your project ? (via npm ? via git and github ?)

@demipixel
Copy link
Author

I'm using npm.

I'll try using an older version of node when I get the chance.

@michaelwschultz
Copy link

@demipixel did you ever have any luck with running an older version of Node?

I'm running 4.2.1 and am having similar issues. When I run as sudo, index runs but doesn't manipulate the board. When I run as a user I get /dev/mem Permission Denied.

@hzeller
Copy link
Contributor

hzeller commented Feb 19, 2018

Note, if you have a newer version of Raspbian, the old rpi-rgb-led-matrix library this node library is linked to will not work anymore.

I really strongly suggest to update this node library to use the latest version of rpi-rgb-led-matrix @zeitungen .

In the meantime: for newer Raspbian's to work, you need to change the == to a >= in the (mem_size == 0x3F000000) line in IsRaspberryPi() in lib/gpio.cc.

The Node library is linking a very old version of rpi-rgb-led-matrix; the line to change in that old version is here in lib/gpio:136.

(Note, I don't know if the Node version itself might have issues; probably this is just a property of newer Raspbians).

@michaelwschultz
Copy link

michaelwschultz commented Feb 19, 2018

@hzeller Thanks for the tip. No change in my error after changing that line. Still seeing...

/bin/sh: 1: nodejs: not found gyp: Call to 'nodejs -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp

Don't think it's related. Probably something to do with my node version. Currently trying Node 9.5.0.

Do you have a suggestion on which Node version might work with this?

@hzeller
Copy link
Contributor

hzeller commented Feb 19, 2018

Yeah, I can't help with Node.js stuff - I don't know Javascript or the Node environment.
The patch above just makes sure that the old matrix library will work on a new Raspbian.

@michaelwschultz
Copy link

@hzeller no worries. Really appreciate you writing back so quickly!

@hzeller
Copy link
Contributor

hzeller commented Feb 19, 2018

Same timezone helps I guess @michaelwschultz :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants