plugins icon indicating copy to clipboard operation
plugins copied to clipboard

Nextion Display support

Open drom89 opened this issue 3 years ago • 5 comments

Hi @terjeio , would it be possible to add plugin for Nextion displays ? https://nextion.tech I mean something like when you press a button it sends a Gcode command to serial.print

I played with Nextion Editor and it should be quite easy to do that. But i dont know how to implement it to grblHAL, i want to use it on ESP32.. Displays are not that expensive so maybe it will be viable options for all of us. Thank you.

drom89 avatar Nov 25 '22 13:11 drom89

Yes, it is possible to add a plugin - or perhaps it will be possible to use the existing MPG mode? A protocol has to be selected for the communication (plain serial, ModBus, ...) and you have to decide how to package the data for transfer. MPG mode uses plain serial and standard grbLHAL format - and I have made this MPG/DRO based on it.

terjeio avatar Nov 30 '22 01:11 terjeio

So im using ESP32 on board MKS DLC32 V2.1 And i want to use GPIO 0 and GPIO 4 for serial 2 communication, can i use it ? And what is the correct syntax to set MPG enable and RX PINs ? Or some other available GPIO in EXP1 EXP2 connectors

image

BTW it looks like MKS finally open sourced "their" FW https://github.com/makerbase-mks/MKS-DLC32-FIRMWARE/tree/main/Firmware

drom89 avatar Dec 27 '22 22:12 drom89

And i want to use GPIO 0 and GPIO 4 for serial 2 communication, can i use it ?

Yes, I believe so.

And what is the correct syntax to set MPG enable and RX PINs ?

See the cnc_boosterpack_map.h file for how it can be done.

terjeio avatar Dec 28 '22 01:12 terjeio

So i added MPG MODE ENABLED to mks_dlc32_2_0_map.h

#if MPG_MODE_ENABLE #define UART2_RX_PIN GPIO_NUM_4 #define MPG_ENABLE_PIN GPIO_NUM_0 #endif

It compiles and i can flash firmware no problem I connected RX and TX pins from display to GPIO0 and GPIO4

[VER:1.1f.20221115:] [OPT:VNMSL,35,1024,3,0] [AXS:3:XYZ] [NEWOPT:ENUMS,RT+,NOPROBE,MPG,REBOOT,TC,SED,RTC] [FIRMWARE:grblHAL] [NVS STORAGE:*FLASH] [DRIVER:ESP32] [DRIVER VERSION:221205] [DRIVER OPTIONS:v4.3.4] [BOARD:MKS DLC32 2.0]

When i try to print some code to serial from display, i cant see anything in console Do i need to turn on MPG mode/second serial communication some how ?

drom89 avatar Jan 03 '23 18:01 drom89

Do i need to turn on MPG mode/second serial communication some how ?

Yes, the input is blocked unless the MPG mode pin is in the correct state and the controller allows switching mode. More info here.

The keypad plugin allows switching mode via a real-time command character if configured to read input from the serial port - but I am not 100% sure this is currently possible with the ESP32 driver.

terjeio avatar Jan 04 '23 10:01 terjeio