I changed that as you mentioned in your reply, but I have this output:
New Event: {"data":"SA000FB00000000C00400400E","ttl":"1","published_at":"2015-06
-26T22:33:00.196Z","coreid":"00000000000000000","name":"MyEvent"}. Loggin
g it to file
Data: SA000FB00000000C00400400E
There was an error writing the data to the log file
I got some data in the text file, but not all of it. Also can I put a return after each data reading, so I can have the data line by line in the text file something like this:
New Event: {"data":"SA000FE000B00000000CC00400000E","ttl":"1","published_at":"20
15-06-26T22:48:28.425Z","coreid":"000000000000000000000","name":"MyEvent"}. L
ogging it to file
File log success
All the data still together in the same line in the text file
Please I want to know what is the changing that should be done in the code to save the data SA00000000E in the text file instead of the whole line which showed in the console in case I want to show the time stamp with the data:
New Event: {"data":"SA000FB00000000C00400400E","ttl":"1","published_at":"2015-06
-26T22:33:00.196Z","coreid":"00000000000000000","name":"MyEvent"}. Loggin
g it to file
Data: SA000FB00000000C00400400E
Hello @harrisonhjones
I know that I'm bothering you, but please I want to know what is the changing that should be made in the code to save the data SA00000000E in the text file instead of the whole line which showed in the console in case I want to show the time stamp with the data:
New Event: {"data":"SA000FB00000000C00400400E","ttl":"1","published_at":"2015-06
-26T22:33:00.196Z","coreid":"00000000000000000","name":"MyEvent"}. Loggin
g it to file
Data: SA000FB00000000C00400400E
Hello @harrisonhjones
Iām sorry that I confused you. Now, the text file has the data, but I asked if I can include the time stamp with the data as you mentioned in your reply:
Therefore, if the data will have the time stamp in a csv format that will be great for me. If it is hard thing to do, then it will be enough to have the data only in the text file.
Thanks
Iām sorry for bothering you again.
Thanks @harrisonhjones
Actually, I expected to add the time stamp manually like this, but I thought that there may be a small modifying in the code to make it write whatever we see in the command line directly to the text fileā¦
Iāll try that when I return home.
Thanks a lot for your challengeš .
Dear @harrisonhjones
I tried adding the time stamp to the code, and it worked fine but the time is different from our us time. For example, the time now is 10:25 A.M. while in the console and the text file is shown as below:
I don't know why there is about 5 hours between the actual time and the data's time while the time is correct in the dashboard which is 10:25 A.M.
Thanks.
@Ahmedsa1983 I would personally keep it in GTM/UTC time (so itās the same no matter where you deploy the code) but if youād like it localized then have at it!
Hello @harrisonhjones
I know that itās the same, but the issue that my professor wanted to see the sensorās actual time as in our city instead of the GTM/UTC time.