Skip to main content

MicroPython Nextion library

Downloads Release MicroPython License: MIT

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.active(True)
station.connect('SSID', 'PASSWORD')
station.isconnected()

General

Install the latest package version of this lib on the MicroPython device

import mip
mip.install("github:brainelectronics/micropython-nextion")

For MicroPython versions below 1.19.1 use the upip package instead of mip

import upip
upip.install('micropython-nextion')

Specific version

Install a specific, fixed package version of this lib on the MicroPython device

import mip
# install a verions of a specific branch
mip.install("github:brainelectronics/micropython-nextion", version="feature/add-mip-package-file")
# install a tag version
mip.install("github:brainelectronics/micropython-nextion", version="0.15.0")

For MicroPython versions below 1.19.1 use the upip package instead of mip

import upip
upip.install('micropython-nextion')

Test version

Install a specific release candidate version uploaded to Test Python Package Index on every PR on the MicroPython device. If no specific version is set, the latest stable version will be used.

import mip
mip.install("github:brainelectronics/micropython-nextion", version="0.15.0-rc1.dev29")

For MicroPython versions below 1.19.1 use the upip package instead of mip

import upip
# overwrite index_urls to only take artifacts from test.pypi.org
upip.index_urls = ['https://test.pypi.org/pypi']
upip.install('micropython-nextion')

See also brainelectronics Test PyPi Server in Docker for a test PyPi server running on Docker.

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

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.

Metadata

Release files for be-micropython-nextion 0.15.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for be-micropython-nextion 0.15.2
File Size Uploaded
be-micropython-nextion-0.15.2.tar.gz 19.2 kB Details

Release files / be-micropython-nextion-0.15.2.tar.gz

Download URL be-micropython-nextion-0.15.2.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bc7353f9ca1bdf8649847f5c2779af6d52b180180e4381cb3bce11e44ea3b45a
BLAKE2b-256 checksum
How to use checksums
6bdacbf64626651d4d4cdcfdc3ea4462e14cff610164bd443f9aa605666035ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.16

Release history Release notifications | RSS feed

This release

0.15.2 This release

1 release file

0.15.1

1 release file

0.15.0

1 release file

0.14.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page