Our great sponsors
-
pc-nrf-dfu-js
Discontinued Javascript implementation of Nordic's DFU protocol over serial (or NoBLE).
-
pc-nrfjprog-js
Discontinued Node.js library that exposes the functionality of the nRF Command Line Tools
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
serialport
Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
What specific part of the workflow are you having trouble with? pc-nrf-dfu-js uses node-serialport under the hood for it's serial comms so if you can get one of them working, it shouldn't be too hard to get the other working as well.
I was able to convince nrfjprog-js to build and load. I downloaded the repo and installed the dependencies with Yarn. I've tested it with both Electron 11 and 12, just change the npm_config_target environment variable to 11.0.0 or 12.0.0 depending on which one you want. I'm currently running Node 14, hence that version in NODE_VERSION. I only tried on a Mac but if you have trouble with other operating systems I can test those for you as well.
We use node-serialport for USB serial communications. It's included in the transport manager renderer process. The installation guide and docs should be good enough to get you started. Hopefully serialport has prebuilds for the combination of system and electron version you're trying. We had to setup an internal prebuilds system and CDN for our app since we'd often find ourselves ahead of the prebuilt versions for node-serialport. Alternatively you can build from source.
One thing I haven't had a chance to look into yet is using Electron v12's native serialport solution which was added late last year. There's some docs for that here.
What I ended up doing was copying the binaries from the node_modules folder from the nRF Connect for PC repository across directly, while matching the Electron version. It's not tidy, but it works, I will have to revisit this later.