Tutorial d’installation d’un écran Nextion pour MMDVM

Dans la suite de mes articles pédagogiques sur MMDVM, je vous propose cette fois-ci un tutorial expliquant étape par étape, comment ajouté un écran Nextion (itead) sur votre relais MMDVM.

Programmation initiale de l’écran Nextion

Prérequis logiciel

Nous avons besoin de rajouter le module logiciel serial au langage python

sudo apt-get install python-serial

Configuration du port série /dev/ttyAMA0

Dévalider l’accès à la console par le port série. (Vous êtes connecté par un autre moyen).

sudo raspi-config

Configurer le port série et redémarrer le Raspberry Pi

Raccordement de l’écran

L’écran doit à présent être raccordé au port série (appelé UART) du Raspberry Pi, afin de pouvoir le programmer à l’étape suivante.

 

Cablage du Raspberry Pi (GPIO) à l’écran Nextion

Chargement du firmware MMDVM sur l’écran Nextion

Sélectionner tout d’abord le fichier que vous allez charger en fonction de l’écran. Consultez la référence de l’écran indiqué sur le dos de celui-ci. Dans le cas de notre exemple, l’écran est sérigraphié NX3224T024_011. Nous allons identifier le nom du fichier avec les commandes suivantes

cd /opt/MMDVMHost/Nextion
ls
ls *24T024*

Nous trouvons deux fichiers correspondant à cet écran. Le fichier .HMI est le format natif. Le fichier .tft est le fichier binaire compilé qui sera chargé sur l’écran à l’étape suivante.

Nous allons à présent charger le fichier grâce au programme python nextion.py fourni. Le premier paramètre est le nom du fichier tft à charger, le second paramètre est le port série cible.

 sudo python nextion.py NX3224T024.tft /dev/ttyAMA0

 

L’écran s’allume. Le logo MMDVM s’affiche.

Raccordement et configuration de MMDVM

Choix du raccordement

Il existe deux possibilités de raccordement de votre écran Nextion:

  • Sur le Raspberry Pi, branché à l’identique de ce qui a été indiquée ci-dessous pour la partie programmation
  • Sur la carte de filtrage MMDVM (Arduino ou STM32 , ou autre …)

Nous allons expliciter les deux manières de procéder.

L’écran Nextion sur le Raspberry Pi

Il nous faut valider le fonctionnement de l’écran en modifiant le fichier de configuration MMDVM.ini

sudo nano /opt/MMDVMHost/MMDVM.ini

En début du fichier, section [General] nous allons spécifier l’écran

[General]
Callsign=F5ZKS
Timeout=600
Duplex=1
# ModeHang=10
RFModeHang=10
NetModeHang=3
Display=Nextion
#Display=None
Daemon=0

Et nous vérifions que la section [Nextion] précise bien le port série utilisé

[Nextion]
# Port=modem
Port=/dev/ttyAMA0
Brightness=50
DisplayClock=1
UTC=0
IdleBrightness=20

Nous enregistrons le fichier modifié (Ctrl-X), et Yes

Nous redémarrons le Raspberry Pi

sudo reboot

L’écran s’allume et indique que MMDVM est prêt (Idle). L’indicatif et l’ID du relais est affiché.

L’écran Nextion sur la platine de filtrage MMDVM

Nous allons nous intéresser à la seconde possibilité de raccordement, celle de la platine de filtrage.

Configuration logiciel du firmware MMDVM

Notez que pour plus de détail sur le processus de mise à jour du firmware, référez-vous à l’article Installation de MMDVM sur une carte STM32F4xx

Nous modifions le fichier de configuration du firmware Config.h, en validant le port série pour l’afficheur Nextion (SERIAL_REPEATER), en bas de fichier

Puis on recompile de firmware MMDVM (cf. “Lancer la compilation” dans  Installation de MMDVM sur une carte STM32F4xx).

On recharge la cible (avec STM32 utility pour Nucleo par exemple, voir :fr]Installation de MMDVM sur une carte STM32F4xx).

Configuration de MMDVMHost

Nous spécifions au fichier MMDVM.ini à présent que l’écran Nextion est raccordé sur le modem MMDVM.

sudo nano /opt/MMDVMHost/MMDVM.ini
[Nextion]
Port=modem
#Port=/dev/ttyAMA0
Brightness=50
DisplayClock=1
UTC=0
IdleBrightness=20

Dans la section [General], l’écran est spécifié Nextion.

[General]
Callsign=F5ZKS
Timeout=600
Duplex=1
# ModeHang=10
RFModeHang=10
NetModeHang=3
Display=Nextion
#Display=None
Daemon=0

Raccordement de l’écran sur le modem MMDVM

Brancher sur la platine MMDVM pour STM32 comme présenté sur la photo ci-dessous.

Nous redémarrons le Raspberry Pi

sudo reboot

Votre afficheur est opérationnel.

Modem MMDVM, sur Nucleo STM32F4, écran iTead Nextion et Raspberry Pi

Installation de MMDVM sur une carte STM32F4xx .

We modify the config.h firmware configuration file, validating the serial port for the Nextion display (SERIAL_REPEATER), at the end of the file.

Then you recompile MMDVM firmware (see “Start compilation” in Installation de MMDVM sur une carte STM32F4xx).

We reload the target (with STM32 utility for Nucleo for example, see Installation de MMDVM sur une carte STM32F4xx).

Configuring MMDVMHost

We now specify in MMDVM.ini file so that the Nextion screen is connected to the MMDVM modem.

sudo nano /opt/MMDVMHost/MMDVM.ini
[Nextion]
Port=modem
#Port=/dev/ttyAMA0
Brightness=50
DisplayClock=1
UTC=0
IdleBrightness=20

In the [General] section, the screen is specified as Nextion.

[General]
Callsign=F5ZKS
Timeout=600
Duplex=1
# ModeHang=10
RFModeHang=10
NetModeHang=3
Display=Nextion
#Display=None
Daemon=0

Connecting the display to the MMDVM modem

Plug into the MMDVM Nucleo STM32 shield as shown on the picture below.

We restart the Raspberry Pi

sudo reboot

Your display is operational.

MMDVM modem, on Nucleo STM32F4, iTead Nextion screen and Raspberry Pi

N’hésitez pas à utiliser les commentaires pour toute aide jugée nécessaire…

If you would be interested to participate in a possible future new grouped order (MMDVM board, SvxLink Card), leave your email below to be reported!

