Skip to content

Instantly share code, notes, and snippets.

@SamadKhafi
Last active August 27, 2019 08:48
Show Gist options
  • Save SamadKhafi/a857944169fe9d1fb811fb0945340d26 to your computer and use it in GitHub Desktop.
Save SamadKhafi/a857944169fe9d1fb811fb0945340d26 to your computer and use it in GitHub Desktop.
Debug Nextion display from your linux terminal.
#!/bin/bash
#############################################
# #
# [Installation]: #
# 1. Paste this file in ~ directory #
# 2. chmod +x ./nextion #
# #
# [Usage]: #
# ./nextion baudrate usbaddress #
# #
# [Example]: #
# ./nextion 9600 /dev/ttyUSB0 #
# #
# [Nextion Commands]: #
# https://nextion.tech/instruction-set/ #
# #
#############################################
echo "Welcome to Nextion Serial Terminal, ";
echo -e "use :q command to quit.\n";
while read line && [ "$line" != ":q" ];
do
( stty raw speed $1 >/dev/null; echo -ne "$line\xFF\xFF\xFF" ) >$2 <&1;
echo -e "\e[32mSent \u2713\e[39m";
done
echo "Goodbye.";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment