Troubleshoot

Password for 'sudo'

Any time you use 'sudo' (the equivalent of running a command as an administrator in Windows) you will be asked to enter the password for robot which is maker (case-sensitive).

Error message: /usr/bin/env: 'python3 \r': No such file or directory

If you get that error message when you try to run your EV3 Python script on the EV3 from VS Code it probably means that the lines of code end with the wrong characters. They need to end with line feed (LF) characters but Windows PCs often put Carriage Return AND Line Feed (CRLF) characters at the end of lines. These are invisible characters, but you can tell which ones are being used by looking at the bottom right of the VS Code window. You need to see LF and not CRLF. If you see CRLF you should be able to change to LF by left-clicking where it says CRLF and then choosing LF. But that would probably only solve the problem for that one script. 

To solve the problem for all the scripts in the folder that you have open in VS Code, that folder should contain a folder called .vscode and inside that folder there should be at least these two files: launch.json and settings.json. This was explained in section 10 of the page on Setting up VS Code. If you double-click the settings.json file you should see at least these two lines:

    "files.eol": "\n",

    "ev3devBrowser.download.exclude": "{**/.*,LICENSE,README.md}"

You can also open the workspace settings by left-clicking the gear in the bottom left corner of the VS Code window and choosing 'Settings'. That will create the file settings.json if it does not already exist in your project folder. The first of those two lines above tells VS Code to use LF characters at the ends of lines (eol) for all the scripts in your project folder. On Windows PCs, VS Code uses CRLF by default but this setting in the settings.json file overrides the default setting. 

Having this line "files.eol": "\n", in a file called settings.json in a folder called .vscode in your project folder means the setting is a 'workspace setting' which only applies to your project folder (your workspace). If you want to make sure you never have this problem again it should be safe to move the line from the Workspace Settings area to the User Settings area. 'User Settings' apply all the time that VS Code is open, and not just for one particular folder.

Error Message: Failed to execute child process "/home/robot/???????.py" (Permission denied)

If you get this message it probably means you do not have the necessary 'shebang' line as the first line of the script that you are trying to run on the EV3. The first line (the 'shebang') must be exactly this:

#!/usr/bin/env python3

Pressing F5 does not launch the script

As of October 2018 I notice that sometimes pressing F5 does not launch the script on the EV3 as it should. The problem may be caused by trying to launch a script when VS Code is not connected to the EV3 (as confirmed by the green light in the EV3 Device Browser section). The solution seems to be to close and re-open VS Code, which only takes a few seconds and is not a problem because VS Code opens just as it was when you close it, except that the connection to the EV3 is lost and must be re-established.

Case sensitivity

Perhaps the most common error made by Python beginners is to forget that Python is case-sensitive, so that is the first thing to check.

Mismatched parentheses

This may be the second most common cause of problems, and the Python error messages often don't identify clearly lines that have mismatched parentheses (for example 3 opening parentheses and only 2 closing parentheses). Mismatched parentheses and the errors they generate often make it appear that there is a problem later in the script when in fact the problem is the mismatched parentheses.

Internet Connectivity

If you are using VS Code with the EV3 extension and if you update your SD card from time to time by simply downloading the latest Stretch (not Jessie) image HERE and flashing that to your SD card then you should never need your EV3 to have a connection to the internet. Therefore you can ignore this section.

If you don't meet those conditions or you're an advanced user then you may sometimes need your EV3 to be connected to the internet, such as when you want to update the ev3dev and Python libraries. The sharing of the PC's internet connection by Windows can sometimes fail - you will then get error messages when you try to use the internet from the brick. You can also know that you do NOT have a connection to the internet if Brickman tells you you are 'Connected'!! When the brick is connected to the internet, Brickman's networking page will say you are 'Online' rather than 'Connected'. Rather confusingly, 'Connected' means the brick is connected to the PC but NOT connected to the internet i.e. not 'online'. If you need to regain an internet connection from the brick you can try this:

LCD screen

If you are using VS Code with the EV3 extension then you can ignore this paragraph. Using Brickman to run scripts that use LCD screen is straightforward, but if you want to run the same scripts from SSH you need to carry out a few extra steps that are described at the bottom of this page.

Upgrade

If you are having lots of problems and you think it may be because your libraries are very out of date then you might want to upgrade them all. This should not be taken lightly because it may cause some of your programs to stop working because ev3dev is still being finalised and changes to ev3dev may cause your Python commands to fail. If you want to upgrade all your ev3dev libraries then the best way is just to download the latest Stretch (not Jessie) image HERE, flash it to your SD card and start using the new image. Flashing a new image to the card means you will lose all your scripts on the card but that should not be a problem because they are just copies of scripts that you have on your PC. To use my tutorial scripts you will need to download the 'sounds' and 'pics' folders to the card again, as explained elsewhere.