nodejs beaglebone black can't use serialport module



down votefavorite


|


I’m trying to make a device with Beaglebone black, Spi screen and serial nfc. I’m using an old debian image required by the screen ( Linux 3 8 13-bone50 ). I’have my linux desktop displaying fine on my screen. For making my IHM, I’m intended to using NWjs as I 'm used to. But i can’t because of the arch i’m on (arm).



I discovered electron and saw that can recompile modules including native nodejs modules. The problem I encounter is that I can’t get working serialport in my project.



here is the full transcript of terminal informations:



http://pastebin.com/B4DiPead








Any idea of what append ?


|

"error: #error This version of node/NAN/v8 requires a C++11 compiler"

As your running wheezy, there really isn't a quick/easy option...

Build clang-3.4:

Install: devscripts (sudo apt-get install devscripts)

dget
http://http.debian.net/debian/pool/main/l/llvm-toolchain-3.4/llvm-toolchain-3.4_3.4.2-13.dsc

cd ./llvm-toolchain-3.4-3.4.2/

debuild -us -uc

install all "unmet build dependencies"

debuild -us -uc

(it will take a while, and lots of disk space (no eMMC) 8GB->16GB should be
fine)

Then just:

  export CC=/usr/bin/clang
  export CXX=/usr/bin/clang++

Regards,

thanks for that fast answer but i get :

root@beaglebone:/clang# cd ./llvm-toolchain-3.4-3.4.2/
-bash: cd: ./llvm-toolchain-3.4-3.4.2/: No such file or directory
root@beaglebone:/clang# ^C
root@beaglebone:/clang# sudo dget http://http.debian.net/debian/
pool/main/l/llvm-toolchain-3.4/llvm-toolchain-3.4_3.4.2-13.dsc

root user and using sudo... two wrongs don't make it right...

call dget as a normal user, and don't use sudo for that..

dget: retrieving http://http.debian.net/debian/
pool/main/l/llvm-toolchain-3.4/llvm-toolchain-3.4_3.4.2-13.dsc
  % Total % Received % Xferd Average Speed Time Time Time
Current
                                 Dload Upload Total Spent Left
Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
  0
100 5829 100 5829 0 0 20013 0 --:--:-- --:--:-- --:--:--
20013
dget: using existing llvm-toolchain-3.4_3.4.2.orig-
clang-tools-extra.tar.bz2
dget: using existing llvm-toolchain-3.4_3.4.2.orig-clang.tar.bz2
dget: using existing llvm-toolchain-3.4_3.4.2.orig-compiler-rt.tar.bz2
dget: using existing llvm-toolchain-3.4_3.4.2.orig-lldb.tar.bz2
dget: using existing llvm-toolchain-3.4_3.4.2.orig-polly.tar.bz2
dget: using existing llvm-toolchain-3.4_3.4.2.orig.tar.bz2
dget: using existing llvm-toolchain-3.4_3.4.2-13.debian.tar.xz
llvm-toolchain-3.4_3.4.2-13.dsc:
dscverify: llvm-toolchain-3.4_3.4.2-13.dsc failed signature check:
gpg: keyblock resource `/root/.gnupg/secring.gpg': file open error
gpg: Signature made Wed Oct 15 19:03:48 2014 UTC using RSA key ID 752F1BE1
gpg: Can't check signature: public key not found
Validation FAILED!!

sudo apt-get install debian-archive-keyring debian-keyring

Regards,

Serial is actually really easy to do in Nodejs:

https://github.com/wphermans/Bonejs/blob/master/examples/serial-read-example.js
https://github.com/wphermans/Bonejs/blob/master/examples/serial-write-example.js