VS Code on new computer creates server errors (NFS vs SAMBA connection issue?)

I replaced my 13-year-old computer with a new one.
Both run Linux Mint Una 20.3 and Vscode 1.67.0 with the OH extension 1.0.0
I checked both set-ups, both are the same… however, I get server errors on the machine, like so:

The output screen says this:

Usage of deprecated config => openhab.username <= detected.
openHAB vscode extension has been activated
Could not reload items for HoverProvider
[Error - 10:13:43 pm] Connection to server is erroring. Shutting down server.
[Error - 10:13:43 pm] Connection to server is erroring. Shutting down server.
        Error while connecting to openHAB REST API.

        Error: connect ETIMEDOUT

The interesting thing is the complaint above about Usage of deprecated config => openhab.username <= detected. which I am obviously not using.

The config looks like htis:

    "openhab.connection.host": "",
    "openhab.connection.port": 8080,
    "openhab.connection.authToken": "",
    "openhab.languageserver.remoteEnabled": true,
    "openhab.languageserver.remotePort": 5007,
    "workbench.iconTheme": "openhab"

I did not say anything about the OH set-up as I deemed this info redundant given that the old machine works, but not the new one, ruling out the rPi runnning OHv2.5 as being the issue.

I don’t think the deprecation warning has anything to do with the error. OH 2.5 does’t even have any authentication and if it were related to authentication you’d get a different error.

The error is that the connection timed out which usually means that the server did not respond to the connection request. So, since the server is responding from a different machine this is going to be a networking or firewall error or something like that. Can you ping that IP from the new machine? Can you bring up the web interface in a browser?

Yes, can connect to 8080 and get my sitemap (from the VScode mache and all others)…
Also see, can open, mod and save files to the openHAB machine (via VScode).

I also searched for settings.json and have only one.

And can browse the REST directory…

There is no firewall between these computers…
In fact, both are connected to the same switch (which does not use VLANs or other controls).

Well… as usual you are on the money…

I did some further investigating (and checking my install docs)…

The old machine is named: maxg-pc-mint
The new machine is named: x570

When I installed the new machine, I could not connect to the openHAB rPi’s SAMBA share, despite using the same command in fstab I had on the old machine.

I eventually installed:
sudo apt install -y nfs-kernel-server
… on the openHAB rPi
… then created a share export file:
sudo nano /etc/exports
I added access from the network to the share, like so:

On the new PC (x570) I installed:
sudo apt install -y nfs-common
Then mounted it manually with:
sudo mount -o rw /home/maxg/LinuxMachines/openhab
… this worked

However, despite already having nfs-common on the old machine, it could not connect via NFS in fstab. Reverting back to SAMBA worked:
// /home/maxg/openhab cifs username=maxg,password=abcdefgh,uid=1001,gid=1001

All the while I could not connect from the new machine via SAMBA;
and can not connect via NFS from the old machine. (It does my head in.)

So that is the difference between these two machines.

The old PC connects to REST; the new PC does not.

Can I suggest you get the Remote-SSH extension for vscode? It allows you to connect to the machine with the files you want to modify via ssh, and is actually running a little local proxy tool so it works as if you are local on the remote machine, and you also don’t have to expose a samba or nfs share to access the files over the network. It’s really slick!

1 Like

Thanks, I have tried this before and it brings the rPi down. OH already uses all RAM it gets.