avr-g++.exe: error: device-specs/specs-avr2: No such file or directory - visual-studio-code

I'm trying to install Marlin on an Ender 3. But Arduino IDE is giving me this error:
C:\Users\Michael.Heredia\Downloads\Marlin-2.0.x\Marlin-2.0.x\Marlin\src\lcd\dogm\HAL_LCD_class_defines.h: In member function 'void U8GLIB_SSD1309_128X64_HAL::init(pin_t, pin_t, pin_t)': C:\Users\Michael.Heredia\Downloads\Marlin-2.0.x\Marlin-2.0.x\Marlin\src\lcd\dogm\HAL_LCD_class_defines.h:134:5: error: 'init' is not a member of 'U8GLIB'
U8GLIB::init(&u8g_dev_ssd1309_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset);
I've decided to try auto build Marlin on VSCode but cannot get past this error:
avr-g++.exe: error: device-specs/specs-avr2: No such file or directory
I've looked across many forums and the most common issue seems to be adding or deleting something in the path. Judging by the fact that it is a No such file or directory error, I need to add something to the path, but all the solutions I've found seem to have different things, and none of them seem to explain where I find the directory to add to the path.
How can I solve this?

Close VSC and go to C:\Users\yourname and delete the .platformio folder.
Restart VS Code and you should get a fresh install of Platformio.
This should get you going.

Related

esp-idf build fails with "fatal error: esp_wifi.h: No such file or directory"

I am a student who has gotten a part time job embedded system programming. I am given a program the company uses, and asked to understand it. This is a working program. Therefore, the project can be built and flashed on ESP32 by the developers with no problem. So, the code and CMake files should have no issues. However, I cannot build the program either with VSCode extension nor with idf.py. In fact, I cannot build esp-idf examples from the official website, either.
Note: I am new to StackOverflow as well as to ESP32, so sorry if I made any mistakes here. If this post is problematic in any way, please inform me.
The error message from the terminal is shown here
I was initially using VSCode on Windows 10 (Windows is not activated). At first, ESP extension was completely failing to start the building process because it could not locate the tools. I was getting "could not be located" errors for all the tools. Below is a list of what I did in this setting:
I had v5.0.0 for esp-idf downloaded from Espressif server. I deleted it and tried v4.3.3 and then I tried to download from Github server. I downloaded the requirements for idf.py scripting environment and completed the settings for it as described by the Espressif's documentation.
I manually set the environment variables for IDF_PATH and PATH for both the user and for the system.
After 2, the initial error was gone. Unfortunately, I had a new error which indicated that ".elf" file for the project output could not be found. I do not exactly recall the error but if it is integral to the problem's solution I can try to replicate this issue.
I tried to delete and reinstall VSCode. I tried running VSCode with admin authority.
I tried changing the IDF_TOOLS_PATH in the VSCode esp-idf extension configurations from ".espressif" to "esp\esp-idf".
At this point, I moved to try to build the project on Ubuntu 22.04.1 LTS:
In Ubuntu, I got the fatal error: esp_event.h: No such file or directory error.
It does not seem to be a common issue and I could not find much about it online.
I followed the Linux setup steps in the documentation. It said that only step 1 (Downloading the prerequisites) was necessary for the VSCode extension.
I decided to try the "master branch" from esp-idf configurations as well. After I downloaded the master branch, the error changed to the current version: 'fatal error: esp_wifi.h: No such file or directory'
I also tried the idf.py in Ubuntu but I got the same error.
Both in Ubuntu and in Windows, the Doctor Command returns nothing. It does not even open the terminal or any window. I am not sure what it should return but some online discussions were asking about its return so I wanted to note it here.
Edit: When I tried the examples on Ubuntu, they actually build just fine. Doctor Command also works with examples.
However, the main code has still issues. Initially, I assumed I made some mistakes with esp-idf configurations. But, perhaps that was not the case.
I had the same problem and ended up editing my project's CMakeLists.txt. When I added "esp_wifi" to the "REQUIRES" list, it worked for me:
idf_component_register(
SRCS "main.c"
INCLUDE_DIRS res
EMBED_FILES res/settings.html
REQUIRES esp_wifi
)

Exception has occurred: ModuleNotFoundError in VScode but no other editors

