mu editor for micropython
-
- Posts: 1
- Joined: Thu Dec 29, 2016 4:38 am
Re: mu editor for micropython
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
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
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.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.
Flashing through mu is not yet implemented - its only there for the micro:bit at this stage.
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: mu editor for micropython
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).
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: mu editor for micropython
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?
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.
Index to my micropython libraries.
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: mu editor for micropython
You can test a local web Python Editor for BBC Micro:bit with Blocks using the source code :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
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
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: mu editor for micropython
I have produced this installation guide for ubuntu/mint/debian linux
https://ubuntuforums.org/showthread.php?t=2377314
https://ubuntuforums.org/showthread.php?t=2377314
Re: mu editor for micropython
Tried this on ubuntu and get the following error:
Notes:
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'
- 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
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: mu editor for micropython
Hi check back at the above post i had missed a few lines of code
Re: mu editor for micropython
This did install more stuff, but unfortunately I still get the same error:
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.
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'
Bernhard Boser
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: mu editor for micropython
Code: Select all
pip3 install ...
Code: Select all
pip3 install -r requirements.txt