My template id is not exist and the APP's display sometimes changes

Have you copied and pasted the template ID and device name from the web console into your sketch?

I’m a bit confused by the fact that you’re using QuickStart (which uses static provisioning of Auth tokens and WiFi credentials) with the Edgent sketch - which uses dynamic provisioning.

You would be far better deleting the QuickStart template via the web console, creating a template and adding the datastreams you want, then pasting the template ID and device name into your sketch and going from there.

Also, you really need to un-comment a board type and check that the pins in Settings.h correspond exactly to your board. You should read this for more info on that subject…

Pete.