Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX6UL-AN-0004: Using Python for Embedded applications

223 bytes removed, 10:56, 7 October 2021
easy install
root@desk-mx6ul-axelulite:~# easy3_install pyserial
Searching for pyserial
Reading https://pypi.python.org/simple/pyserial/Downloading https://files.pythonhosted.org/packages/07/bc/587a445451b253b285629263eb51c2d8e9bcea4fc97826266d186f96f558/pyserial-3.5-py2.py3-none-any.whl#sha256=c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0Best match: pyserial 3.45Processing pyserial-3.5-py2.py3-none-any.whlInstalling pyserial-3.5-py2.py3-none-any.whl to /usr/lib/python3.5/site-packageswriting requirements to /usr/lib/python3.5/site-packages/pyserial-3.5-py3.5.egg/EGG-INFO/requires.txtAdding pyserial 3.4 5 to easy-install.pth fileInstalling pyserial-miniterm script to /usr/binInstalling pyserial-ports script to /usr/bin
Using Installed /usr/lib/python3.5/site-packages/pyserial-3.5-py3.5.egg
Processing dependencies for pyserial
Finished processing dependencies for pyserial
writing requirements to /usr/lib/python3.5/site-packages/pymodbus-2.5.3rc1-py3.5.egg/EGG-INFO/requires.txt
Adding pymodbus 2.5.3rc1 to easy-install.pth file
Installing pymodbus.console script to /usr/bin
Installing pymodbus.server script to /usr/bin
Installing pymodbus.console script to /usr/bin
Installed /usr/lib/python3.5/site-packages/pymodbus-2.5.3rc1-py3.5.egg
Installed /usr/lib/python3.5/site-packages/urllib3-1.26.7-py3.5.egg
Searching for idna<4,>=2.5
Reading https://pypi.python.org/simple/idna/
Downloading https://files.pythonhosted.org/packages/d7/77/ff688d1504cdc4db2a938e2b7b9adee5dd52e34efbd2431051efc9984de9/idna-3.2-py3-none-any.whl#sha256=14475042e284991034cb48e06f6851428fb14c4dc953acd9be9a5e95c7b6dd7a
Best match: idna 3.2
Processing idna-3.2-py3-none-any.whl
Installing idna-3.2-py3-none-any.whl to /usr/lib/python3.5/site-packages
Adding idna 3.2 to easy-install.pth file
 
