This is why we add the explicit location to the AuthorizedKeysFile option. So if we would use the home directory of the admin user, the group plcnext would not have write permissions to the PLCnext runtime working directory anymore. The directory must not be writeable by the group. The ssh server needs restricted file permissions to the directory in which the. So why is the additional file needed? This is because the home directory of the admin user is set to /opt/plcnext and this directory is the working directory of the PLCnext runtime. The %u parameter will expand to the user name that tries to log in to the ssh server. We need to add the /home/%u/.ssh/authorized_key file here. The AuthorizedKeysFile option specifies files to look for authorized keys. The PermitRootLogin allows connecting to the ssh server with the root user. ssh/authorized_keys /home/%u/.ssh/authorized_keys # but this is overridden so installations will only check. It is not recommended leaving this option activated in production systems. Remember to deactivate the PermitRootLogin option on production systems. Edit the ssh server configuration /etc/ssh/sshd_config on the target controller and modify the AuthorizedKeysFile and PermitRootLogin options.
This is needed because we don’t want to type in our password on each action.
To automate the download of the shared object library and restart of the PLCnext runtime we need to set up key based authentication for the ssh server on the controller. The next step is to set up a key based SSH authentication. Now the debugging environment is finished. Then copy libprocps.so.3 and libprocps.so.3.0.0 into lib. Scp lib/arm-linux-gnueabihf/libprocps.so.3 lib/arm-linux-gnueabihf/libprocps.so.3.0.0 rename the ps command in bin to ps-old.Ĭopy the Debian ps into bin. Please download the packages and copy ps, libprocps.so.3, libprocps.so.3.0.0 to the controller:Īr -x libprocps3_3.3.9-9+deb8u1_b Fortunately it is possible to use the Debian ps on the PLCnext. PLCnext only has busybox for the ps command which doesn’t include the needed switches of ps.
VS Code (or VS 2019) issues the ps command to show the available tasks: ps -axww -o pid=A,ruser=B,args=C If you like to attach the debugger to process on the controller, the IDE must be able to list all active processes on the controller. Sh GetVsDbg.sh -v vs2019 -l ~/.vs-debgger/vs2019 -d vscode Finally, we have to create a success.txt to show GetVsDbg.sh that the debugger was downloaded successfully./vsdbg The result should be the same as in the first test. mv vsdbg vsdbg2Įcho "export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true" > vsdbgĮcho "~/.vs-debugger/vs2019/vsdbg2" > vsdbg We rename vsdbg to vsdbg2 and create a script to set the environment variables and to start the debugger by executing vsdbg2. The solution for this problem is creating a script. But if we execute vsdbg the environment variable must be set each time.
Then vsdbg should start without exceptions or errors.
cd ~/.vs-debugger/vs2019Įxport DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=trueįor more information, see Install the. NET Core application, for which the environment variables need to be turned off. We navigate in vs2019 and make vsdbg executable. Unzip vsdbg-linux-arm.zip -d ~/.vs-debugger/vs2019 scp GetVsDbg.sh vsdbg-linux-arm.zip the vsdbg-linux-arm.zip to the vs2019 directory and afterwards remove vsdbg-linux-arm.zip. vs-debugger directory in our home directory and create a subdirectory called vs2019.Īt the controller: mkdir -p ~/.vs-debugger/vs2019ĭownload the GetVsDbg.sh script and the VS debugger (vsdbg). Automate your development workflow with Visual Studio Code (by Björn Sauer)įirst we create the.NET Core 3 applications on PLCnext (by Andreas Orzelski) The tutorial is based of two posts in the Makers Blog. The first one is to set up the remote debugger and the second one is to enable an SSH key based authentication to the controller. Start and debug your remote application (Press “F5” and debug)īefore we could start to remote debug at our target, we have to prepare two different things.In this post I’m using Debian 9 on my development machine and an AXC F 2152 with version: PLCnext Linux 2020.0. Net Core 3.0 application with VS Code on a PLCnext target. I would like to describe two different ways to remote debug a.