mu editor for micropython

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
rob.frohne
Posts: 1
Joined: Thu Dec 29, 2016 4:38 am

Re: mu editor for micropython

Post by rob.frohne » Thu Dec 29, 2016 5:22 am

Hi Peter, et. al.,

I found for my setup I had to select the fourth element in the serial available_ports array in logic.py, instead of 0, because my esp8266 is at /dev/ttyUSB3. See below:

def find_upython_device():
"""
TODO - allow option to select which serial port to use.
For now, this just returns the first serial port found
"""
available_ports = QSerialPortInfo.availablePorts()
try:
port = available_ports[4]
logger.info('Using port {}'.format(port.portName()))
return port.portName()
except IndexError:
return None

Flashing is not working for me. I'm wondering if that is because nobody has modified the flashing to work with the esp8266 yet, or if it is for a similar reason to the problem I fixed above. Sorry if this is a newbie question. I'm rather new to python.

Thanks,

Rob

askvictor
Posts: 24
Joined: Tue Mar 22, 2016 9:08 pm

Re: mu editor for micropython

Post by askvictor » Sun Jan 01, 2017 11:24 am

rob.frohne wrote:Hi Peter, et. al.,

I found for my setup I had to select the fourth element in the serial available_ports array in logic.py, instead of 0, because my esp8266 is at /dev/ttyUSB3. See below:

...

Flashing is not working for me. I'm wondering if that is because nobody has modified the flashing to work with the esp8266 yet, or if it is for a similar reason to the problem I fixed above. Sorry if this is a newbie question. I'm rather new to python.
Yeah, the serial port selection is scrappy. Ideally it would try to autodetect, but that's harder than it sounds, and also, few computers have multiple (or, indeed, any) serial ports these days, so 0 is a good guess for most cases.

Flashing through mu is not yet implemented - its only there for the micro:bit at this stage.

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: mu editor for micropython

Post by rcolistete » Sun Jan 01, 2017 11:53 am

Have you seen this video ?
Blockly for MicroPython in the browser and in Mu
December 8th 2016
A quick overview of work in progress concerning the use of blocks, MicroPython, the BBC micro:bit and the browser based editor and Mu
https://www.youtube.com/watch?v=XCZEKtNHx5k
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: mu editor for micropython

Post by pythoncoder » Mon Jan 02, 2017 8:54 am

Impressive!

In a lighter vein I was struck by his statement "I've also made sure that not everything you can do with the Microbit is available in blocks. Some of the really cool more complicated features to do with the microbit you can only access using Python."

Doubtless that required a great deal of effort and attention to detail. You wouldn't want to reduce the entirety of software engineering to shifting blocks around, now would you? ;)
Peter Hinch
Index to my micropython libraries.

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: mu editor for micropython

Post by rcolistete » Fri Jan 13, 2017 10:36 pm

rcolistete wrote:Have you seen this video ?
Blockly for MicroPython in the browser and in Mu
December 8th 2016
A quick overview of work in progress concerning the use of blocks, MicroPython, the BBC micro:bit and the browser based editor and Mu
https://www.youtube.com/watch?v=XCZEKtNHx5k
You can test a local web Python Editor for BBC Micro:bit with Blocks using the source code :
https://github.com/bbcmicrobit/PythonEditor
It is easy :

Code: Select all

$ git clone https://github.com/bbcmicrobit/PythonEditor.git
$ cd PythonEditor
$ git submodule update --init --recursive
Then double click 'editor.html'.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

rhubarbdog
Posts: 168
Joined: Tue Nov 07, 2017 11:45 pm

Re: mu editor for micropython

Post by rhubarbdog » Sun Nov 12, 2017 12:54 am

I have produced this installation guide for ubuntu/mint/debian linux
https://ubuntuforums.org/showthread.php?t=2377314

ttmetro
Posts: 104
Joined: Mon Jul 31, 2017 12:44 am

Re: mu editor for micropython

Post by ttmetro » Tue Nov 14, 2017 7:59 am

Tried this on ubuntu and get the following error:

Code: Select all

python3 run.py
Traceback (most recent call last):
  File "run.py", line 2, in <module>
    from mu.app import run
  File "/home/ee49/Downloads/mu-master/mu/app.py", line 44, in <module>
    from mu.interface import Window
  File "/home/ee49/Downloads/mu-master/mu/interface/__init__.py", line 1, in <module>
    from .main import Window
  File "/home/ee49/Downloads/mu-master/mu/interface/main.py", line 31, in <module>
    from mu.interface.panes import (DebugInspector, PythonProcessPane,
  File "/home/ee49/Downloads/mu-master/mu/interface/panes.py", line 31, in <module>
    from PyQt5.QtSerialPort import QSerialPort
ModuleNotFoundError: No module named 'PyQt5.QtSerialPort'
Notes:
  • I use the anaconda python distribution
  • I run ubuntu in a virtualbox (on top of osx)
  • apt-cache search pyqt5: ... output includes the line

    Code: Select all

    python3-pyqt5.qtserialport - Python 3 bindings for QtSerialPort module
    
Bernhard Boser

rhubarbdog
Posts: 168
Joined: Tue Nov 07, 2017 11:45 pm

Re: mu editor for micropython

Post by rhubarbdog » Tue Nov 14, 2017 5:07 pm

Hi check back at the above post i had missed a few lines of code

ttmetro
Posts: 104
Joined: Mon Jul 31, 2017 12:44 am

Re: mu editor for micropython

Post by ttmetro » Tue Nov 14, 2017 5:33 pm

This did install more stuff, but unfortunately I still get the same error:

Code: Select all

./run.py
Traceback (most recent call last):
  File "./run.py", line 2, in <module>
    from mu.app import run
  File "/home/ee49/Downloads/mu-master/mu/app.py", line 44, in <module>
    from mu.interface import Window
  File "/home/ee49/Downloads/mu-master/mu/interface/__init__.py", line 1, in <module>
    from .main import Window
  File "/home/ee49/Downloads/mu-master/mu/interface/main.py", line 31, in <module>
    from mu.interface.panes import (DebugInspector, PythonProcessPane,
  File "/home/ee49/Downloads/mu-master/mu/interface/panes.py", line 31, in <module>
    from PyQt5.QtSerialPort import QSerialPort
ModuleNotFoundError: No module named 'PyQt5.QtSerialPort'
Likely is a problem with my installation of Python and has nothing to do with mu. I am completely in the fog on how Python installs libraries.
Bernhard Boser

rhubarbdog
Posts: 168
Joined: Tue Nov 07, 2017 11:45 pm

Re: mu editor for micropython

Post by rhubarbdog » Tue Nov 14, 2017 7:00 pm

Code: Select all

pip3 install ...
I saw this on another forum about python

Code: Select all

pip3 install -r requirements.txt 
Read requirements.txt first as comments contain shell commands to run

Post Reply