Installed /usr/lib/python3.5/site-packages/idna-3.2-py3.5.egg
Searching for charset-normalizer~=2.0.0
Reading https://pypi.python.org/simple/charset-normalizer/
</pre>
On top of that, some web packages are very useful for creating web application and remotely control/get information from the gateway: '''[https://bottlepy.org/docs/dev/ bottle]''' (lightweight WSGI micro web-framework), '''[https://pypi.org/project/fastapi/ fastapi]''' (high-performance web framework). For this task we used <code>pip3</code>:
<pre class="board-terminal">
root@desk-mx6ul-axelulite:~# easy3_install bottleSearching for pip3 install bottleReading httpsDEPRECATION://pypiPython 3.5 reached the end of its life on September 13th, 2020.pythonPlease upgrade your Python as Python 3.org/simple/bottle/Downloading https://files5 is no longer maintained.pythonhostedpip 21.org/packages/bf/44/aeafdd6ca05a8e1c3f91eeeb272a202d5cb1b3b23730a5ca686a81c48d24/bottle-0will drop support for Python 3.125 in January 2021.19-py3-none-anypip 21.whl#sha256=f6b8a34fe9aa406f9813c02990db72ca69ce6a158b5b156d2c41f345016a723dBest match: bottle 0will remove support for this functionality.12.19Processing Collecting bottle-0.12.19-py3-none-any.whlInstalling Downloading bottle-0.12.19-py3-none-any.whl to /usr/lib/python3.5(89 kB) |################################| 89 kB 486 kB/site-packagesAdding bottle 0.12.19 to easy-install.pth filesInstalling collected packages: bottle.py script to /usr/bin Installed /usr/lib/python3.5/site-packages/Successfully installed bottle-0.12.19-py3.5.eggProcessing dependencies for bottleFinished processing dependencies for bottleroot@desk-mx6ul-axelulite:~# easy3_install fastapiSearching for fastapipip3 install flaskReading httpsDEPRECATION://pypiPython 3.5 reached the end of its life on September 13th, 2020.pythonPlease upgrade your Python as Python 3.org/simple/fastapi/Downloading https://files5 is no longer maintained.pythonhostedpip 21.org/packages/92/a8/10d8a171afa66e6e8a5cfe82771d11c4c84a2a874c19c0b55c7099001fac/fastapi-0will drop support for Python 3.685 in January 2021.2-py3-none-anypip 21.whl#sha256=36bcdd3dbea87c586061005e4a40b9bd0145afd766655b4e0ec1d8870b32555cBest match: fastapi 0will remove support for this functionality.68.2Processing fastapiCollecting flask Downloading Flask-01.681.2-py3-none4-anypy2.whlInstalling fastapi-0.68.2-py3-none-any.whl to /usr/lib/python3.5/site-packages(94 kB)writing requirements to /usr/lib |################################| 94 kB 299 kB/python3.5/site-packages/fastapi-0.68.2-py3.5.egg/EGG-INFO/requires.txtsAdding fastapi 0.68.2 to easy-installCollecting click<8.pth file Installed /usr/lib/python3.5/site-packages/fastapi-0.68.2-py3.,>=5.eggProcessing dependencies for fastapiSearching for starlette==0.14.2Reading https://pypi.python.org/simple/starlette/1 Downloading https://files.pythonhosted.org/packages/15/34/db1890f442a1cd3a2c761f4109a0eb4e63503218d70a8c8e97faa09a5500/starletteclick-07.141.2-py2.py3-none-any.whl(82 kB) |###sha256=3c8e48e52736b3161e34c9f0e8153b4f32ec5d8995a3ee1d59410d92f75162ed#############################| 82 kB 75 kB/sBest match: starlette Collecting Jinja2<3.0,>=2.1410.21Processing starlette Downloading Jinja2-02.1411.2-py3-none-any.whlInstalling starlette3-0py2.14.2-py3-none-any.whl to /usr/lib/python3.5/site-packages(125 kB)writing requirements to /usr/lib |################################| 125 kB 228 kB/python3.5/site-packages/starlette-0.14.2-py3.5.egg/EGG-INFO/requires.txtsAdding starlette 0.14.2 to easy-install.pth file Installed /usr/lib/python3.5/site-packages/starlette-0.14.2-py3.5.eggSearching for pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,Collecting itsdangerous<2.0.0,>=10.6.2Reading https://pypi.python.org/simple/pydantic/24 Downloading https://files.pythonhosted.org/packages/ff/74/54e030641601112309f6d2af620774e9080f99c7a15742fc6a0b170c4076/pydanticitsdangerous-1.81.20-py2.py3-none-any.whl#sha256=fec866a0b59f372b7e776f2d7308511784dace622e0992a0b59ea3ccee0ae833(16 kB)Best match: pydantic 1Collecting Werkzeug<2.80,>=0.215Processing pydantic Downloading Werkzeug-1.80.21-py2.py3-none-any.whl(298 kB)Installing pydantic-1.8.2-py3-none-any.whl to |################################| 298 kB 141 kB/usr/lib/python3sCollecting MarkupSafe>=0.5/site-packages23writing requirements to /usr/lib/python3.5/site-packages/pydantic Downloading MarkupSafe-1.8.2-py31.5.egg/EGG-INFO/requires.txtAdding pydantic 1.8tar.2 to easy-install.pth filegz (19 kB)Building wheels for collected packages: MarkupSafeInstalled /usr/lib/python3 Building wheel for MarkupSafe (setup.5/site-packages/pydantic-1py) .8.2-py3.5.eggdoneSearching Created wheel for typingMarkupSafe: filename=MarkupSafe-extensions>=31.71.41-cp35-cp35m-linux_armv7l.3whl size=30216 sha256=8625a9a35d280496da7b267207b70a9484b699e18f17bb869ca8bfa8ea4dfb25Reading https Stored in directory:/home/root/pypi.python.orgcache/simplepip/typing-extensionswheels/Downloading https:18/c6/files.pythonhosted.org76/e7b4c7aeea1fc00134bfddf7ebadb0d91afda4c958b5bd4032Successfully built MarkupSafeInstalling collected packages/74/60/18783336cc7fcdd95dae91d73477830aa53f5d3181ae4fe20491d7fc3199/typing_extensions: MarkupSafe, Werkzeug, Jinja2, itsdangerous, click, flaskSuccessfully installed Jinja2-3.102.011.23 MarkupSafe-py3-none-any1.whl#sha256=f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34Best match: typing-extensions 31.10.0.2Processing typing_extensions1 Werkzeug-3.101.0.21 click-py3-none-any7.whlInstalling typing_extensions-3.10.01.2flask-py3-none-any1.whl to /usr/lib/python31.5/site4 itsdangerous-packagesAdding typing-extensions 31.101.0.2 to easy-install.pth file Installed /usr/lib/python3.5/siteroot@desk-packages/typing_extensionsmx6ul-3.10.0.2-py3.5.eggFinished processing dependencies for fastapiaxelulite:~#
</pre>
8,204
edits