ESP32 PyCharm all ok but nothing happens

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
neuberfran
Posts: 16
Joined: Mon May 20, 2019 3:23 pm

Re: ESP32 PyCharm all ok but nothing happens

Post by neuberfran » Thu Aug 29, 2019 4:36 pm

I know I have to know about the directories on device esp32, but is this a copy of what is on the PC? Does pycharm handle this automatically?

I have read the issue below that says the files should call boot.py and main.py. I've tried something along these lines and it didn't work.

https://github.com/vlasovskikh/intellij ... /issues/92

and this video: https://www.youtube.com/watch?v=PTYXsgUSoxs&t=1160s (6'45'' - 7'21''

I have some result:I have some result:


(base) iMac:SmartDrive neuberfran$ ampy --port /dev/tty.SLAB_USBtoUART ls
/.idea
/boot.py
/prog1.py
/zeze
(base) iMac:SmartDrive neuberfran$ ampy --port /dev/tty.SLAB_USBtoUART ls /zeze
/zeze/__init__.py
/zeze/main
/zeze/main.py
/zeze/module
/zeze/modulob.py

Online
User avatar
Roberthh
Posts: 1572
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESP32 PyCharm all ok but nothing happens

Post by Roberthh » Thu Aug 29, 2019 5:22 pm

Maybe you should put aside PyCharm for the moment and go for simple tools. Main.py has to be by default in the top level directory.
Open up a serial terminal session using e.g. screen, and once you have the REPL prompt, enter the commands:

import uos
uos.mv("zeze/main.py", "main.py")
uos.mv("zeze/module.py", "module.py")

That moves these files up to the TLD. That is the simple case. You may later change sys.path top include zeze in the search path. You should also arrange you PyCharm to have also files in the top level directory of the ESP32.

P.S.: My favorite serial terminal emulator picocom is available too for OS X.

neuberfran
Posts: 16
Joined: Mon May 20, 2019 3:23 pm

Re: ESP32 PyCharm all ok but nothing happens

Post by neuberfran » Thu Aug 29, 2019 9:29 pm

I stay trying with picocom but I have issue (pic)
Attachments
Captura de Tela 2019-08-29 às 14.28.48.png
Captura de Tela 2019-08-29 às 14.28.48.png (128.88 KiB) Viewed 112 times

User avatar
dhylands
Posts: 3214
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: ESP32 PyCharm all ok but nothing happens

Post by dhylands » Thu Aug 29, 2019 9:53 pm

Looking at the documentation for uos:
https://docs.micropython.org/en/latest/library/uos.html

It would appear that you need to use

Code: Select all

uos.rename

neuberfran
Posts: 16
Joined: Mon May 20, 2019 3:23 pm

Re: ESP32 PyCharm all ok but nothing happens

Post by neuberfran » Thu Aug 29, 2019 11:34 pm

solved
Attachments
solved.png
solved.png (96.7 KiB) Viewed 103 times

Post Reply