Skip to content

Commit e8c72ed

Browse files
Merge pull request #37 from brainelectronics/feature/remove-dependencies
Remove external dependencies and update docs
2 parents 538f7d0 + 826b71a commit e8c72ed

File tree

11 files changed

+292
-190
lines changed

11 files changed

+292
-190
lines changed

.flake8

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ exclude =
4343
.idea
4444
.bak
4545
# custom scripts, not being part of the distribution
46-
libs_external
4746
sdist_upip.py
4847
setup.py
49-
nextion/ulogging.py
5048

5149
# Provide a comma-separated list of glob patterns to add to the list of excluded ones.
5250
# extend-exclude =

.github/workflows/test.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ jobs:
6868
- name: Test build package
6969
run: |
7070
twine check dist/*
71-
# - name: Validate mip package file
72-
# run: |
73-
# upy-package \
74-
# --setup_file setup.py \
75-
# --package_changelog_file changelog.md \
76-
# --package_file package.json \
77-
# --validate
71+
- name: Validate mip package file
72+
run: |
73+
upy-package \
74+
--setup_file setup.py \
75+
--package_changelog_file changelog.md \
76+
--package_file package.json \
77+
--validate \
78+
--ignore-version

QUICKSTART.md

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,46 @@ esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART erase_flash
2222
esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART --baud 921600 write_flash -z 0x1000 esp32spiram-20220117-v1.18.bin
2323
```
2424

25-
### Install package on board with pip
25+
### Install package
2626

27-
```bash
28-
rshell -p /dev/tty.SLAB_USBtoUART --editor nano
27+
Connect the MicroPython device to a network (if possible)
28+
29+
```python
30+
import network
31+
station = network.WLAN(network.STA_IF)
32+
station.active(True)
33+
station.connect('SSID', 'PASSWORD')
34+
station.isconnected()
2935
```
3036

31-
Inside the rshell
37+
Install the latest package version of this lib on the MicroPython device
3238

33-
```bash
34-
cp examples/progressbar/main.py /pyboard
35-
cp examples/boot.py /pyboard
36-
repl
39+
```python
40+
import mip
41+
mip.install("github:brainelectronics/micropython-nextion")
3742
```
3843

39-
Inside the REPL
44+
For MicroPython versions below 1.19.1 use the `upip` package instead of `mip`
4045

4146
```python
42-
import machine
43-
import network
44-
import time
4547
import upip
48+
upip.install('micropython-nextion')
49+
```
4650

47-
station = network.WLAN(network.STA_IF)
48-
station.active(True)
49-
station.connect('SSID', 'PASSWORD')
50-
time.sleep(1)
51-
print('Device connected to network: {}'.format(station.isconnected()))
51+
### Copy example file
5252

53-
upip.install('micropython-nextion')
53+
Copy one of the provided example `main.py` files to the MicroPython device.
5454

55-
print('Installation completed')
56-
machine.soft_reset()
55+
```bash
56+
rshell --port /dev/tty.SLAB_USBtoUART --editor nano
57+
```
58+
59+
Perform the following command inside the `rshell` to copy the Progressbar example to the MicroPython device.
60+
61+
```bash
62+
cp examples/progressbar/main.py /pyboard
63+
cp examples/boot.py /pyboard
64+
repl
5765
```
5866

5967
<!-- Links -->

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pip install -r requirements.txt
3838

3939
## Setup
4040

41-
### Install package with upip
41+
### Install package
4242

4343
Connect the MicroPython device to a network (if possible)
4444

changelog.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ r"^\#\# \[\d{1,}[.]\d{1,}[.]\d{1,}\] \- \d{4}\-\d{2}-\d{2}$"
1717
-->
1818

1919
## Released
20+
## [0.16.0] - 2023-06-12
21+
### Added
22+
- Validate `package.json` file with every test workflow run but without version validation
23+
- Basic setup instructions added to docs examples file
24+
25+
### Changed
26+
- Update `nextion/ulogging.py` to [version 0.5 of micropython-lib](https://github.com/micropython/micropython-lib/blob/7128d423c2e7c0309ac17a1e6ba873b909b24fcc/python-stdlib/logging/logging.py)
27+
28+
### Removed
29+
- Outdated and unused `libs_external` folder with `ulogging.py`
30+
- `libs_external` and `nextion/ulogging.py` removed from `.flake8` exclude list
31+
32+
### Fixed
33+
- Installation instructions in Quickstart document are using `mip`
34+
2035
## [0.15.3] - 2023-05-17
2136
### Fixed
2237
- Publish releases to PyPi again as `micropython-nextion`, see #35
@@ -229,8 +244,9 @@ r"^\#\# \[\d{1,}[.]\d{1,}[.]\d{1,}\] \- \d{4}\-\d{2}-\d{2}$"
229244
- [Example HMI file](examples/everything.HMI) to be used for all examples
230245

231246
<!-- Links -->
232-
[Unreleased]: https://github.com/brainelectronics/micropython-nextion/compare/0.15.3...develop
247+
[Unreleased]: https://github.com/brainelectronics/micropython-nextion/compare/0.16.0...develop
233248

249+
[0.16.0]: https://github.com/brainelectronics/micropython-nextion/tree/0.16.0
234250
[0.15.3]: https://github.com/brainelectronics/micropython-nextion/tree/0.15.3
235251
[0.15.2]: https://github.com/brainelectronics/micropython-nextion/tree/0.15.2
236252
[0.15.1]: https://github.com/brainelectronics/micropython-nextion/tree/0.15.1

docs/EXAMPLES.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,26 @@ Usage examples of this `micropython-nextion` library
99
An example of all implemented functionalities can be found at the
1010
[MicroPython Nextion examples folder][ref-micropython-nextion-examples]
1111

12+
## Setup Nextion
13+
14+
```python
15+
from nextion import NexHardware
16+
17+
# define communication pins for Nextion display
18+
tx_pin = 21
19+
rx_pin = 22
20+
21+
# create Nextion hardware interface
22+
nh = NexHardware(rx_pin=rx_pin, tx_pin=tx_pin)
23+
24+
# init nextion communication interface
25+
nh.nexInit()
26+
27+
# modify text field "t0" showing "newtxt" by default
28+
cmd = 't0.txt="asdf"'
29+
nh.sendCommand(cmd)
30+
```
31+
1232
## Special hints
1333

1434
### Access object on a non active page

examples/boot_wifi.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"""
1111

1212
# system packages
13-
import esp
1413
import gc
1514
import machine
1615
import network
@@ -20,15 +19,6 @@
2019
# import machine
2120
# machine.freq(240000000)
2221

23-
# disable ESP os debug output
24-
esp.osdebug(None)
25-
26-
# set pin D4 as output (blue LED)
27-
led_pin = machine.Pin(4, machine.Pin.OUT)
28-
29-
# turn onboard LED on
30-
led_pin.value(1)
31-
3222
station = network.WLAN(network.STA_IF)
3323
if station.active() and station.isconnected():
3424
station.disconnect()
@@ -75,9 +65,6 @@
7565

7666
print('Created Accesspoint: {}'.format(accesspoint_name))
7767

78-
# turn onboard LED off
79-
led_pin.value(0)
80-
8168
print('Restart cause: {}'.format(machine.reset_cause()))
8269

8370
# run garbage collector at the end to clean up

libs_external/ulogging.py

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)