简体   繁体   English

在Windows / Ubuntu上编写Node.js raspberrypi程序

[英]writing node.js raspberrypi programs on windows/ubuntu

I've spent the past two days trying to get the node wiring-pi module running on either windows or ubuntu. 在过去的两天中,我一直在尝试使节点connection-pi模块在Windows或ubuntu上运行。 It installed no problem on my RaspberryPi, but developing on RPi isn't ideal. 它在我的RaspberryPi上没有安装任何问题,但是在RPi上进行开发并不是理想的选择。 After a ton of error messages that don't lead me very close to a solution, I'm beginning to realize that trying to set-up a node module which was designed to run on an ARM processor and getting it working on an x86 machine for development may not be the best idea. 在出现大量错误消息并不能使我非常接近解决方案之后,我开始意识到,尝试设置一个旨在在ARM处理器上运行的节点模块并使它在x86机器上运行发展也许不是最好的主意。

Has anybody else dealt with this sort of thing before? 以前有人处理过这种事情吗? How do you write your ARM based programs in an x86 environment? 您如何在x86环境中编写基于ARM的程序? Developing directly on the Pi has it's own set of issues. 直接在Pi上进行开发有其自身的问题。

What I was thinking of doing was to require the wiring-pi module like this 我当时想做的是需要这样的connection-pi模块

var wpi = require('wiring-pi')|| { //recreate the required wiring-pi methods for testing on x86};

however, that would mean my npm install would also fail, or need to be different depending on if I was building directly on the raspberyPi or on the windows/ubuntu x86 system. 但是,这意味着我的npm安装也将失败,或者需要更改,这取决于我是直接在raspberyPi还是在Windows / ubuntu x86系统上构建。

Anybody else have another solution to working around these sorts of issues? 还有其他人可以解决此类问题吗?

I have the same problem, and came to the same realization that trying to get the ARM modules working on X86 was not feasible. 我遇到了同样的问题,并且得到了同样的认识,即试图使ARM模块在X86上运行是不可行的。 Hopefully your Raspberry Pi specific calls are isolated in a module that you can then easily replace on x86. 希望您的Raspberry Pi特定调用隔离在一个模块中,然后可以在x86上轻松替换。 I've not found a more clever solution than that. 我没有找到比这更聪明的解决方案了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM