I really love the way you patiently and perseverently discover and explain all the complexity and hard to understand capabilities of these displays! THANK YOU!
@@CheapControls English is not my native language, but your channel is the best source of knowledge on Nextion on the entire internet. Try also DWIN displays, they are cheaper, all have an IPS screen on board and in many cases more features. There is very little information around on working with these displays, I will watch with great pleasure if you will cover this topic.
I tried to get DWIN but they would not send product and I only earn about $1 a day on TH-cam so it is hard to purchase more than I already purchase. Sorry.
@@andreylitvinenko783 If you make a donation on my Ko-Fi page and add a note about the specific display I will order one and see if I can make a video on it. I will keep in touch with you and try to make it beneficial to both of us and the community.
Hey, first I would like to thank you so much for you incredible videos, you helped me understand nextion so much that I can't thank you enough. Secondly I would like to know where do you find all this new commands that you are doing videos about? I'm doing a project on the nextion and trying to add new stuff and always wonder what else the nextion can do, is there a list of some kind or you just stumble upon them?
I stumble upon them. In the comments I get asked about commands. Sometimes I have no idea what the command does but I look into it and make a video. A lot of these videos are as much for me as they are for others. I forget some commands after I don't use them for awhile and it is nice to have a place to go back and review. Thanks for watching and for the nice comment.
I do not think you can create a file. You need to make a file and load it on the SD card prior to use. If you want to create a file there is a hacky way to do it with twfile command. I have a series on the twfile command starting with th-cam.com/video/hTtUgQ8Vkek/w-d-xo.html
@@CheapControls I saw the videos, but I'm looking for a simpler way to do it, I have the option of using an external SD module but I wanted to use the existing one on the screen, anyway, I'll keep looking, thanks...
Thanks very much for your videos and the excellent work. I am creating 2 waveforms plotted with data sent by the MCU. I am looking for a way to save the waveform data to the SDcard, and also re-render the saved data back in a waveform for later viewing, perhaps with additional saved log information such as serial no, date, time, etc; perhaps on a separate page ; sort of a datalogging application. I shall be grateful for any help on this.
I am currently on a break from making videos. What you want should work. You need to create the empty file on the SD card that is larger then the amount of data you want to store. You can make a text file and fill it with 1s or 0s or some other garbage. When you write the data to the filestream you can use delimiters to separate the the data for future use. I plan on making an instructible about this but it will be awhile before I get to it.
Thanks for a much needed video on file operations on Nextion. It worked perfectly on the simulator, however, when I tried the same program on the Nextion, it does not work with the real SD card. I get a series of junk characters repeated (0xAA 0xAA 0xAA..etc) on the file and the Nextion hangs. I am stuck here in my project.. Waiting for your next video which hopefully will solve my problem.
I have spent a lot of time on the filestream and the twfile command. They are not very well documented on the Nextion website and I have had similar issues to you. I can only recommend that you keep trying and you will get it. I know it can be frustrating. My next video is going to be on the twfile command and then opening the file on the display. I will try my best to do this video with an actual display instead of the simulator. I try to make my videos as best I can and this next one is going to take longer than a week to make. I will not have a video this week but hope to have one next Thursday(9/8/2022) Thank you for the kind words and I wish you the best of luck in your progress.
@@CheapControls Many thanks for your prompt response! I am struggling with the above. I wish to bring to your attention my experiments which are so far unsuccessful, in the hope that it gets your attention. So I made Save button and gave it the following code on the touch press event: (Before pressing, I ensure that the full path "sd0/dir1/dir2/" is in t3 and the text to write is in t6.txt) fs0.open(t3.txt) strlen t6.txt,va1.val fs0.write(t6.txt,0,va1.val) fs0.close() It works perfectly on the simulator, but on the real card it returns 06 error - invalid file error. I cannot figure out the reason for the difference in the simulator and the real card. The second problem is if I create a file using twfile command while I am on the filebrowser window, it does not show up on the file till I get out of the page and re-enter it. Then it shows. I have tried refresh, doesnt work. I have spent days struggling with it and feeling rather frustrated!! :-( I wait with bated breath till 9/8/2022... :-)
I am writing the script and hope to record the video tonight for 9/8. I will be using an actual display but have not tested completely. I hope it goes well. I am not sure I will address the filebrowser window in this video but if I do not, I will next week. I understand your frustration. I get plenty frustrated with Nextion, but I still enjoy using them.
@@CheapControls Just an fyi - The nextion filstream is incapable of adding or subtracting the length of an existing file. Using line feed and carriage return is not the answer.. You need to “bloat” the file to a predetermined size. So (as many as needed lines of 00000000. You can format them on each line like ln^:000:0000:000 in a (csv) way so that you can find the beginning of a new line doing fs0.find[ln^] and then doing an fs0.write to that line. Using the : enables you of course, extract or write to specified areas of the line (as record’s column)..
After playing around with these functions a little bit, it appears you cannot write new data to a blank document, or write a string that is longer than any existing string data within the text file - there must be existing characters that can be overwritten, but you cannot append strings continuously. One work around would be creating a text file filled with dashes but it seems like there could be an easy fix I am missing. Can anyone shed some insight?
I am not sure that the size matters. The file point will keep incrementing as long as you keep reading data. Then when you detect a "0" you will know the end. If I am not understanding your question, I apologize and ask that you restate it. You can also go to the Cheap Controls website and submit a comment or question on the "need help" page.
@@CheapControls I am sorry if I did not state the question clearly. My question is restated here: In the command rdfile ,,, the has to be known. There is a file of unknown size on SD card which I want to read into my microcontroller using the command "rdfile..." . The source is the SD card file and the destination is an array variable in my controller. How does one find the unknown filesize in order to specify the ?. If I read one char at a time by sending the command repeatedly in a loop till I find the EOF, it becomes a very slow process as one needs to send several bytes to obtain one byte. Is there a faster way?
Do you know what is returned if you ask for more characters than the file size? I can't remember. Is there a range for your files. Like 2000-2330 bytes or 100-150 bytes?
@@CheapControls It returns 0x06 0xFF 0xFF 0xFF Error if you request even 1 byte extra over the filesize. I just ran it on the simulator using your example file inidemo . If you request 85 bytes, it returns data correctly, but if you request 86 bytes, it returns error. Also my file size could vary from as low as 44bytes to as high as 16500 bytes, it depends on how long the data was logged, I have no means of knowing looking at the file. I am now trying two alternative strategies: 1: to save the file size in the first few bytes and read those first, and alternately 2: to find the file size using fbrowser open and read files..Will let you know the outcome. Wish there was a simpler function to find file properties, including size!
@@dharmendrachauhan7884 can you explain how you got it? I'm trying the same and I can't create a new file, actually I need to save a new file with the data I typed on the screen.
Thank you for your help and making these videos. İ just want to thank you by donation but PayPal is not available in my country. May be you should add more options to do.
I really love the way you patiently and perseverently discover and explain all the complexity and hard to understand capabilities of these displays! THANK YOU!
Thank you for you kind words.
Thank you very much for the work that you put into your videos and for the unique knowledge that you share with us freely.
So nice of you to take time to comment. Thanks
@@CheapControls English is not my native language, but your channel is the best source of knowledge on Nextion on the entire internet. Try also DWIN displays, they are cheaper, all have an IPS screen on board and in many cases more features. There is very little information around on working with these displays, I will watch with great pleasure if you will cover this topic.
I tried to get DWIN but they would not send product and I only earn about $1 a day on TH-cam so it is hard to purchase more than I already purchase. Sorry.
@@CheapControls i can pay for display as gift for your hard work
@@andreylitvinenko783 If you make a donation on my Ko-Fi page and add a note about the specific display I will order one and see if I can make a video on it. I will keep in touch with you and try to make it beneficial to both of us and the community.
Hey, first I would like to thank you so much for you incredible videos, you helped me understand nextion so much that I can't thank you enough.
Secondly I would like to know where do you find all this new commands that you are doing videos about? I'm doing a project on the nextion and trying to add new stuff and always wonder what else the nextion can do, is there a list of some kind or you just stumble upon them?
I stumble upon them. In the comments I get asked about commands. Sometimes I have no idea what the command does but I look into it and make a video. A lot of these videos are as much for me as they are for others. I forget some commands after I don't use them for awhile and it is nice to have a place to go back and review. Thanks for watching and for the nice comment.
Great! Just a question, are the files saved in RAM, I mean when we turn Nextion off will the data be lost?
It is saved on the sd card. It is saved if power is turned off.
hello, do you know how I create a new file by clicking the button?
I do not think you can create a file. You need to make a file and load it on the SD card prior to use. If you want to create a file there is a hacky way to do it with twfile command. I have a series on the twfile command starting with th-cam.com/video/hTtUgQ8Vkek/w-d-xo.html
@@CheapControls I saw the videos, but I'm looking for a simpler way to do it, I have the option of using an external SD module but I wanted to use the existing one on the screen, anyway, I'll keep looking, thanks...
you are a HERO. nextion manufacture's help is so basic, you nail it RESPECT
Thank you for the compliment. I have not made a video in awhile but I do hope to start again.
Thanks very much for your videos and the excellent work. I am creating 2 waveforms plotted with data sent by the MCU. I am looking for a way to save the waveform data to the SDcard, and also re-render the saved data back in a waveform for later viewing, perhaps with additional saved log information such as serial no, date, time, etc; perhaps on a separate page ; sort of a datalogging application. I shall be grateful for any help on this.
I am currently on a break from making videos. What you want should work. You need to create the empty file on the SD card that is larger then the amount of data you want to store. You can make a text file and fill it with 1s or 0s or some other garbage. When you write the data to the filestream you can use delimiters to separate the the data for future use. I plan on making an instructible about this but it will be awhile before I get to it.
Thanks for a much needed video on file operations on Nextion. It worked perfectly on the simulator, however, when I tried the same program on the Nextion, it does not work with the real SD card. I get a series of junk characters repeated (0xAA 0xAA 0xAA..etc) on the file and the Nextion hangs. I am stuck here in my project.. Waiting for your next video which hopefully will solve my problem.
I have spent a lot of time on the filestream and the twfile command. They are not very well documented on the Nextion website and I have had similar issues to you. I can only recommend that you keep trying and you will get it. I know it can be frustrating. My next video is going to be on the twfile command and then opening the file on the display. I will try my best to do this video with an actual display instead of the simulator. I try to make my videos as best I can and this next one is going to take longer than a week to make. I will not have a video this week but hope to have one next Thursday(9/8/2022) Thank you for the kind words and I wish you the best of luck in your progress.
@@CheapControls Many thanks for your prompt response! I am struggling with the above. I wish to bring to your attention my experiments which are so far unsuccessful, in the hope that it gets your attention. So I made Save button and gave it the following code on the touch press event:
(Before pressing, I ensure that the full path "sd0/dir1/dir2/" is in t3 and the text to write is in t6.txt)
fs0.open(t3.txt)
strlen t6.txt,va1.val
fs0.write(t6.txt,0,va1.val)
fs0.close()
It works perfectly on the simulator, but on the real card it returns 06 error - invalid file error.
I cannot figure out the reason for the difference in the simulator and the real card.
The second problem is if I create a file using twfile command while I am on the filebrowser window, it does not show up on the file till I get out of the page and re-enter it. Then it shows. I have tried refresh, doesnt work.
I have spent days struggling with it and feeling rather frustrated!! :-( I wait with bated breath till 9/8/2022... :-)
I am writing the script and hope to record the video tonight for 9/8. I will be using an actual display but have not tested completely. I hope it goes well. I am not sure I will address the filebrowser window in this video but if I do not, I will next week. I understand your frustration. I get plenty frustrated with Nextion, but I still enjoy using them.
Thank you for vidéo
You are welcome
How do you Write to a new line in the text file? I'm only able to add to the existing line of characters in the text file
Did you try inserting an escape sequence carriage return and line feed?
@@CheapControls Thanks, I found the escape carriage solution on the nextion unofficial blog..
@@StarChild.no1 Great. That is a great resource
@@CheapControls Just an fyi - The nextion filstream is incapable of adding or subtracting the length of an existing file. Using line feed and carriage return is not the answer.. You need to “bloat” the file to a predetermined size. So (as many as needed lines of 00000000. You can format them on each line like ln^:000:0000:000 in a (csv) way so that you can find the beginning of a new line doing fs0.find[ln^] and then doing an fs0.write to that line. Using the : enables you of course, extract or write to specified areas of the line (as record’s column)..
Very informative. Thank you
After playing around with these functions a little bit, it appears you cannot write new data to a blank document, or write a string that is longer than any existing string data within the text file - there must be existing characters that can be overwritten, but you cannot append strings continuously. One work around would be creating a text file filled with dashes but it seems like there could be an easy fix I am missing. Can anyone shed some insight?
Turns out you can write to a .csv file which is handy - same issue persists where data must be prepopulated to write successfully
That is what I have found also.
It's horrible. Maybe someone found a solution?
How does one read a file of unknown size from the SD card? (I have a datalog file, which ends with char '0', but I dont know the filesize)
I am not sure that the size matters. The file point will keep incrementing as long as you keep reading data. Then when you detect a "0" you will know the end. If I am not understanding your question, I apologize and ask that you restate it. You can also go to the Cheap Controls website and submit a comment or question on the "need help" page.
@@CheapControls I am sorry if I did not state the question clearly. My question is restated here:
In the command rdfile ,,, the has to be known. There is a file of unknown size on SD card which I want to read into my microcontroller using the command "rdfile..." . The source is the SD card file and the destination is an array variable in my controller. How does one find the unknown filesize in order to specify the ?.
If I read one char at a time by sending the command repeatedly in a loop till I find the EOF, it becomes a very slow process as one needs to send several bytes to obtain one byte. Is there a faster way?
Do you know what is returned if you ask for more characters than the file size? I can't remember. Is there a range for your files. Like 2000-2330 bytes or 100-150 bytes?
@@CheapControls It returns 0x06 0xFF 0xFF 0xFF Error if you request even 1 byte extra over the filesize. I just ran it on the simulator using your example file inidemo . If you request 85 bytes, it returns data correctly, but if you request 86 bytes, it returns error. Also my file size could vary from as low as 44bytes to as high as 16500 bytes, it depends on how long the data was logged, I have no means of knowing looking at the file. I am now trying two alternative strategies: 1: to save the file size in the first few bytes and read those first, and alternately 2: to find the file size using fbrowser open and read files..Will let you know the outcome. Wish there was a simpler function to find file properties, including size!
Sorry: the reference to inidemo is from Thierrys blog "Parsing files from SD card"
Can i create new txt file in nextion display using button?
I believe you can. I will look into it. I need a short video this week and if this can be done it would be a good one for the week.
@@CheapControls Sir ,thank you for your reply,i have created new text file after some try.
I am happy you got it working.
@@dharmendrachauhan7884 can you explain how you got it? I'm trying the same and I can't create a new file, actually I need to save a new file with the data I typed on the screen.
@@krashs file created by newfile function but i can't saved data in to file.
This video is really very amazing 👍👍
Thank you so much 😀
@@CheapControls I will try to implement this on my project.
For some reason, I just get errors in the debug that say, "file operation failed" Does anyone know what this could be?
Do you know what command the IDE is trying to execute?
How can I check that?
I’m just using the HMI you provided on the link
At what point do you get the message? After you push a button? When you start the DEBUG?
I get it when I push any of the file stream buttons
Thank you for your help and making these videos.
İ just want to thank you by donation but PayPal is not available in my country. May be you should add more options to do.
Thank you for the offer. What other sources are there for donations?
I added a super thanks button to the video. I am not sure it will work for you but you can try.