I hit my head two times on this, getting serialdata via an Electron app, time to put the taken steps on paper.
Demo project
I found this demo project and used it aswell: https://github.com/johnny-five-io/electron-serialport
I implemented some changes to push the data to a table.
The project code can be found on my github pagehttps://github.com/timdows/webpages/tree/master/ElectronSerial
Implementing serialport in an existing project
The installation is as easy as running the install command
[code]npm install –save-dev serialport[/code]
When trying to run electron I got:
According to the manual on github, it is needed to use electron-rebuild in order to solve this.
Installing electron-rebuild
[code]npm install –save-dev electron-rebuild[/code]
Change package.json under the scripts section
[code]’install’: ‘electron-rebuild'[/code]
run npm install, it will rebuild the serialport for us (takes a while on the Pi3)
A couple of weeks later I got this error ‘compiled against a different Node.js version’
Uncaught Error: The module 'xxx/serialport/build/Release/serialport.node' was compiled against a different Node.js version using
https://stackoverflow.com/questions/42616008/node-module-version-conflict-when-installing-modules-for-electron
https://www.npmjs.com/package/serialport#illegal-instruction
npm cache clear
rm -rf node_modules
reboot
npm install
Hello,
I’m trying to install the above application to my raspberry pi B3, but after running npm start command its opening electron and showing some blank page and after that nothing is happening, but the same application is working fine my desktop. I installed all the packages still its not working, please help me out with this. And please brief me about the hardware connection part aswell.
Thanks in advance.