Terminal issue, MicroPythonREPL - terminal

I'm using PyCharm to do some kinds of stuff on ESP32,
It's ongoing, but I can't use the terminal correctly. MicroPython REPL doesn't seem to work. I can't do serial commands on the terminal.
I'm using a venv to do it, and maybe the problem is something related to it.
In normal cases, this is the terminal:
Device path COM[x]
Quit: Ctrl+] | stop program: Ctrl+C | Reset: Ctrl+D
...
In my case, it's like this:
Microsoft Windows [versão 10.0.18363.1016]
(c) 2019 Microsoft Corporation. Todos os direitos reservados.
(venv) C:\Users\user\PycharmProjects\networktest>
...
So I can't do any command in my terminal, anyone can help?

Have you tried using a Terminal program like PuTTY, using the com port identified for the ESP32 to establish a REPL?
Can you see the board/com port in Device Manager or as a drive in Windows Explorer?
These steps might help isolate the problem to either Pycharm, or the board itself?

Related

Terminal prompt not working when opening DevContainer (OSX)

I am trying out the Remote - Containers VSCode extension. I get a docker warning and a prompt message if I want to continue but I can't type anything into the terminal. The cursor looks like it's active but nothing happens when I type.
So far I have tried:
Using iTerm.app instead of Terminal.app (in VSCode settings)
Disabled oh-my-zsh terminal plugin
Quit and start Visual Studio code
I solved this by using generating ssh key in the devcontainer and adding it to github.

Why does VSCode add an ampersand before the command when I run a program, which results in an error?

I use Visual Studio Code 1.56.2 with Windows 10. I have a simple Python file that just outputs hi. When I try to run it in VSCode using the integrated terminal which I changed to cmd, it adds the character & before the python command
This is the terminal when I run the program:
Microsoft Windows [Version 10.0.19043.1023]
(c) Microsoft Corporation. All rights reserved.
C:\Users\khalr\Python Projects>& C:/Users/khalr/AppData/Local/Programs/Python/Python39/python.exe "c:/Users/khalr/Python Projects/Test/main.py"
& was unexpected at this time.
C:\Users\khalr\Python Projects>
I also noticed that the terminal looks different since this started happening. There used to be icons on the top right beside the X. There used to be a garbage can icon among others.
I would really appreciate it if someone could help me with this issue.

I need help installing emacs and the avr things on windows so i can use arduino uno

So I did some Arduino programing on emacs on a university machine that had Linux. I want to use my windows computer to play around the same code. The problem is that I installed emacs for windows, the make file thing, avrdude,avr8-gnu-toolchain-win32_x86,gnuwin32 and I put all the different PATHs and stuff, and I still get errors on something that worked on the university Linux machine so the problem shouldn't be the code. When I type "compile" and then "make -k lst upload" as I did in the Linux machine it gives me this error:
"make -k lst upload
make: Nothing to be done for `lst'.
avrdude -p m328p -c arduino -P /dev/ttyACM0 -Uflash:w:traffic_light.hex
avrdude: ser_open(): can't open device "/dev/ttyACM0": The system cannot find the path specified.
avrdude done. Thank you.
make: *** [upload] Error 1
Compilation exited abnormally with code 2 at Mon Nov 18 15:25:40"
I don't know what to do. Any help would be appreciated.
Thanks in advance, Sebas
The problem is that AVRDUDE is trying to open /dev/ttyACM0, which is a Linux-style name of a USB virtual serial port. That name does not exist on Windows. Instead, you have to use a name like "COM6". You can look in the Device Manager and expand the "Ports (COM & LPT)" list to see what ports are available. If a port is not available, you will need to install the proper USB drivers for your device.
By the way, you could consider using MSYS2 to install AVRDUDE, Make, and everything else you need except the avr-gcc toolchain. But that is not a solution to your current problem, which is that you are specifying the wrong serial port.

PnPutil commands to uninstall the display adapter driver does not work

I am currently trying to uninstall display adapter driver in power shell.
I can simply go to device manager to find display adapter and uninstall the driver and then install the new driver. But I want to write an automated script to make it easy.
I tried to use "pnputil.exe -f -d oem##.inf" in power shell to uninstall the display adapter driver.
But it did not work and gave me something like that
"Deleting the driver package failed: One or more devices are presently installed using the specified INF"
Does anyone know how can I solve this problem and make pnputil work?
This isn't a PowerShell question really, as it's a window util.
from running pnputil /?
/delete-driver <oem#.inf> [/force]
Delete driver package from the driver store.
/force - delete driver package even when it is in use by devices.
so running pnputil.exe /delete-driver oem##.inf /force should work for you.
Example removing a device using the driver first on the commandline with devon. Devon comes with the Window SDK. Windows SDK - Windows app development _ Microsoft Developer The pnputil command should work after that.
devcon remove "HDAUDIO\FUNC_01&VEN_1013&DEV_4206&SUBSYS_106B0600"

msys not opening programs interactively

msys is not opening programs interactively. For example, if I enter python, the program hangs. Even mysql hangs after I enter my password (entering the password is interactive, though). When I enter pico, I get "Redirection is not supported." bc does not hang, though. python -i opens an interactive session.
I've tried different terminal emulators, and I get the same results. I've tried Console and Mintty. Therefore, I'm led to believe this is an issue with sh, not the terminal emulator.
I am running Vista. I installed msys on my work PC, which runs Windows 7, and I don't have any issues with running interactive programs on msys.
I've read that this is expected behavior, but this used to work. I'm thinking that some install corrupted something. I even tried reinstalling msys, and I get the same results. I also cannot do system restore for some reason.
Any clues?
Here is some example output:
$ python
<ctrl-C> from this
$ mysql -u root -p
Enter password: ****
<ctrl-C> from this
This time I used Console. In the "Shell:" textbox I put C:/msys/1.0/bin/sh.exe --login -i When I press the enter key, a newline is added, i.e., the terminal scrolls. The same thing happens from the terminal provided by msys. This used to work before. Furthermore, I installed msys on another machine, which runs Windows 7, and python does not hang. If I use python -i, there is no hang.
Here's the output of running sh from cmd:
C:\Users\jpp>sh
sh-3.1$
sh-3.1$
sh-3.1$ python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Have you tried the winpty (https://github.com/rprichard/winpty) project? For details, check my answer here: https://stackoverflow.com/a/23164362/1034436
Your issue seems similar to mine with mysql, hg and python, but unlike you, I don't have an example of it working without winpty.

Resources