Tag: pi

当Nodejs应用程序开始使用Systemd时,Nodejs App不会产生pythonsubprocess

我想在启动时启动节点js应用程序。 因此我从Systemd启动一项服务: [Unit] Description=Node.js server After=network.target [Service] ExecStart=/usr/bin/node /var/www/Raspberry-Pi-Status/js/server.js Restart = always RestartSec=10 StandardOutput=syslog StandardError=syslog SyslogIdentifier=nodejs-server Environment=NODE_ENV=production PORT=8000 Environment=PYTHONPATH=/usr/bin/python [INSTALL] WantedBy=multi-user.target server.js看起来像这样: var util = require('util'), spawn = require('child_process').spawn, py = spawn('python',['temperature.py'],{detached: true}); var mysql = require('mysql'); var connection = mysql.createConnection({ host : 'localhost', user : 'monitor', password : 'password', database : 'temps'}); var app […]

Node.js,processing.js和没有浏览器

我想一起使用node.js和processing.js,并将canvas路由到X窗口。 基本上我想修补一些液晶显示器和树莓派,但我想用JavaScript来做一些整洁的东西,而不使用浏览器。 我想强调的是,我试图这样做,因为我想,不是为了别的原因,也不是为了其他人,尽pipe我全神贯注于替代品。 我要求更加不耐烦的大师温柔。 为了澄清(希望),我想使用node.js和processing.js来显示一些任意的JavaScript代码来连接networking和显示graphics,并将结果呈现给X而不是使用浏览器。 提前致谢!

Node.js树莓派上永远的错误

嘿所以我想在我的raspbian机器上运行一个节点服务器,每次我永远运行它会引发这个错误: 如果无法在树莓派上永远使用,我将如何手动编写守护程序脚本

树莓派安装sailsJS

我想在树莓派(B +,raspian)上安装Sails JS,但我有很多错误:/我安装NodeJS与本教程: http : //joshondesign.com/2013/10/23/noderpi 我们尝试 sudo su npm -g install sails 我有 : npm http 200 http://registry.npmjs.org/promised-io/-/promised-io-0.3.3.tgz npm ERR! Error: ENOENT, chown '/home/pi/node-v0.10.2-linux-arm-pi/lib/node_modules/sails/node_modules/grunt-contrib-watch/LICENSE-MIT' npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <npm-@googlegroups.com> npm ERR! System Linux 3.12.35+ npm […]

在启动节点JS

我正在运行一个覆盆子Pi B +的目的是在启动时运行节点js应用程序。 我在/etc/rc.local文件中使用命令su pi -c 'node /home/pi/bartender_main/app.js < /dev/null &' 。 当它启动时,它的行为就像它的工作,并给我我的迹象表明,它已经准备好了,但很快就会说董事会closures,并退出应用程序。 有没有人有任何想法。 谢谢

nodejs树莓串行端口不正确的数据

我想在Raspberry Pi 1上用nodeJs v0.12.6parsing串行数据。 数据正确与猫,但与nodeJs(serialPort模块) 数据确定与猫 stty -F /dev/ttyAMA0 1200 sane evenp parenb cs7 -crtscts cat /dev/ttyAMA0 给 MOTDETAT 000000 B ADCO XXXXXXXXXXX> OPTARIF HC.. < ISOUSC 30 9 HCHC 042116615 HCHP 034246387 8 PTEC HP.. IINST 001 X IMAX 009 H HHPHC C . MOTDETAT 000000 B ADCO XXXXXXXXXXXX> 结果为CR-ETX-STX-LF ,其中程序段分隔符为CR-ETX-STX-LF 2.数据与nodeJs不正确 我的nodeJs服务器 var […]

需要npm包后出错

我试图在树莓派上运行一个电子应用程序。 当我在我的代码中使用var TJBot = require('tjbot')来导入节点包时,会出现以下错误: ## There is an issue with `node-fibers` ## `/Users/apple/app/node_modules/asyncawait/node_modules/fibers/bin/darwin-x64-53/fibers.node` is missing. Try running this to fix the issue: /Users/apple/app/node_modules/electron/dist/Electron/ app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper /Users/apple/app/node_modules/ asyncawait/node_modules/fibers/build Uncaught Error: Missing binary. See message above. at Object.<anonymous> (/Users/apple/app/node_modules/asyncawait/node_modules/fibers/fibers.js:20:8) at Object.<anonymous> (/Users/apple/app/node_modules/asyncawait/node_modules/fibers/fibers.js:26:3) 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) 如果我删除这条线或运行它没有使用电子,一切工作正常,所以我不知道如果这个节点库有问题或它是由电子 […]

npm在树莓派上发布CERT_NOT_YET_VALID

无法得到覆盆子pi到npm install任何东西! pi@raspberrypi ~/raspi-helloworld $ npm install serialport npm WARN package.json raspi-helloworld@0.0.0 No README.md file found! npm http GET http://registry.npmjs.org/serialport npm http 304 http://registry.npmjs.org/serialport npm http GET http://registry.npmjs.org/sf/0.1.6 npm http GET http://registry.npmjs.org/optimist npm http GET http://registry.npmjs.org/nan npm http GET http://registry.npmjs.org/node-pre-gyp npm http GET http://registry.npmjs.org/bindings/1.1.1 npm http GET http://registry.npmjs.org/async/0.1.18 npm http 304 http://registry.npmjs.org/optimist npm http 304 […]

如何在树莓派上播放声音 – 启动后无需login

我需要用一个node.js脚本在树莓派上播放声音。 当我从命令行自己启动脚本时,一切正常。 当我启动后运行相同的脚本出/etc/rc.local脚本时,我看到我的运行过程时做“PS辅助”,但我不能听到任何声音。 我也尝试在40秒后启动节点脚本,因为我认为有一些初始化的东西或东西的时间太less,但在这段时间内,我可以从命令行启动脚本,听到声音… 我试了两个用户:root和pi。 他们都从cmd工作(因为自动启动后运行脚本的用户是root用户) 我把我的程序链接到/ usr / bin / node,因为如果不是这个进程不能在启动时启动的话。 我强制raspberryPi使用sereo插孔:amixer cset numid = 3 1 我的node.js代码是: var fs = require("fs"); var lame = require("lame"); var Speaker = require("speaker"); var SerialPort = require("serialport").SerialPort; var playing = false; var stream = []; stream[0] = "sound1.mp3"; stream[1] = "sound2.mp3"; stream[2] = "sound3.mp3"; stream[3] = "sound4.mp3"; […]

Raspberry-pi mqttc.publish()在20个条目后出现节点红色溢出

我正在使用我的Python代码通过mqttc发布消息到节点红色。 问题是在20 mqttc发布之后,数据不会发布到node-red。 这里是我用来发布到node-red的python代码: mqttc.connect("nodered&mqtt_server_ip",1883) i=1 while True: i=i+1 mqttc.publish("sensor",i,1) time.sleep(1) 我也试过: i=1 while True: mqttc.connect("nodered&mqtt_server_ip",1883) i=i+1 mqttc.publish("sensor",i,1) mqttc.disconnect() time.sleep(1) 无论如何,代码发布到节点红色的前20个值,然后停止。 我的节点红色工作stream程如下。