简体   繁体   中英

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. It installed no problem on my RaspberryPi, but developing on RPi isn't ideal. 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.

Has anybody else dealt with this sort of thing before? How do you write your ARM based programs in an x86 environment? Developing directly on the Pi has it's own set of issues.

What I was thinking of doing was to require the wiring-pi module like this

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.

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. Hopefully your Raspberry Pi specific calls are isolated in a module that you can then easily replace on x86. I've not found a more clever solution than that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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