good evening so thinking of trying something new in this video one of the things I will do is to try to fix a bug in the Unruh firmware for the 16k flash version of the Unruh 51 and the other finger we'll try to do is to implement a new feature invest all the vestal feature I'm going to try to implement from scratch without preparing anything I mean usually implemented from scratch but if I would make a video would probably prepare something for that but this time I'm just going to go ahead and see where we can where we go so you can get an impression of what the process kind of looks like but let's start with this bug so I have recent publish this video on how to use the Vasquez and SVD programmer to upload firmware to for example the RF 51 modules and one problem that was discovered is that apparently you cannot write the motor configuration if you're using the 16 K flash version of the Unruh 51 I had a quick look before it is actually and I think you saw the problem so let's have a look at that this is the source code for an RF and the make file I have set the firmware 16k flag to 1 meaning that well there's some defined path to this and then it will change some of the things the problem is that with the RF it 216 K of RAM is that firstly the software device consumes all of that so we only have 8 K left and we also need the buffers for both the Bluetooth for receiving and transmitting and for decoding the data and it also needed for a UART so quite constrained on memory and ideally we want to have enough buffer on both TX and rx and you ought to buffer at least the biggest packet that are going to encounter so let's have a look at the buffer sizes one thing I remember is that even before I the 256k actually highlighting is in eclipse is wrong now this flag is actually set so this partial activity code so remember that before I had 256 K on the TX / 4 and 5 to 12 on the arcs buffer and this time I think this is the problem so let's go down to where I think the problem is if I can find it again yes so this is a callback that is called from the packet interface so when we when we receive bytes from the Bluetooth or chunks of bytes we try to decode them as a packet and one we have decoded it then we want to send it over the UART and what we used to do before you see its commented out there is that we would just put the buffer and if we had get this error no ma'am we're just like wait and try it again until it succeeds and that's not what we do anymore and the reason I didn't do that is that I added the functionality to also use the NRF for for communicating with the remotes so that it would use them that you will be able to use the ESP protocol at the same time as the Bluetooth and this one is actually run from an interrupt by the be elite stack which would disable all the ESB stuff if this one is here and I did some trial and error discover that if I do it like this and just increase this attitude its buffer which you can do if they're 4 - 2 k then it would behave a bit better so let's start by trying to confirm it so we upload this won't work I have a program connected to a 16 K and rough that sits next to me and is plugged into a desk and we will try to see if we can confirm the problem at least so it should be up and running now let's scan in the mobile version of s tool and we found something and we can try to connect and it did not even connect I didn't expect that something that would work well I will just use mask tool just diversion and connect to this one and see if that's the right configuration I don't know what was on this vest before I just picked it from a pile of s that I know has well has the 16 K version of the raffinate that's auto-connect and apparently we have old firmware let's fix that and after upload didn't February it should start with the default configuration so hopefully we'll back to we were before or back to a working app configuration at least let's try it again over Bluetooth still not working okay I think you know what the problem is in the main file I have to actually set this VT module to active you see this is really live I haven't prepared much at all so it's probably going to be potentially going to be a video that wastes a bit of time but at least you can see like what my programming and hacking with evenings it should look like right again and yes indeed it works this time and that's good so let's go to the multiple configuration see if you can read it and yes we could we did receive it let's try to write it back and that definitely seems to be a problem we can read it but we cannot write it back and according to post this works with the app configuration so read it works right it also works that's good and going going in to look at the problem now if we go to vask tool and go to developer and parameter editor MC conf then there is this tools calculate packet size and it seems that we need four hundred three bytes for the configuration I click run quite a lot so we need a bigger buffer to transmit date and your arch I think or we need to put this kind of fixed back that I had this word just waits because it doesn't matter in this case because with the 16 K version we cannot use ESP anyway so in order to do that I will just copy this if def and go down to the function here I lost it again I think it was further down here we have it and then we can do this if it's not defined it is actually define now then we'll run this like before and otherwise we'll run this code and I think down here one thing that I'm also doing here this function is actually run from this handler here when you call this one but a callback and I don't think we should lock anything when we run this and we should have a condition for that as well so copy this one again I'm going to make it simple I'm just going to keep the whole block like this and otherwise I don't think I need to do a lot here I think you just need to run this line and that should be it see if we can compile seemso upload the firmware you see that we do this when we will probably get disconnected here unknown error yeah someone just tried to program this guy so didn't see that coming try to reconnect and we can connect again at least that's a good sign read the motor configuration try to write the back and nice it works so now that this is working I will try to compile and add a new firmware to mask tool so going up here I will also push this to the github disabling this one again setting this to end good fault option and then I will open a file browser and go to where I have this project and we have it here so we can open a terminal here and then we can first have a look at what we did so we can you get diff and yeah that's lines were changed looks reasonable and then we're going to we can go to the build directory and we build all versions of this forward that we go to include the rest all later should be fairly quick seems it was and now we can do git status and we can see that we have changed the 16k files and we did actually compile all of the files but since the 32k code should not change it should result in and identity binary so this is why I get doesn't see a change in those 2k files which is to be expected seeing something else ER has suggested something else is wrong so that's good that this happened so that's commit and first is the github usually I think a bit more about their commit messages but just going to do it took a bit quicker here to make not make to be with you like painfully slow to watch at least so this is done and then we can go to build all and copy these files and I will put them in where I have that tool I think I have the main resources are the firmware and in here and then I can just replace the files and that should be it for this fix now come now we come to the next topic of this tutorial or this tutorial actually me working a stuff and that is that I saw this post how can we get real-time data from vast tool and store it in a file and I remember people asking me this before and the reason haven't implemented it's mainly that I have forgotten about it when they asked and also I for some reason they'd have any use for it myself yet so let's try to let's go ahead and look at it and see if you can implement that so my dear for this feature is that we can have just remove a few windows here the d for this feature is that we can have it should work from both the mobile version and also from the desktop version because it makes sense it might make sense to have a phone that to carry around the be able to log data over bluetooth that you can analyze later and this means that we want to have something we don't want to write a lot of duplicate code and when you have something like this I usually put this functionality in Vaska interface when it is functionality does doesn't require state then I usually put it in utility but if it requires changing a state which this one will do that's all explained then I put it in here and the state that we're going to change or define what is going to look like is that I will add add an function or an hour method so that you can tell it to log date open this file in log data to it and then as we receive samples from for example from the real-time data then we'll just end up in this file and when you close verse tool it will close this file for you so let's open Vasc interface and stop somewhere we can go down to private and then we can add the file and we call it something like RT log file and it will not make it into a pointer I will I think you can just be a normal member and then we can I make a function to open it and we can make this function revocable so we can use it this means that we can use the bow from qml and from c++ those are the newest pd functions so we'll just build here will it will it can probably fail as well and we give it a filename and maybe maybe you shouldn't give it a filename I mean maybe just a directory because imagine that to you set an output directory and then we start the logging then it will create a file name with the current date and time so that you can select it don't overwrite file so I have to confirm a change name all the time what is to be quite convenient so change this to out by rectory and then we can add the definition for this one and then we can do a log it was called an RT log file dot set file name [Music] and we can create we can use the directory and create the path here in place so we can do present one slash present - so this is those present things you can argue after the file after the queue string and put the arguments in here and we can do something like year month day and we want to write the time and we interests going to call it CSV because it's gonna be in comma separated files they can open it in most common editors easily and then we start with arguments the next lines the first argument is going to be the directory out directory and the next argument actually before we do this we can open and get a cue date time so we can get the current date just call it the hmm thought it was something like [Applause] current but maybe I'm missing you date time in here include yeah exactly that was the problem and then we have the current time here and let me just go on with arguments we have the path and we [Applause] argue d dot isn't this the same thing was it the father once a year or so but that doesn't seem to be the case maybe if we can just open the help file I can click on to press f1 and then we can see all the members and usually I click on the more in here you can see some example usage of this one again I did not prepare this otherwise it would have been easier and it was quite a while ago that actually use the day time for anything so don't don't really remember how to use it without looking it up but that's how it is when you're programming and that's also why I didn't make a video like this before because I think it would be incredibly boring to watch especially unless I prepare it and if I prepare it and it could take a lot of preparation like implement everything and then it might not show the whole progress on how I get there and it's also like half treating but there's a lot of work to do this kind of stuff and it takes a lot of time so for a year it's not even you're in there every candidates dot yeah there we have it daytime dot date of the year could have cast that almost maybe I should take out the data but that doesn't matter so many Jesus almost like this day and then I guess time mr. X 1 dot hour and I think I'm out of sync with apparently somewhere yeah that's where it should be yeah I think that's it for the name at least let's see if it compiles I don't remember when a compiled was till the last time so sometimes if you compile the scratch it can take a really long time to do even though I'm compiling or for trads since we have so many files I think we have something like 300 compilation units or so which shows that there is a lot work behind it so no way I think it will succeed so we can just go on there so we set the file name and then we do Mr D long file dot open and then I think I forgot how to do that again thank you file and I think this one probably has a straightforward usage case here actually that's the last thing what to do so we can don't want to open it and read only we want to open it in right mode and it's gonna be a text file so we can add the flag to so we can do turn and this is the file that we want to open so i compile again now we should be without warnings hopefully yes we are go back to the header file and then make another one you invoke who is 1.8 people I think you can always close it close RT file and the reckoned ooh I don't know if you need to check if it's open if you close it I think what I can do is just to be sure it's open then we close it and that should also compile nothing special going on here and after that we go up to the beginning of ASCII interface to the destructor and if someone close this vest tool and logging is open we might as well close the file and what happens when we close the file if it's not close then it might not flush all of the buffer so we might loose a bunch of data so in this case we'll just close the file when we exit and ask interface store settings and they close hard to log file and I think that's enough functionality for Vasc interface now the reason it takes a lot longer to compile now is that I changed header file for mask interface and this one is included in a lot of places so it has to recompile almost everything every time we changed that Hydra file so this is I think this will work so next we can go to the user interface and actually add something no actually not done here yet so now we open and close the file we were to not writing in a data to it and I think in order to do that I'm going to use lambda function up here and we're going to do connect and we're going to connect to em come and because that's where the data comes in and I usually forget the syntax haven't used it often but I think it was something like yeah values perceived and then we have another function we kept capture this class because we want to have access to an open file and the argument is in MC values V and then begins the function body and this means that we can define the function here in place instead of like adding something that had a file adding it to the source file making the connect here writing it down there kind of like when we have things kind of in line in one place and if I remember correctly then we can do first we check if the file is open so what we can do is like as long as the file is open and receive values will just caption here and put them into the log file so we can do if party log file dot is open then we can do a cute text stream output stream [Applause] and I think this was how you use it we can actually check for the help text in this one and it seems like this is exactly what you want to do you can also click f1 again then it goes to fullscreen help so we want to in this case they open a file and they create a text string with the point to do this file and they can write stuff to the file so let's go ahead and do that we have that file and we need a pointer to define do it like this and then we can output stream and we can just plug in all the data and I something I always forget is that sometimes especially in seed and you have the local sets to Sweden for example and in Sweden you use a comma stead of decimal comments that of a decimal point and we will see that when we save the file if that's a problem here but if I can remember correctly he takes cream doesn't it will always use the point unless you tell it otherwise so let's try that the thing to format we can make and just click on empty values and see what is in there what we want to write so we have the input voltage and everything and I think another thing you might want to do is that we want might want to grab the time again and they write fixed start by writing a timestamp to have every log sample if I figured a good time stamp that we can get easily just an amount of milliseconds today so we can do queue time we can actually do more C++ 11 outlet we add this we can do outdoor T equals Q data or Q time is actually only current lovely time Eric you time current time and then we can do t dot m16 start of day that one is really convenient just prints the amount of milliseconds today and then we go ahead go to the next top part and here we want to have a separator and I think we're going to use a semicolon and then we can go to the next line and then we do always V dot where should we start I think we can take them in the same order as they are pair and destruct see what the daughter was I think it was we in actually can copy and paste this land a few times and then update all the members with the bum shear and we go to data types and then we have a up here to the same under here now we can actually count them so worth i q-- now and after this one we have 1 2 3 4 5 6 7 8 9 10 11 left so need we don't know we have just 1 2 3 4 5 6 7 8 not count 1 2 3 4 5 6 7 8 9 10 11 and after IQ we have the back didn't work now duty and powers and again powers charged also one of the boring parts watching me properly and one interesting thing is the another to do dissonant right the first time and I know that people probably someone is going to watch me it probably makes me even slower because I'm feeling that I cannot look like like I'm doing this like lisslow sir and that doesn't really help and it looks like either accounted wrong or I forgot to copy something let's count again one two three four five six seven eight nine twenty values and here we have one twenty one so something is missing that was annoying so it's the IDIQ due to now and powers so short what I was what I was charged tachometer position fault code Viscardi redistribute is something stupid and I'm still okay I'm actually going to pause the recording and double-check this cannot be this way okay so I'm back so of course it was the fault code and what type is this it's an enum actually I think I'm just going to ignore the fault code and not write it to the file the last thing we want to write is a newline character let's do that that's left hand and what we can do here is that this can decrease the format's a bit if you flush it but because it will cause this to write that file immediately almost making the useless today close the file just in case but the nice thing when you run flush after every time we add a sample is that you can use tail - F on the file and see us the samples come in as they get collected in real time and otherwise they will if you do tail on the file it will just be emptied and will or it will just have a few lines and it will come a trunk and it will take some time there will come another trunk so let's see if it compiles it did that's promising so think at this point we can just add something to the user interface somewhere and called this function in rescue interface and then we should get the file that gets value data this data comes in let's give that a try so we go to forms and actually in pages we have forms and then we had the page or two date doesn't worth it or to date exactly and the other question is where to add it I think it will add a new tab here insert page of the current page and we can call this page what need to give it log and here I think you will just add a line at it where is it here line edit that I could show the file name and then we can add a file chooser to it and we can add with that checkbox actually and we can add a label here as well I'd call it CSV that we can grab all of them lay out horizontally add a vertical spacer and lay this out vertically and that we can give this some names in the use interface that we can access for the code later later so we have a sub CSV file at it and at this one I think we'll just remove the text and then we can add and become an icon how do you can also tick icon I think I can I choose resource and go to icons and I think the icon for opening a directory is this one and we can also give it a tooltip let's leave it like this and that's it and then we can go to we can right-click on this one go to slot and do clicked and likewise we can go to this one go to slot and toggled I think they showed up outside of my capture area and let's see how remember how to choose a directory then we can do queue file dialog what was the get existing directory that's the one and this window is the parent and I think we can just go for the default options and I think this one will turn circu string and then correctly we can actually go through help text and yes this one does return a key string what did i do not typing in the wrong place and I think this one what those function seas will do if the user clicks cancel then it will return a null pointer let's see what does it return a blind again I don't even know where I kicked doesn't say what it returns but I think it will be empty if it's if didn't use anything so if it's not empty then we do am Basque I actually have the track here this is not necessarily but it is the reason I had it is that you can create this class without providing a Basque and there will be a little pointer so we'll make sure it is not no and then we do M mask dot open RT log and then we do directory and now I actually don't want to open it right away I want to check what they actually choose here to make sure that everything is correct before I correct something on the computer so instead of open I'm going to do true and then we can do aq debug and print the what file name and see what name we got let's give it a try got the warning somewhere oh I'm compiling the mobile version that's not what I'm in time to do not look at what the warning it is first unused parameter checked yeah we haven't implemented this one yet and that's correct because here we shouldn't do this yeah we should actually just fill out this field that we added for it so you i dot serious and that's a problem in this version of kid crater discovered it it will not Auto complete in the UI without opening and closing in between for some reason only does it on this computer but I know it's this one and then we can do it big set text let's see if we got that right first sometimes were almost handicapped without autocomplete what we'll do we'll actually just close down get greater and open it again because there nothing there how to complete part will work that's cool pages sources and page RT data and yes indeed you did work now and I think it's actually a pointer so should be such text instead of putting it in variable we can just put there directly next up if we check this box and if you check this box yes if I check this box then if you checked we will live here start logging we can also also add a warning here if for example if this direct injury wouldn't exist or if it's empty or so but for now we'll just do it like this we could also generate the warning from vask interface using a send message dialog and I think we will do that actually so we don't really need this one day because I think it will just pass an empty string if it is empty and we do UI dot CSV file that it dot txt go back to this one and yes we still just print it out when we run this function yeah let me see that we open a mobile version of a stool that because that's what was what I tried last time so if you open the project file you can disable this one and then you would have to rebuild the whole project but to know that because it will not make file will not get that the project file has changed so what we can do we can just open a main function and like make a space and Road space and space this one will have a new date and it will recompile the main function and this should cause it to open the desktop interface of the UI and since that we did so let's try to connect and do some logging will actually not do logging but we see completely the file at least so we can open we can make a new directory here let's call it log and log we can open this one this looks correct maybe logging and see what we printed out here if it looks remotely correct so home and when Dropbox give great service to log e 20 19 5 6 it could have been zeros there but I don't think it matters 19:43 45 dot CSV impressive I got the more impressive I would say surprising almost that I had didn't do any type order when they got in date besides those things I think you can still fix that but Mike's release where I hadn't tried to fix that so they get their zeros so to me it would be like 0 5 0 6 instead of 5 6 and that we can do by going back to basque interface and this org thing and I think in the ARCA campus help and then you can this is a string argument it does go to the correct one by default and I think this one is the same as this one and the next one is too filled with so we should be able to do two here see if that works go to the real-time data log open this one again open a blogging oh that's not what I did it just made it a bit wider and padded with nothing yeah yeah that's not what you wanted to have Phil character it's maybe the one that you want to have it so we filled with nothing and we've had a fill character then we have to fill out all the default arguments so this is the field whip and then we have the base which is ten and then we have the fill character and I think this one is just a zero does this do it no actually compiled but you complain about something see what the problem is before we yeah that seems weird yeah I think you know what the problem is it should be it was actually a correct warning it should be backslash zero the kosher it should be the zero character or not no not I'm just guessing here what is the constructor for this 1q character class it should not be battle Shira it should be there because backstitch here a sectional it doesn't seem to complain about this one it runs and the director again and it looks correct nice I think we will actually have the same problem on those there happen to be two two two two digit numbers now all day but they might not always be so we can just do the same thing here [Applause] and I think the next thing we can check is if the directory exists and that we can do by for example using Q dear maybe need to include include same F swing with us with a time just forward declare a declaration somewhere but it doesn't show us for the sender and promenade compile exactly and if this one does not exist we can do emit message dialog and the title of this one is open log file or we can do it log to file and the problem is that directory does not exist is good it's not good and it's not named fancy rich text and that we do return and while we're at it we can also do more error checking and we open it here and we return it and what we can do is into pool press equals this thing and then we do something similar here so director exists but we couldn't open a file might mean that we don't have right to convey information or maybe in this case full so what does this look like we can start by trying the error messages if it compiles so this time I will specify in a directory to enable logging and nothing happened maybe it could open directory will provide this one open and just for fun we've got a six here yeah hope to directory doesn't exist so that one probably if it since we didn't give it a string it will probably choose the vessel the directory where the program is running from but in this case we have to provide a valid directory and if it fails you should actually uncheck this box let's do this later first let's see if we can actually do some logging connect to the risk and go to we are at our two data now we'll do some logging and I will get the terminal in the bascule directory and we do have a file and you can see that we're actually logging interesting it's just with my voltage or my power supplies that they did 18 volts which I believe it is so we'll go over to my power supply and turn the voltage knob a bit see if you can see that yep so we just made an power supply voltage logger and if I disabled the real-time data it will just stop logging and if I open it again it will continue to log in and then we can go back to log and check this one now the file should be saved hopefully and if you do arch again it just continues so something is not correct let's investigate that would this one out of the way go back to our data and if you check them we do this and if it's not checked we do nothing and if it's not checked then we will do Lowe's or the log file and one thing we can do actually is that we can we can add just polish this tab it yeah so now the initial function I think closing the file will also work and also when we close the program so what we can add in addition is that we can make something that we can check if the log file is actually open cueing vocal can just copy this line they're convenient going back to page or to data and now we can do something slightly ugly maybe got the timeslot and in here we can just do if we actually don't have to check from a speaker and actually have to do if the RT log is not open it cost for whatever reason and your eye doctor CSV enable log box dot is checked so not logging and log box is checked then we do some is wrong here not let that be yeah we forgot the nanny so if you checked and we're not logging then we set it to false or actually we can this is actually we can make it a lot better if it's if log open is not the same as the state of this box then we set the state of this box to log open then we can also go to go and eat your way in case someone changes it now what we could have done is we can just set this time this thing all the time here but done then it might consume unnecessary CPU cycles if you need start to do UI maybe it doesn't have to do that maybe tricks internally and they could also be I have to think about this what happens if it if it goes from open to closed that's not a problem because then we will try to close it again because then this slot will be called and it will be false if we talk away from the code and will close the file which already is closed which does nothing so that should be okay if someone else opened it and we get in here and then we might have a problem because if you have more than one thing that can open a log file and we open it ourselves then then this one will be the one that is written to and that should not really happen I'm aware of that I'm going to go back into it later but for now we'll see if it's working to compile yeah of course because now we add the the log file to the basket interface yeah wonder what we can do if this is the thing I think for now we'll just leave it anyway even though someone could add another thing me for example that opens the lock for another place and then this one will toggle and we use this location instead not resection another thing that could be done yeah actually let's do that yet another reminder I did not plan this ahead so that's why we are like probably an hour in now and I haven't finished yet so this is the super slow video so hello a page or two data and let's see what other slots are available so we use they're the wrong place go to slot we use the toppling slot and we can actually use the clicked one instead so if someone clicks on this button I don't think the clicked one will be activated if if someone toggles it programmatically hopefully I'm actually not checked it now if that turns out to be a bug then I will have to resolve it at that time cannot spend forever on this remove the Tommy one and use the clicked one instead see if you compile but it can be a slow it again and see if it works they're logging enough like what I think is your should see here now is that we have another file that we just created and we really same thing but we do the other file which time is it now 51 something nothing is coming in that's because we're not falling in a data go to RT and now we get data now we don't get data now we get data stop logging that's good enable again and this one does not go because now we created another file this is also you can plug in this box and J uncheck it and check it again if you want to create get another file and yes we got another file good so let's check if two files look correct I will open this file in LibreOffice that I just created and this is the dialogue I get so seems like it can parse it somehow at least and this is what we got and I think that what the power supply is at this voltage so I think that is correct so now we can do log into a file that's convenient I think and now that we can do it in the desktop version we can also add it to the mobile version let's go ahead and do that so open project file again switch this one to build mobile and one thing we can do here is we can activate debug build and this means that we can use f5 in the qml to reload all the qml files which is convenient when you create the user interface because usually write it all in programmatically so go back to main file space remove space click Save and the next one should be mobile interface and now we will actually do the logging using the Bluetooth module that we just programmed with the code that we fixed so let me move this one over here a bit and put the interface no actually let smoke keep this wonderful screen I think that's more convenient and then when we do the mobile stuff we go to mobile and resources and qml and I think yeah let's figure out we want to add it first we have the meters then we have this one then we have the 3d view and then maybe we want to have another page below this one only problem is that the mobile interface works such that you have to have the tab open or the page open that we want long if you want to pull the data so for example if I go here down here and activate logging you anything then I have to go back up here in order to do logging and if I switch page done it will not login it anymore but I think that's okay because this logging functions is really only for advanced users and since its depth and maybe we will not even add edit here maybe we can just add it to another tab here at the end after terminal nothing that's what we will do so go to main dot qml and yes before i forget about it in the page or to data you see that every time i open it the log page was open here so we'll set the current tab to the default tab and save and now it will go to the first time next time I open it yes back to the KML so we want to have a new tab after the terminal with some name the most difficult thing here might be to come up with a name but we'll just improvise with something maybe we'll change it later so here is the terminal page we can just create another page after it and this one is empty currently and then we can go down to the tab bar and I think we can call this one developer maybe or advanced no it's not the dance to log a file let's call it developer and the next thing we have to do is we have to change number of buttons and I think that should add another tab let's give it a try put this one back here press f5 that did not work and that is because we only recompile the main file we also have to recompile the qml you I file which makes the decision if F 5 should be considered okay terminal developer nothing in there try a five that worked that's good so now we want to do is I think one problem with qml is that there is not an out-of-the-box file picker so I had to make my own er I had to like base this one encoded the founder in one place and I think what we want to have here we have like Ian input here we can actually type and we have a five true sir and I think we want to have this right away and this and it's in the file web page so let's steal it from there go to the page firmware and now I don't see it maybe it's called something else I found where update and here we have this custom file somewhere I think yeah exactly we have and we might have this let's have it at the top of the page so we have the text input and this button and the spaces so that it goes to the top of the file and we can steal the file picker as well sorry go back to main dot qml to the page and just paste it in here it seems like something did not get correct here see the brackets yeah the file picker is kind of something is wrong just redo this look if you knew new lines and see how the brackets match so this one goes through file picker this one goes to nothing that's the problem and then we can indent this part still feel that something's wrong they're not okay so we call this one there RT log pile text but I choose log file and we can call this one log file picker and this one should actually choose direct race wonder if that works if we can just save name filters and it will be a directory I can open this one see what it looks like [Applause] there is like in no it's not that the signals only signal this one has and let's see how we omit this one if it's not the folder yeah that's the problem so we cannot actually pick a folder we can only pick files with this one and again something that didn't expect for this session but let's just see if we can copy and paste this one or actually do it from here go back to our best tool go to mobile and file picker I call it [Applause] direct or a picker and here we can go to add existing files and go to directory picture editor version control and then we make this one directory picker instead probably that one went [Applause] and the problem I think if if it's a directory to actually go in there yeah let's see what this goes just better main file [Applause] and for now we will not do this not having a name filter let's see what it does go here and reload and we actually have to click on a file in order to leave this one maybe what they can do is I can just add an OK button below it and say that if you press ok then you pick the current directory and maybe that could be a part of the file picker and here we also have a problem it doesn't show up in the correct order so I think yeah in the page we have to use condom doubt no we can't get around here and this one should be layout should field parent and this one should each one of the oh for the width of the layout so see if that looks correct now at least yes we have the text field here and we have this one it's almost overlapping with the top here that's not and we don't have any margin on the sides so maybe maybe want some margins don't like this good try good views f5 here yeah that looks better that's good now going back to the director picker and this one will probably never be run on item click I think what we want to have is we have a seat cancer you have to cancel button here then we can do Adam okay but the name caps lock and we want to emit a signal let's see how to figure out which record we have and I think by default which would never show any files see how the name filter works I don't know owner list model works maybe our just started to this then it will not try anything or it will show all of them will see and this one on click this one will not happen and file name is where does this one come from yeah when we click on something then we update our file name and I think what we can do is we can simply omit this one for the list model but folder let's try that and I think yet this one will actually close it so when we go back to there qml fine and we get this signal which is C where was it button director picker we don't have to disable it actually I forgot what the thing is that we passed file name back to qml and we'll do our T log file text dot text equals file name this might work probably not but let's give it a try go back to developer I would really try to choose folder the choose Android okay and indeed it worked really didn't see didn't expect that they go up a trace log okay and we can pick a directory that's convenient what's quite easy to merge the file picker but I should probably much me to the same file now the other thing I forgot to check is the name filters we didn't set the name filter and actually added sets an empty string so hopefully it should not show any files right now it should only show folders that it maybe saw it but I forgot to pay attention to it so we have to do it again and know which owes everything yeah maybe doesn't matter we can show the files you can choose a file anyway yeah if you click on the file done nothing should happen if we click on file that's also bug so let's go back to this one and the problem was in here if there is folder file name then we do nothing wheter and tried it again go into developer choose file click on something that dil does something and then got into a web state probably wrote it wrong there I would guess if it's not the phone that we should return of course very bad at using f5 SE okay next time I will I can click on them nothing happens and I click and click on folders yeah I think this is what we want to have and if you do cancel nothing happens if we do ok then we get the folder seems reasonable now next step is to add the d logging and how do we do that we have this page with the layout and we have the text input and red button and after the bottom looking at login so this will be a check box and then we do text on 14th [Applause] we can give it an ID just try to give it an idea that this consisted and now forgot the name what's after five actually this name is bad it should be Oh open RT log directory no it's actually correct because it's a five but we give it a directory and it will create a file in that one good coconut is on file and then we do 45 text dot text and otherwise we do dot close or two on file and now we have the same thing again that maybe want to have one clicked yeah exactly that's what we want to have here for the same reason as we wanted to have one clicked into our to data page so I think that potentially could do the trick yeah there's one thing missing we will do we have to do a out dot fills with true forgot a five again yeah so this works if you type a it's probably not valid exactly and now we want to disable this one if if the Basques is actually not logging and I think we can just plug in a timer here that will check it like twice per second or so I always forget how to make timers in QML see we can actually put it in the check box because that's what it's going to do primary and I think this one is rappy maybe we can use the help text to see running with repeating and it's running and it's interval is 500 milliseconds to 12 plus per second or so and I'll trigger we can do effect interests run this one every time equals [Applause] no I'll click something I think I did ctrl Q instead of control s but the trip to still be saved otherwise it would have complained mean that q ml still in the same line see we can open logging as something seems to be wrong there I don't know what unchecks it right away because we set the check state to if logging is open this one should all be like activate twice per second let's make it three seconds open yes probably some obvious error and maybe if you're still watching after one and a half hour you can spot it I will pass for a couple of seconds and think okay I just had a look and obviously the problem was that this open log file did not catch this error because I made a copy paste error be Russ here because if it's empty then it should not a Zaphod first pick to working directory it will it should not manage to open a file I think and here actually have to recompile but because now I change the C code or the C++ code and this will not be refreshed by doing f5 so if we do this then we get this error message and this one will be unchecked and if actually choose a file which could be this one for example yeah that's also problem that I have to fix here now we can do logging good going back to the qml code I will I don't have to print this one anymore I can make this one run twice per second again and I think that's it for this one the problem was that I got this file calling something in the beginning and I think one problem with that is that if you are an Android you should keep this file calling something in order for it to work and if our our desktop you should not and one way to what kind of hack to work around this for now is that I will put this logic in mask interface then we can do here we can do okay so we got in here because it doesn't seem to exist and then we can do if out directory the dot starts with file what was it file colon slash that we do not remove zero and remove a common is this one two three four five six characters and then we do the same thing again let's see as we can copy this one up here so good right first and every did not if it did not exist and they start with this one remove those characters and then we try it again and if it still fails done we have a problem so let's give it a try I think you have another copy paste error here yeah wouldn't have mattered because we wouldn't run anything after this one anyway but let's fix it just to make no one else or myself wonder when looking at that the next time I go to developer trees log file log ok enable and it did actually manage to niblets even though we had filed in the beginning so I think they should work next let's try if it actually logs the file from Android and this will be over Bluetooth yes can I have this one go back to developer I will actually let's see I will move this window down here so you can see if something happens go to love directory here and when I click on unable then we should see a new file pop-up here yes it did we can do a tail on the file again that's actually a different file define we have now is actually it's after 8 o'clock one two one two six something where is 25 years 25 something our start the two of them in the same minute 45 okay so this one is empty is expected and now when we go to the RT data page then receive cycles nice and I think the problem here again is difficult to next one will don't log anymore and if we go back to this one we log so I have to stay on this page as long as we do the logging but I think that's a lot better than we what we did before so I think I'm quite happy with that for now next step is to now we are ready to kind of push this too to github and make a new release and in order to do that we can start by opening the change log this is in resources rests and change log and this is going to be version 1.7 and here we add that there [Applause] desk top and mobile another thing we did is fixed 16k and ref 51 firmware again just to point that out because this is like the third time man uploading a release of this one that did work properly but now actually use the 16 K firmware to actually demonstrate the logging using the app so that's that's quite nice next up we have updated change log now we want to go back to that project version of mask tool remove those defines no debug build no bit mobile versatile version 1.7 and finally we want to go down to other files Android and this manifest file version called 14 1.11 this is so that we can update it on Google Play and finally when we've done all of this what they usually do at this point is that I do get diff and then I evaluate all the changes carefully and see if we can spot an error that's actually quite useful so let's go ahead and do that and that's the manifest file and this is actually a pack that I fixed before but I saw the coincidence this name filter I will just leave it like this now we could actually keep file selected in this one I noticed now because we can see when we select file but not do anything on the action and I think I will actually do that done they own difference between the folder and file picker is that the folder picker or the directory picker will not have an or the file picker will not have the okay button - Tuesday directory we actually have to pick a file so go back to I'm lost here again directory picker and we will take this one and put it here and then we can put back the other signal which will not be connected anywhere now but it's a pod wants to see when someone clicks on that a file then yeah but all means then you can do that very difficult yeah semicolons love necessary in written in JavaScript this is the new page where that sticky ml I think it looks quite fine so far a sensible names for everything the check box and the timer within the check box and as you can see once I had implemented in basque interface it didn't have to do a lot in the qml stuff in the JavaScript stuff mostly dating with the lack of a file picker and then we are back at the C code the C++ code and I think that looks okay so far to version info changelog and this is where we collect all the samples in store them to the file now at this point what we can do is you can actually put this one next to the date types file and just carefully check them one by one and see if they are matching we have the files the properties here you can probably even line them up here now the font size is not exactly same making oh I can zoom out a bit here maybe it will pick up the same done yeah more or less and I think it looks correct and open RT log file not requited before and that's all the changes pretty nice now usually this is what I do but I will just in case because I don't want to cause a lot of problems for lots of people gonna update and complain I will just pause the video and I will carefully look through everything again and then I will start it again and there well push stuff and that would compute this session alright so I'm back and I check this one again deserialization or the line of the log file and I got almost everything wrong or almost everything but I got well I got the input voltage twice I forgot the mole to temperature and I forgot the RPM which might be some important things to have and we also do have default code so I think that is correct now and one last time we can actually try to log a little bit now when we run it I think it will still open the mobile app because even though I changed the project file back it will not be compiled the files will connect this one or scan and a correct starting got really tired now I go to this one don't shake okay we actually have to choose a file we pick log enable logging go to real time data go back disable logging and I will start to open this file with the text editor I have it on the screen a bit left of the log of the screen record or now so we'll drag it over there once I have it open so now I cannot even find text that door there we go and I don't know if the lines should end with the semicolon we browse it as LibreOffice doesn't seem to mind so I think that's okay so I think I think that should be ready by now everything looks correct so that's that's my video for today I will live push this to github and then I will rebuild all the versions of a stool and make a new mobile version and will make it with me release and then if you want to give it logging a try then go ahead and if you want to update to the latest the 16k firmware of after an Rev 51 done please give that a try too and if you're still watching which would surprise me then well thanks for thanks for follow me watching all this way