| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung |
| unipagernextion [2018/02/26 11:35] – [Nextion Touch Display for UniPager] dh3wr | unipagernextion [2018/11/12 20:27] (aktuell) – [Nextion Touch Display for UniPager] oe7bsh |
|---|
| ====== Nextion Touch Display for UniPager ====== | ====== Nextion Touch Display for UniPager ====== |
| |
| Zu jedem schönen Projekt gehört mittlerweile auch ein Display. Die Varianten der Firma Nextion sind sehr beliebt auf Grund ihrer Fähigkeiten und ihres Preises. Der Anschluss geschieht über einen USB-TTL 3,3 Volt Wandler, da der interne UART-Port auf dem RasPi bereits belegt ist beim RasPagerC9000. Die Software ist in Entwicklung. [[https://github.com/rwth-afu/UniPagerNextion|https://github.com/rwth-afu/UniPagerNextion]] | Every project nowadays reaches for nice user interface. The display models from the company Nextion are quite famous due to their price and capabilities. The connection is made by a 3.3 V UART interface, either by a USB-TTL 3.3 V adapter or via the RasPi's onboard UART, if not already used. The software is written in Python can can be found here. [[https://github.com/rwth-afu/UniPagerNextion|https://github.com/rwth-afu/UniPagerNextion]] |
| |
| | Start-Animation of the Displays: |
| | {{ ::unipager:unipager_nextion_startup.jpg?direct&600 |Start-Animation des Displays}} |
| | |
| | View from running mode: |
| | {{ ::unipager:unipager_nextion_betrieb.jpg?direct&600 |nsicht im laufenden Betrieb}} |
| | |
| | View in 19 inch frame: |
| | {{ ::unipager:frontansicht.jpg?direct&600 |Ansicht im 19 Zoll Gehäuse}} |
| | |
| | Possible suppliers: |
| | * https://www.exp-tech.de/displays/lcd/7179/itead-studio-nextion-nx4024t032-generic-3.2-hmi-tft-intelligent-lcd-touch-display-module |
| | * https://www.komputer.de/zen/index.php?main_page=product_info&products_id=354 |
| |
| ===== Supported Display types ===== | ===== Supported Display types ===== |
| In general, all display types from nextion are supported, but it is recommended to use as minimum the 3,2 inch version in order to have sufficient space on the display. | In general, all display types from nextion are supported, but it is recommended to use as minimum the 3,2 inch version in order to have sufficient space on the display. |
| The type code is NX4024T032 [[https://nextion.itead.cc/resources/datasheets/nx4024t032|Link to the manufacturer]]. | The type code is NX4024T032 [[https://nextion.itead.cc/resources/datasheets/nx4024t032|Link to the manufacturer]]. There is also a version with 4.2 inch available. |
| |
| Be aware: The Updates of [[unipager|Unipager]] may not always be compatible with the UniPagerNextion software. If something is not working after an update, let us know and write a ticket to <code>support at hampager.de</code> or [[https://support.hampager.de/open.php|open a ticket]] directly. | Be aware: The updates of [[unipager|Unipager]] may not always be compatible with the UniPagerNextion software. If something is not working after an update, let us know and write a ticket to <code>support at hampager.de</code> or [[https://support.hampager.de/open.php|open a ticket]] directly. |
| |
| ====== Installation ====== | ====== Installation ====== |
| ===== Preparation ===== | ===== Preparation ===== |
| Install unipager as described on the [[unipager|Unipager]] section of this wiki. | Install unipager as described on the [[unipager|Unipager]] section of this wiki. |
| Install git with | Install ''git'' with |
| <code>sudo apt-get install git</code> | <code>sudo apt-get install git</code> |
| |
| ===== Software download and install ===== | ===== Software download and install ===== |
| Clone the github repository containing all the software needed into a temporary directory, e.g. ///home/pi/// | Clone the github repository containing all the software needed into a temporary directory, e.g. ''/home/pi'' |
| <code>git clone https://github.com/rwth-afu/UniPagerNextion.git</code> | <code>git clone https://github.com/rwth-afu/UniPagerNextion.git</code> |
| cd into the directory of the install script and run it: | cd into the directory of the install script and run it: |
| </code> | </code> |
| |
| This will install the python script to ///usr/local/bin/unipagernextion.py// and install a systemd service file named ///usr/local/lib/systemd/system/unipagernextion.service//. It will also register this service. | This will install the python script to ''/usr/local/bin/unipagernextion.py'' and install a systemd service file named ''/usr/local/lib/systemd/system/unipagernextion.service''. It will also register this service. |
| |
| Now edit the config file in ///etc/unipagernextionconfig.py// according to your need: | Now edit the config file in ''/etc/unipagernextionconfig.py'' according to your needs: |
| <code>sudo nano /etc/unipagernextionconfig.py</code> | <code>sudo nano /etc/unipagernextionconfig.py</code> |
| <file> | <file> |
| |
| In the general case, no adaption is needed. | In the general case, no adaption is needed. |
| | {{::icons:warning.png?direct |}}{{ :icons:warning.png?direct|}}As we have learned, not everybody is familiar with the concept of //commenting-in und out// [[https://en.wikipedia.org/wiki/Comment_(computer_programming)|Read more.]] So to be extremly clear here: |
| |
| | ''# Something'' means that //Something// is <color #ed1c24>IS NOT</color> active |
| | |
| | ''Something'' means that //Something// <color #22b14c>IS</color> active |
| | |
| | Keep in mind to restart the UnipagerNextion service after altering the config file. |
| |
| |
| ===== Hardware connection of the Nextion display ===== | ===== Hardware connection of the Nextion display ===== |
| | There are two ways of connection the Nextion display to the Raspberry Pi. |
| |
| | ==== Direct connection to GPIO UART ==== |
| | If you do not use the [[raspager|Raspager]] or [[raspagerc9000|RaspagerC9000]], the GPIO is free to use. So you can conntect the four cables from the Nextion directly to the GPIO header. |
| |
| ==== Loading the software on the Nextion display ==== | {{ :unipager:unipager:detail-raspi.jpg?direct&600 |}} |
| |
| | Pin association to connect the Nextion display directly to the Raspberry Pi on-board UART. |
| | |
| | <color #ed1c24>RED</color> 5 V Pin 02 or Pin 04 |
| | |
| | BLACK GND Pin 06 or any other ground Pin |
| | |
| | <color #22b14c>GREEN</color> Pin 10 |
| | |
| | <color #ffc90e>YELLOW</color> Pin 08 |
| | |
| | {{::icons:warning.png?direct |}}{{ :icons:warning.png?direct|}}Remember: In the default raspbian image, on Raspberry Pi 3B and Raspberry Pi 3B+, the internal Bluetooth is connected to the internal UART. So as it is quite likely you won't use the Bluetooth, disable it by adding a line |
| | <code>dtoverlay=pi3-disable-bt</code> to ''/boot/config.txt'' and disable the Bluetooth service with |
| | <code>sudo systemctl disable hciuart</code> |
| | |
| | Also free the UART from the kernel messages by removing |
| | <code>console=serial0,115200</code> from ''/boot/cmdline.txt'' and enable the UART by adding |
| | <code>enable_uart=1</code> to ''/boot/config.txt'' |
| | |
| | Further information is just one google search away: [[https://www.raspberrypi.org/documentation/configuration/uart.md|one google search away]]. |
| | |
| | |
| | Reboot your Pi after doing these actions. |
| | |
| | |
| | |
| | ==== Connect via USB2Serial-Adapter ==== |
| | |
| | In case the onboard UART is not available, you can use a USB-to-Serial adapter. |
| | {{ ::unipager:nextion_with_usb2ser.jpg?direct&600 |}} |
| | |
| | {{ ::unipager:usb2ser.jpg?direct&600 |}} |
| | |
| | ==== Loading the software on the Nextion display ==== |
| | There is a python script at [[https://github.com/rwth-afu/UniPagerNextion/tree/master/src|https://github.com/rwth-afu/UniPagerNextion/tree/master/src]]. Edit the COM-Port according to your connection and run it with the ''.tft'' file. For firmware update of the display itself a programming with the Windows software from Nextion is recommended. |
| |
| |
| |