1

I am having hard time trying to find nodejs samples with the groovepi and pi 3. I want to do a simple hello world, I found a groovepi sample with intel edison but obviously that didnt work.

Doing a little of research, I found johny five library but that its only for arduino, but they are supposed to have plugins for other boards, like raspberry, so installed rasp-io, johnny five and tried to run this sample

var raspi = require('raspi-io');
var five = require('johnny-five');
var board = new five.Board({
io: new raspi()
});

board.on('ready', function() {

var lcd = new five.LCD({
controller: "JHD1313M1"
});

lcd.bgColor(r, g, b).cursor(0, 0).print(f);
});

I get this error:

pi@raspberrypi:~/share/Sample2 $ node index.js modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.26-v7+/modules.dep.bin' child_process.js:531 throw err; ^

Error: Command failed: modprobe i2c-dev modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.26-v7+/modules.dep.bin'

at checkExecSyncError (child_process.js:488:13) at execSync (child_process.js:528:13) at new I2C (/home/pi/share/Sample2/node_modules/raspi-i2c/lib/index.js:120:33) at new Raspi (/home/pi/share/Sample2/node_modules/raspi-io/lib/index.js:161:14) at Object. (/home/pi/share/Sample2/index.js:5:7) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) I want to do a simple hello world on the LCD display I got in they key

chrki
  • 6,143
  • 6
  • 35
  • 55
Luis Valencia
  • 32,619
  • 93
  • 286
  • 506

2 Answers2

1

Came across this issue and was scratching my head on what I did to generate the similar errors you have received about the "could not open moddep file".

What I did was reboot the device (mine is a raspberry pi) and the error went away. Why does a reboot fix address my situation I have no clue and requires someone much smarter than myself.

Hope this helps someone else who comes across this issue. See if a reboot addresses it.

Fifth Cloud
  • 110
  • 1
  • 9
0

Hmm.. (Scratching my head) I not sure.

You may not have the necessary permissions to access the file Using child_process