The single board computer must be running a Debian or Ubuntu, Linux distribution. For remote access, you need to install the OpenSSH server and set certain settings. You can use MobaXterm as a remote access terminal. All subsequent steps are performed on a single-board computer.
- If the
sudopackage is not installed, then install this package as therootuser using the commands:
apt-get update
apt-get install -y sudo- To install the OpenSSH server and configure access, run the following commands:
sudo apt-get update
sudo apt-get install -y openssh-server mc
sudo mcedit /etc/ssh/sshd_config- In the opened editor, set the following parameters:
PermitRootLogin yes
PasswordAuthentication yesThe remaining necessary parameters will be added automatically when you first connect to the device using the extension.
-
Then save the changes F2 and exit the editor F10.
-
Restart the OpenSSH server to apply the new settings:
sudo systemctl reload ssh
sudo systemctl status sshThe last command displays the current status of the service.
Add device
All settings, including private keys, templates, are by default located in the user profile folder along the path %userprofile%\fastiot (the location can be changed in the settings). When you connect to the device for the first time, a pair of keys is created: private and public. The private key is copied to the %userprofile%\fastiot\settings\keys folder and used to configure the device and start remote debugging, the public key is stored on the remote device itself.
The important point is to select an account to create on the device that will be used for device management and remote debugging. The first option is the debugvscode account (the name can be changed in the settings), the second option is root:
Selecting an account to create on the device
Selecting the debugvscode option creates a configuration file for device access rights 20-gpio-fastiot.rules using the udev. A group named iot is created and the user debugvscode is added to it. The iot group is then given permissions to gpiochip, led, and pwm. Further, to access other hardware interfaces, the user debugvscode is added to the appropriate groups with access such as: video, i2c, spi, spidev, kmem, tty, dialout, input, audio, to access I2C, SPI, etc. d.
Due to the fact that testing was performed only on Armbian, not all permissions may have been added. Therefore, if there are problems with access rights to gpiochip, PWM, etc., then choose - ** root **.
To run a .NET IoT application and perform remote debugging, you need to install:
- Runtime - .NET Runtime;
- Remote debugger - .NET Debugger (vsdbg).
Minimum set of packages to run .NET applications
- Now you need to create a project. To create a project, click on the Create project button:
- Select a device for remote debugging:
- Select a template for the project:
- Set the name of the project:
- Specify the folder for saving the project:
- Select version of .NET framework:
- Available Launch to launch remote debugging:
- Now go to
Run and Debug:
- Select the Launch configuration to launch:
- Run the project for debugging menu
Run > Start Debugging:
- An example of displaying messages during remote debugging:
Sample projects with added configuration Launch (/.vscode/launch.json) and Tasks (/.vscode/tasks.json) are located in the samples folder.
The template.fastiot.yaml file will be placed in the project folder. This file is required to determine the template ID when adding Launch. If it is removed, then there will be no exact definition of the template from which the project was formed. From the template.fastiot.yaml file, only the template identifier string id: dotnet-console is taken.
Launch (/.vscode/launch.json) and Tasks (/.vscode/tasks.json) configurations contain absolute paths to binary files that are loaded on the device, for example /cygdrive/d/Anton/Projects/Tests /DotnetConsoleAppRuntimeInfo/bin/Debug/net5.0/linux-arm/. In this regard, if you change the path to the Applicationdatafolder folder in the settings or rename/move the project folder, then the paths become non-existent. In this case, you need to rebuild (Rebuild) Launch. Select the required Launch and then call the context menu, click on the Rebuild menu item.
Invoking the Rebuild command
Some Launch options can be changed from the LAUCHS window. The following options are changed:
- Console (terminal) - controls what console (terminal) window the target app is launched into. Default value:
internalConsole. More details Console (terminal) window; - Just My Code - debug just my code. Default value:
true. Learn more How to disable the “Just My Code” setting on the VS Code debugger;














