Sunday, March 3, 2019

PI-STAR API for NEXTION,#MMDVM

API DOC
Not found,  but you can find the code define from G4KLX Project

https://github.com/g4klx/MMDVMHost/blob/master/Nextion.h
https://github.com/g4klx/MMDVMHost/blob/master/Nextion.cpp

Flash Nextion Firmware online(ssh),
thanks Peng Hui Ping VR2VYE provide this method ,from now not need TF Card. Video demo follow my facebook status and the end of this article.
First publish in https://www.facebook.com/winters.cn/posts/1620668804697067
*Now not support board 4 PINs header output mode, Pi-Star setting Nextion (Modem)


Prepare tools
1x USBtoTTL Adapter, such as CP2102, PL2303 model
require pyserial runtime

How to do
1) login ssh mode:
http://pi-star:2222
default login
usr: pi-star
pas: raspberry

Copy the follow RED text ,then Ctrl+V, and press ENTER,
Notice that rpi-rw, sudo su , su pi-star, just support one line one time

#Change system to Read and Write
rpi-rw

Step 1, Install require runtime . VERY IMPORTANT!

sudo su; 
rpi-rw; 
cd /tmp;
git clone https://github.com/pyserial/pyserial.git;
cd pyserial;
python setup.py install;

#When install  runtime complete,change to pi-star user
su pi-star
cd /home/pi-star

#Download nextion.py
wget https://raw.githubusercontent.com/g4klx/MMDVMHost/master/Nextion_G4KLX/nextion.py

Step 2, download Nextion firmware (*.tft not *.HMI)

#Download Nextion firmware to current directory
#for 4.3 inch NX4827T043
wget https://github.com/nano-mmdvm/Duplex_hotSPOT/raw/master/nextion/NX4827T043_G4KLX_ShowIP_by_BI7JTA.tft

#for 3.2 inch NX4024T032
wget https://github.com/nano-mmdvm/Duplex_hotSPOT/raw/master/nextion/NX4024T032_G4KLX_ShowIP_by_BI7JTA.tft

Step 3, flash use command 

#5) Stop MMDVMHost serice
sudo pistar-watchdog.service stop; sudo systemctl stop mmdvmhost.timer; sudo systemctl stop mmdvmhost.service

#6)Flash to /dev/ttyUSB0
python nextion.py NX4827T043_G4KLX_ShowIP_by_BI7JTA.tft /dev/ttyUSB0

#Flash to /dev/S2 when using modem,4 PINs header
Now not support

#7) Startup MMDVMHost service
sudo pistar-watchdog.service start; sudo systemctl start mmdvmhost.timer; sudo systemctl start mmdvmhost.service

J-STAR Users Guide : Allstarlink Setup

Preview .