Page 1 of 1

Where is the log file that Lua prints to?

Posted: Thu Jul 30, 2015 2:18 am
by mrldcty
Sorry for the dumb question, but I can't find where my print statements in Lua are being logged to. I see them in the scripting part of the RCP app (you really need to make the script section of that scroll BTW). But they aren't being written to my SD card AFAIK.

I'm trying to log a bunch of raw CAN data and then import it into a spreadsheet along with the ECU data to figure out which channel is which.

Thanks in advance for any pointers.

Posted: Thu Jul 30, 2015 2:27 am
by toga94m
You can hook up a USB cable to your PC and run a terminal program on the serial port (115200 baud). Hit enter to get a menu of commands; type viewLog to get a running scrolling log of whatever's happening in your script. Here's some of my capture of the CAN dump script, listening to Megasquirt broadcasting.

Code: Select all

RaceCapture/Pro > viewLog
Starting logging mode.  Hit "q" to exit
.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 216.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 216.0, 0.0, 0.0, 3.0, 213.0, 255.0, 254.0, 1516.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1512.0, 3.0, 215.0, 0.0, 0.0, 3.0, 213.0, 

Posted: Thu Jul 30, 2015 3:31 am
by mrldcty
Thanks! Will try to find the right termanal emulator and give it a whirl.

Posted: Thu Jul 30, 2015 4:59 am
by mrldcty
No joy using Indigo as the terminal emulator. Which protocol and serial configuration does it require?

Posted: Thu Jul 30, 2015 2:05 pm
by toga94m
Use device manager to see what COM port the RCP appears on.. I use PuTTY as my terminal program (also good for telnet/ssh work) http://www.chiark.greenend.org.uk/~sgta ... nload.html then just tell it serial port, set baud at 115200, and it should work.

Posted: Thu Jul 30, 2015 3:43 pm
by mrldcty
Yep, did all that with Indigo and it seemed to start up a session but getting no data back from viewLog. Will try putty to see if that works better.

Thanks so much for the pointers!

In the mean time, I think I figured out the RPM channel. The CAN IDs that the EC2 is emitting don't match what is in their documentation, and I get a lot of IDs, not just one, when I turn on that one channel at the ECU.

Posted: Thu Jul 30, 2015 4:10 pm
by toga94m
Did the command / help menu come up when you hit Enter? That'll confirm the terminal session is working properly. The command parser also doesn't understand backspaces, so if you make a typo in a command (like 'vieLog' instead of 'viewLog') you have to retype it, can't backspace and fix even though it looks right on screen.

Posted: Thu Jul 30, 2015 4:16 pm
by toga94m
You can also change the log level to limit how much stuff you see. I don't know the default setting, or what I've got mine set to right now...
EMERG = 0,
ALERT = 1,
CRIT = 2,
ERR = 3,
WARNING = 4,
NOTICE = 5,
INFO = 6,
DEBUG = 7,
TRACE = 8

Posted: Fri Jul 31, 2015 4:26 am
by mrldcty
Thanks so much for the tips. It seems like the session starts up, but neither "enter" or viewLog produce any output. Will be back on this tomorrow. I was able to sort out RPM mapping using the app, so I might just use the same approach for temp and pressure to get going. I have a race in a week! 😊