This error occurs in VS code for pip installed modules.
Exception has occurred: ModuleNotFoundError
It was working on all previous days.
I believe that i may have deleted a *.pyc file or something to this extent.
If i do pip freeze i can see the module.
For example import tweepy could not be resolved, but i can see that it exists in pip freeze tweepy==3.10.0 and i can see with python --version that i have the correct version Python 3.9.0.
If i run the same on IDLE (python3.9) the code works, which leads me to believe that this is a VScode issue, but i cannot tell what this is or how to fix it.
In fact, if i recreate new folders in VS code, the imports work too.
So the quesiton is, how can i identify where (which folder or file) the corruption is or what has caused VS code to break in this way ?
One solution (which works) is to recreate all the folders and subfolders.
It is also noted that this is not specific to python as seen here:
https://github.com/Microsoft/vscode/issues/10391
There is also a suggestion here (which is close, but did not resolve the issue):
vscode import error for python module.
I have noticed that if I use File -> Close folder and then File -> Open Folder... and open the project folder again, the errors are
gone.
VStudio may be using a different python interpreter. Just click here and select the proper one:

Failed opening required 'Net/SSH2.php'?

I have installed SSH2 as per these instructions. I also checked in PHPInfo, and I can see SSH is working. I.e. It is showing up. However, my code still bombs:
It bombs out with:
Fatal error: require(): Failed opening required 'Net/SSH2.php'
(include_path='.:/usr/lib/php:/usr/local/lib/php.:/usr/lib/php:/usr/local/lib/php/phpseclib')
in SSHConnect.class.inc on line 5
I tried:
locate SSH2.php
And it can't find the files anywhere. So I really have no idea why this is not working? Any ideas?
You installed libssh2 and are trying to use phpseclib. If you want to use phpseclib you can install it via composer or via PEAR. Or you can just go to http://phpseclib.sourceforge.org , download the *.zip and put it where-ever you like, so long as it's in the include_path.

Eclipse Repositories fail "Unable to read repository at"

I generally don't use Eclipse, so perhaps I'm doing something wrong, but I've spent several hours going over this and can't find a problem.
I needed a plugin for Eclipse (PigEditor or PigPen) and attempted to install it via repository, this failed with the error below. When it wouldn't install, I downloaded the .zip version, extracted the archive, found the folder containing features and plugins directory and tried installing it. This also failed. I also tried a PigPen .jar and it wasn't picked up at all when placing it into the plugins folder.
I noticed along the way that I received a bunch of error messages where it looked like Eclipse was trying to fetch dependencies. For example...
Error
Unable to read repository at http://download.eclipse.org/eclipse/updates/4.3.
java.io.IOException: http://download.eclipse.org/eclipse/updates/4.3 is not a valid repository location.
That -should- be a valid repository location, it's listed about halfway down here. This unable to read repository is the same error that I got when trying to install the previous plugin from repository.
I then went to the Preferences -> Available Software Sites and tried all of the default installed repositories. There were 2 checked (the one listed above, and http://download.eclipse.org/releases/kepler) and 2 unchecked (http://download.eclipse.org/egit/updates and http://www.eclipse.org/modeling/updates). I hit reload on any of those and receive the same error message as above.
I can access websites from the internal browser. I've also tried changing my Network Connections preference to "Direct".
Really all I care about is getting a working Pig plugin, so I'll accept that as an answer. I'm getting the feeling though that my failure to get any repositories is a symptom of a bigger problem (and I really want to know what's going on), so if you have troubleshooting steps I'm willing to try anything.
Sites I'm trying to get the Pig editor from:
https://wiki.apache.org/pig/PigPen
http://romainr.github.io/PigEditor/
https://github.com/romainr/PigEditor
Solution :
Open up .exe eclipse file from command promtp followed by command -vmargs -Djava.net.preferIPv4Stack=true
or
changed in eclipse.init file.

Problems using netbeans 7.01 with CMake 2.8.6

so once again, I'm having a little problem I can't figure out myself. Meaning, I'm pretty sure I know what the problem is, I just can't fix it.
I'm developing in C++ using Netbeans 7.01 with CMake 2.8.6. However, when I'm trying to build a project, I get the following error from CMake:
CMake Error: The path to the source directory:
H:/Projects/Netbeans/CppApplication_1/CONF=Release
contains unsupported character '='.
Please use a different source directory name.
Please note, that "CONF=Release" isn't a folder. It seems to be a configuration flag set by Netbeans, as it changes when I'm trying a debug build. So, my guess here is, that theres a space missing, or something similar. Unfortunately, I can't figure out where to change that. There are no options in any related Netbeans window, I can't find anything related in the configuration files for netbeans itself or the project either.
Did anyone here have experienced the same problem and found a solution to it? I would be very glad to hear it. If there's any information missing, let me know, I will add them as fast as possible.
Edit:
Just noticed there is already version 7.1 of netbeans, nice to know. However, even with this version, the same problem occurs.
You must specify the command you ran to allow for the error to be identified. However, it looks like you missed the "source-path" parameter.
The cmake command ends with the path to source and should be something like:
cmake -D CONF=Release <path to source>