Page 4 of 5

Re: mu editor for micropython

Posted: Thu Dec 29, 2016 5:22 am
by rob.frohne
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

Re: mu editor for micropython

Posted: Sun Jan 01, 2017 11:24 am
by askvictor
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.

Re: mu editor for micropython

Posted: Sun Jan 01, 2017 11:53 am
by rcolistete
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

Re: mu editor for micropython

Posted: Mon Jan 02, 2017 8:54 am
by pythoncoder
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? ;)

Re: mu editor for micropython

Posted: Fri Jan 13, 2017 10:36 pm
by rcolistete
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'.

Re: mu editor for micropython

Posted: Sun Nov 12, 2017 12:54 am
by rhubarbdog
I have produced this installation guide for ubuntu/mint/debian linux
https://ubuntuforums.org/showthread.php?t=2377314

Re: mu editor for micropython

Posted: Tue Nov 14, 2017 7:59 am
by ttmetro
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
    

Re: mu editor for micropython

Posted: Tue Nov 14, 2017 5:07 pm
by rhubarbdog
Hi check back at the above post i had missed a few lines of code

Re: mu editor for micropython

Posted: Tue Nov 14, 2017 5:33 pm
by ttmetro
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.

Re: mu editor for micropython

Posted: Tue Nov 14, 2017 7:00 pm
by rhubarbdog

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