MicroPython Nextion serial displays library
Project description
MicroPython Nextion library
MicroPython Nextion library
General
Ported library to interact with Nextion serial displays, based on the ITEAD Arduino Nextion library.
Installation
Install required tools
Python3 must be installed on your system. Check the current Python version with the following command
python --version
python3 --version
Depending on which command Python 3.x.y
(with x.y as some numbers) is
returned, use that command to proceed.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Setup
Install package with upip
Connect the MicroPython device to a network (if possible)
import network
station = network.WLAN(network.STA_IF)
station.connect('SSID', 'PASSWORD')
station.isconnected()
and install this lib on the MicroPython device like this
import upip
upip.install('micropython-nextion')
Manually
Upload files to board
Copy the module to the MicroPython board and import them as shown below using Remote MicroPython shell
Open the remote shell with the following command. Additionally use -b 115200
in case no CP210x is used but a CH34x.
rshell --port /dev/tty.SLAB_USBtoUART --editor nano
Perform the following command inside the rshell
to copy all files and
folders to the device
mkdir /pyboard/lib
mkdir /pyboard/lib/nextion
cp nextion/* /pyboard/lib/nextion
cp examples/basic/main.py /pyboard
cp examples/boot.py /pyboard
Install additional MicroPython packages
To use this package with the provided boot.py
and one of
the main.py
files of an example subfolder, the additional
module ulogging
is required.
Either install the required package(s) using upip
as follows after
connecting to a WiFi network:
# network connection already established
import upip
upip.install('micropython-ulogging')
or copy it manually to the MicroPython board using e.g. rshell
:
mkdir /pyboard/lib
cp -r libs_external/* /pyboard/lib
Usage
Use one of the examples to get started. Read also the examples README to find all supported elements
Credits
Big thank you to ITEAD Studio for the implementation of the Arduino library.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for micropython-nextion-0.14.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c77ae2fe220a08e6ff637b377cff45ed7d8955d1f90cc1049d857a17166b9d18 |
|
MD5 | 89a98e4f3c0912cbfaf5d842116bfa0b |
|
BLAKE2b-256 | b37b87e1f5e2726cf83682c0f3f5603e69d4a10d06dd25894a3cb84ed8309f15 |