19 réflexions au sujet de « Tutorial d’installation d’un écran Nextion pour MMDVM »

  1. Bonjour,
    j’utilise le langage Basic Bascom pour Arduino, (un bon vx basic compiler ultra rapide) je voudrais utiliser les écrans Nextion mais je ne trouve nul part la config du port série pour envoyer les commandes.
    Pouvez vous me donner les réglages , j’aurais besoin de qq chose comme ça:
    Config Com1 = 19200 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
    Merci de votre aide

    (translation)
    Hello,
    I use the Basic Bascom language for Arduino, (a good vx basic compiler ultra fast) I would like to use Nextion screens but I can not find the serial port config to send the commands anywhere.
    Can you give me the settings, I would need qq something like this:
    Config Com1 = 19200, Synchrone = 0, Parity = None, Stopbits = 1, Databits = 8, Clockpol = 0
    Thank you for your help

    1. Bonjour Jean-Pierre,

      Par défaut l’écran que j’ai utilisé répond à 9600, mais vous pouvez le pousser à 115200 bauds (instruction bauds , voir https://www.itead.cc/wiki/Nextion_Instruction_Set).
      A priori, le protocole est 8bits et 1 stop bits, pas de parité (http://support.iteadstudio.com/support/discussions/topics/11000011760).

      Bon bricolage

      (translation)
      Hello Jean-Pierre,

      By default the screen I have used works at 9600, but you can push it to 115200 baud (bauds command, see https://www.itead.cc/wiki/Nextion_Instruction_Set).
      The protocol must be 8 bits with 1 stop bit, no parity (http://support.iteadstudio.com/support/discussions/topics/11000011760).

      Good DIY

      1. Merci pour cette réponse rapide, le site Itead n’est pas très simple à naviguer, quant au forum heureusement que vous m’avez indiquez le lien , j’ai cherché plusieurs heures ce matin…
        bref j’hésite encore …
        Puis-je encore vous poser qq questions ?
        Si je comprends bien, on dessine ses écrans avec l’éditeur, on les envoie vers la carte SD.
        – comment se fait le transfert vers la carte SD ? par transfert via un PC ?
        puis on discute avec cet écran à travers une connexion rx tx, ça me plait bien car on peut alors utiliser des micro-controleurs très simples genre ATTiny. ou ATMega 328

        Visiblement le touch screen se pilote avec un stylet ? on ne peut pas le piloter avec les doigts ?

        Merci encore
        JP

        (Translation)
        Thanks for the quick reply, the Itead website is not very easy to navigate, as for the forum fortunately you indicated the link, I searched several hours this morning …
        In short I still hesitate …
        Can I still ask you questions?
        If I understand correctly, we draw its screens with the editor, we send them to the SD card.
        – how is the transfer to the SD card? By transfer via a PC?
        Then we discuss with this screen through an rx tx connection, I like it very well because you can then use very simple micro-controllers ATTiny type. Or ATMega 328

        Obviously the touch screen is pilot with a stylus? We can not control it with your fingers?

        thanks again
        JP

        1. Oui, sur Carte SD ou bien en mémoire de l’écran directement. Exactement cela, comme cela est décris ici par exemple :https://www.itead.cc/wiki/Nextion_Editor_Quick_Start_Guide

          Vous trouverez certainement d’autres exemples d’applications avec ATTiny ou d’autre système. http://fritzing.org/projects/nextion-display
          L’écran s’utilise avec les doigts, classiquement.
          Bons développements avec les écrans Nextions.

          (Translation)
          Yes, on SD card or in the screen memory directly. Exactly this way, as described here for example: https: //www.itead.cc/wiki/Nextion_Editor_Quick_Start_Guide

          You will certainly find online other examples of applications with ATTiny or other system. http://fritzing.org/projects/nextion-display
          The screen is used with the fingers, classically.
          Good developments with Nextions screens.

  2. Merci Beaucoup,
    J’ai commandé un écran, pour faire les premiers tests, et j’ai enfin compris -enfin un peu mieux- le mécanisme du site
    Itead, avec le “wiki”. je suis client chez eux pour mes propres CI de bonne qualité.
    A plus tard avec des résultats…. j’espère.
    Jean-Pierre

    (translation)
    Thank you very much,
    I ordered a display, to do the first tests, and I finally understood – finally a little better – the mechanism of the site
    Itead, with the “wiki”. I am a customer of Itead for my own PCB (good quality).
    Soon, with results …. I hope.
    Jean Pierre

  3. Advertisements
  4. Bonjour,
    Si l’afficheur Nextion est connecté avec un adaptateur série cela devient /dev/ttyUSB0
    Bonne journée Patrick ON5AV

    (Translation)
    Hello,
    If the Nextion display is connected with a serial adapter this becomes / dev / ttyUSB0
    Have a nice day Patrick ON5AV

  5. Bonjour
    je souhaiterais savoir si il était possible d’extraire la programmation faite sur un écran afin de pouvoir le remplacer
    sur une de mes imprimante 3D il y a un écran nextion que j’ai cassé et souhaiterais le remplacer et le fabricant de l”imprimante me demande 320€ hors frais de transport
    Merci d’avance

    (Translation)
    Hello
    I would like to know if it was possible to extract the program made on a display in order to be able to replace it
    On one of my 3D printer there is an nextion display that I have break and would like to replace it and the manufacturer of the printer asks me 320 € excluding transport costs
    Thank you in advance

    1. Davy,

      Non, le logiciel Nextion ne dispose pas de possibilité de relire la configuration d’un écran Nextion. Vérifier quand même qu’il n’y a pas de carte micro SD installée à l’arrière de l’écran, et qui contiendrait le programme.
      Pour reprogrammer, il vous faut charger avec le logiciel Nextion le programme que vous pourriez recevoir de votre fabricant. Le fichier que vous lui demanderiez est le fichier à extension HMI.
      Je doute qu’il veuille vous le communiquer. Qui ne demande rien n’a rien !

    2. Tutorial https://www.hackster.io/tsavascii/programming-nextion-lcd-without-sd-card-6b18d7
    3. Logiciel de programmation Nextion https://nextion.itead.cc/download.html
    4. (Translation)
      Davy

      No, the Nextion software does not have the ability to re-read the configuration of a Nextion screen. Check that there is no micro SD card installed at the back of the screen, and that would contain the program.
      To reprogram, you need to load with the Nextion software the program you may receive from your manufacturer. The file you would require is the HMI file.
      I doubt he will let you know. Who asks nothing has nothing!

    5. Tutorial https://www.hackster.io/tsavascii/programming-nextion-lcd-without-sd-card-6b18d7
    6. Nextion Programming Software https://nextion.itead.cc/ download.html
  6. Advertisements
  7. Where do i find the file nextion.py ? And could you update your story to the latest raspberry version including python 3 ?Merci beaucoup
    Erik, PA0ESH

    (Traduction)
    Où puis-je trouver le fichier nextion.py ? Et pourriez-vous mettre à jour votre histoire avec la dernière version raspberry incluant python 3 ?Merci beaucoup ?
    Erik, PA0ESH

  8. Thanks for your reply. In the meantime i also discovered that using the ON7LDS Nextion driver with pistar, there are still some issues. In short, i expect the Read Only situation to influence the proper working. It does not start by itsself and you have to give a additional command regularly to the screen, whichever command you like. I used the visibility command of a text element on screen 0 from a stand alone programme in python (called startup.py) , which runs once an hour from a cronjob to keep everything up and working.

    import serial
    ser = serial.Serial ('/dev/ttyUSB0')
    ser.baudrate = 9600
    ser.write('vis t0,1\xFF\xFF\xFF')
    ser.close()

    73’s
    Erik

    (Traduction)
    Merci pour votre réponse. Entre-temps, j’ai également découvert que l’utilisation du pilote ON7LDS Nextion avec pistar, il y a encore quelques problèmes. En bref, je suppose que l’état lecture seule influence le bon fonctionnement. Il ne démarre pas par lui-même et vous devez donner une commande supplémentaire régulièrement à l’écran, quelle que soit la commande que vous demander. J’ai résolu le soucis avec une ommande de visibilité d’un élément texte sur la vue screen0 à partir d’un programme autonome en python (appelé startup.py), qui fonctionne une fois par heure à partir d’un cronjob pour que tout fonctionne.

    import serial
    ser = serial.Serial ('/dev/ttyUSB0')
    ser.baudrate = 9600
    ser.write('vis t0,1\xFF\xFF\xFF')
    ser.close()

    73’s
    Erik

  9. Advertisements
  10. If you are using the RPi3 then the /dev/ttyAMA0 port does not work unless you disable Bluetooth by adding:

    dtoverlay=pi3-disable-bt to the /boot/config.txt

    and then reboot the Pi.

    (Traduction)
    Si vous utilisez le RPi3, le port /dev/ttyAMA0 ne fonctionne pas, sauf si vous désactivez Bluetooth en ajoutant :
    dtoverlay=pi3-disable-bt vers le /boot/config.txt .
    puis redémarrer le Pi.

    1. Thank you Stewart for your contribution.
      73 Christian

      (Traduction)
      Merci Stewart pour votre contribution.
      73 Christian

  11. Bonjour

    J’utilise un écran Nextion NX3224T024_011 mais le texte dans les champs est déformé et donc illisible. j’ai téléchargé un fichier sur internet suivant une video : https://www.youtube.com/watch?v=TU3ylIPd0a0 . j’utilise la version 0.59 de nextion editor , avez vous une idée ? merci par avance de vos réponses .

    (Translation)
    Hello

    I use a Nextion NX3224T024_011 screen but the text in the fields is distorted and therefore unreadable. I downloaded a file from the internet following a video : https://www.youtube.com/watch?v=TU3ylIPd0a0 . I use version 0.59 of nextion editor , do you have an idea ? thank you in advance for your answers .

    1. Bonjour Thierry,

      Le fichier à mettre à charger sur l’écran à utiliser est disponible ici https://github.com/g4klx/MMDVMHost/tree/master/Nextion_G4KLX
      sous la référence NX3224T024.tft. VOus n’avez pas besoin de l’éditeur nextion pour charger le fichier sur l’écran
      J’ai ouvert le fichier NX3224T024.HMI avec la version 0.59 de Nextion Editeur. Le mode Debug montre bien l’écran et lignes correctement.
      MMDVM Test écran Nextion
      Peut être n’avez vous pas sur votre windows les fontes windows.
      73
      Christian

      (Translation)
      Hello, Thierry,

      The file to be loaded on the screen to be used is available here https://github.com/g4klx/MMDVMHost/tree/master/Nextion_G4KLX.
      under the reference NX3224T024.tft. You don’t need the nextion editor to load the file on the screen.
      I opened the NX3224T024.HMI file with version 0.59 of Nextion Editor. The Debug mode shows the screen and lines correctly.
      MMDVM Test Nextion screen
      Maybe you don’t have windows fonts on your windows.
      73
      Christian

  12. I was looking at your instructions for the Nextion 2.4 Display and a MMDVM. My question is about your display. I looked at the Nextion page and they offer two versions of it with the same model number was yours the enhanced or basic?

    (Traduction)
    Je regardais vos instructions pour l'écran Nextion 2.4 et un MMDVM. Ma question porte sur votre écran. J'ai regardé la page de Nextion et ils en proposent deux versions avec le même numéro de modèle ; le vôtre était-il le modèle amélioré ou de base ?

    1. Hello, Richard,

      I certainly use the basic version which is quite sufficient for the expected performance of MMDVM. I invite you to watch this video to discover the differences between the 2 screens Nextion Basic and Enhanced. At your disposal

      (Traduction)
      Bonjour Richard,

      J'utilise certainement la version basic qui est bien suffisante pour les performances attendus pour MMDVM. Je vous invite à visionner cette vidéo pour découvrir les différences entre les 2 écrans Nextion Basic et Enhanced.

      A votre service

  13. Advertisements

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *