uPyCraft_PyQt5

I've been looking for an IDE for debugging various microcontroller boards, such as OpenMV and PyBoard, etc. There are some fundamental requirements:

  • Open source
  • Python debugger, MicroPython support
  • Any GUI is fine, but Qt preferred

Therefore, after a careful search, I found uPyCraft, which seems to be designed by a Chinese team? Because I found the Chinese version of uPyCraft documentation as well.

However, it seems Linux support for uPyCraft is NOT very good. My working environment:

1
2
3
4
5
6
7
8
9
10
11
12
13
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
$ uname -a
Linux jiapei-GT72-6QE 4.18.7-041807-generic #201809090930 SMP Sun Sep 9 09:33:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ python --version
Python 3.6.5
$ qmake --version
QMake version 3.1
Using Qt version 5.11.1 in /opt/Qt/Current/gcc_64/lib

PART A: Test Built uPyCraft

1. Try the Executable

In fact, there is one executable Linux version for uPyCraft. However, to run it after downloading, I obtained the following ERROR messages:

1
2
3
4
5
6
$ ./uPyCraft_linux_V1.0 
Traceback (most recent call last):
File "uPyCraft.py", line 2, in <module>
File "/usr/local/lib/python3.5/dist-packages/PyInstaller/loader/pyimod03_importers.py", line 714, in load_module
ImportError: /tmp/_MEIoq8Xi8/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16)
[324] Failed to execute script uPyCraft

2. Try source code

We can also clone uPyCraft source code and build it from scratch. However, clearly, current uPyCraft relies on PyQt4 instead of PyQt5.

Therefore, I've got to modify uPyCraft a bit to have this uPyCraft_PyQt5.

PART B: Build uPyCraft with PyQt5

Before testing uPyCraft_PyQt5, you need to make sure * python3 * Qt5 have been installed.

**What's more important: Please uninstall enum34 but keep the original enum. Please refer to Stack Overflow for more details.

1. Check out and build my modified code of uPyCraft_PyQt5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$ git clone git@github.com:jiapei100/uPyCraft_PyQt5.git
$ cd uPyCraft_PyQt5
$ pyinstaller -F uPyCraft.py
47 INFO: PyInstaller: 3.4
47 INFO: Python: 3.6.5
47 INFO: Platform: Linux-4.18.7-041807-generic-x86_64-with-Ubuntu-18.04-bionic
48 INFO: wrote ....../uPyCraft_PyQt5/uPyCraft.spec
50 INFO: UPX is not available.
51 INFO: Extending PYTHONPATH with paths
['....../uPyCraft_PyQt5',
'....../uPyCraft_PyQt5']
52 INFO: checking Analysis
54 INFO: Building because inputs changed
54 INFO: Initializing module dependency graph...
57 INFO: Initializing module graph hooks...
59 INFO: Analyzing base_library.zip ...
2747 INFO: running Analysis Analysis-00.toc
2776 INFO: Caching module hooks...
2779 INFO: Analyzing ....../uPyCraft_PyQt5/uPyCraft.py
3619 INFO: Loading module hooks...
3619 INFO: Loading module hook "hook-PyQt5.QtGui.py"...
3749 INFO: Loading module hook "hook-pydoc.py"...
3750 INFO: Loading module hook "hook-PyQt5.QtWidgets.py"...
3832 INFO: Loading module hook "hook-xml.py"...
3914 INFO: Loading module hook "hook-PyQt5.QtCore.py"...
3933 INFO: Loading module hook "hook-PyQt5.QtPrintSupport.py"...
4057 INFO: Loading module hook "hook-encodings.py"...
4126 INFO: Loading module hook "hook-PyQt5.py"...
4170 WARNING: Hidden import "sip" not found!
4179 INFO: Looking for ctypes DLLs
4274 WARNING: library setupapi required via ctypes not found
4299 WARNING: library Advapi32 required via ctypes not found
4367 INFO: Analyzing run-time hooks ...
4370 INFO: Including run-time hook 'pyi_rth_qt5.py'
4376 INFO: Looking for dynamic libraries
8225 INFO: Looking for eggs
8225 INFO: Python library not in binary dependencies. Doing additional searching...
8292 INFO: Using Python library /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
8301 INFO: Warnings written to ....../uPyCraft_PyQt5/build/uPyCraft/warn-uPyCraft.txt
8339 INFO: Graph cross-reference written to ....../uPyCraft_PyQt5/build/uPyCraft/xref-uPyCraft.html
8352 INFO: checking PYZ
8354 INFO: Building because name changed
8354 INFO: Building PYZ (ZlibArchive) ....../uPyCraft_PyQt5/build/uPyCraft/PYZ-00.pyz
8762 INFO: Building PYZ (ZlibArchive) ....../uPyCraft_PyQt5/build/uPyCraft/PYZ-00.pyz completed successfully.
8765 INFO: checking PKG
8767 INFO: Building because name changed
8767 INFO: Building PKG (CArchive) PKG-00.pkg
33163 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
33168 INFO: Bootloader ~/.local/lib/python3.6/site-packages/PyInstaller/bootloader/Linux-64bit/run
33168 INFO: checking EXE
33170 INFO: Building because name changed
33170 INFO: Building EXE from EXE-00.toc
33175 INFO: Appending archive to ELF section in EXE ....../uPyCraft_PyQt5/dist/uPyCraft
33753 INFO: Building EXE from EXE-00.toc completed successfully.

2. Run and test uPyCraft_PyQt5

To run uPyCraft_PyQt5

1
2
$ cd dist
$ ./uPyCraft
uPyCraft

So far, 6 boards are particularly supported:

For the sake of our requirements, openmv is going to be supported in particular.