Nextion/Python - Issues with the twfile command

I got some issues when I try to upload pictures by serial to the sd-card of the Nextion device using the “twfile” command.

If I run the program, there is a new file on the card created, but the type of this file is not a .jpg I want… the file is called “” which is not compatible to the ExPicture object where I want to show the picture.
Now I’m a bit confused because in the Nextion Instruction Set the “twfile” example shows excactly this usage.

twfile “sd0/0.jpg”,1120// transfer jpg over serial to sd0/0.jpg size 1120 bytes

Did I missunderstood the usage of this command or why does it not work properly?
Thanks for every reply!

Did you get an answer to this? I am creating video series about the twfile command on Youtube. If this site allows links, I will paste a link to the first video. The .tm file is created temporarily until the upload is complete and then removed. Leaving the .jpg file

1 Like

Hey headbite,

thanks for that video, it solved my issue! I did not send the header for the file, so the Nextion got stuck in the data transfer mode…

If anyone else have the same issue, this is how it worked for me:

1 Like