This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF Connect for (Linux) desktop, JavaScript error

I just discovered nRF Connect for Desktop. I am setting up one of our nRF52 DK (PCA10040) boards to serve as a Bluetooth central device for our other nRF52 peripherals. The desktop computer is running Ubuntu Linux 16.04.

I haven't compiled a Bluetooth peripheral example to test everything end-to-end quite yet. However, I can start the nRF Connect software with a board connected to USB, and then I scan for advertising devices, and it finds several. So far, that looks good.

However, when I exit the nRF Connect software, I get the following error:

A JavaScript error occurred in the main process
Uncaught Exception:
Error: EACCES: permission denied, open '/home/john/.config/nrfconnect/settings.json'
    at Error (native)
    at Object.fs.openSync (fs.js:634:18)
    at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:158:20)
    at Object.fs.writeFileSync (fs.js:1337:33)
    at save (/home/john/bin/nrf-connect-linux-x64/resources/app/node_modules/nrfconnect-appmodule-ble/node_modules/nrfconnect-core/settings.js:75:8)
    at Object.exports.set (/home/john/bin/nrf-connect-linux-x64/resources/app/node_modules/nrfconnect-appmodule-ble/node_modules/nrfconnect-core/settings.js:81:5)
    at Object.exports.storeLastWindow.lastWindowState [as storeLastWindow] (/home/john/bin/nrf-connect-linux-x64/resources/app/node_modules/nrfconnect-appmodule-ble/node_modules/nrfconnect-core/settings.js:120:10)
    at BrowserWindow.<anonymous> (/home/john/bin/nrf-connect-linux-x64/resources/app/node_modules/nrfconnect-appmodule-ble/node_modules/nrfconnect-core/index.js:103:22)
    at emitOne (events.js:96:13)
    at BrowserWindow.emit (events.js:188:7)

Because I saw that permissions were being denied, I thought to try invoking nRF Connect using sudo from the Linux console. If I do that, the error disappears.

I wasn't given the option to install nRF Connect using sudo. I followed the installation instructions in the nRF Connect manual, and I ended up with a local, single-user installation without sudo privileges.

This may not actually interfere with my ability to operate nRF Connect. I'm still figuring that out. However, I have to ask: what's wrong, and how do I fix it? Thanks.

  • Hi,

    I suspect that it's a permission issue wrt. the COM-port. Try to add your user to the dialout group:

    sudo usermod -a -G dialout MY_USERNAME
    

    This requires a reboot to work. As a test to see if the COM-port permission is the issue, you can do this (no need to reboot):

    sudo chmod 777 /dev/ttyACM0
    

    Then open up nrf-connect and see if it still gives an error.

    Cheers, Håkon

  • Hello Håkon, thanks for your reply. Sorry I have been so slow to respond.

    I had to deal with adding my user name to the dialout group years ago in order to work with the USB port through gtkterm. I already had that part working.

    In any case, I have now upgraded to Ubuntu Gnome 17.04 -- and I have different issues with nRF Connect now. I never solved the problem using Ubuntu 16.04. As I said, the problem was not obviously interfering with my ability to operate the software.

    I will ask a new question regarding 17.04 rather than going off on a tangent here.

Related