RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 1 of 1
[BUG] Lua serial commands don't work with RC Track?
Author Message
Reply with quote
Post [BUG] Lua serial commands don't work with RC Track? 
I tried this script, on all ports, 0 through 6. (7 is not valid)

Code:
--initialize Aux serial port to 115200, 8, N, 1
initSer(4, 115200, 8, 0, 1)

function onTick()
 --read a line from the aux serial port with a 100ms timeout
 value = readSer(4, 100)
 if value ~= nil then
  println('read value: ' ..value)
 end
end


nothing happens it just sits there printing "read value: " with a blank. It's not a nil because the IF statement is true and the "read value:" prints. Except nothing prints. I tried all the ports. It's like the serial commands don't work with the RC Track 2.

script from: https://wiki.autosportlabs.com/RaceCapturePro_Lua_Scripting_Examples#Read_a_line_of_serial_data



Last edited by GTIspirit on Fri May 08, 2020 11:40 am; edited 1 time in total
View user's profile Send private message
Reply with quote
Post readSer not reliable? 
Doing a bit of digging around, sounds like the readSer command is problematic and it's preferable to use the readCSer command. Sounds like what I'm experiencing is similar to this:
https://forum.autosportlabs.com/viewtopic.php?p=26831#26831

It's probably no coincidence that Brent's GoPro Lua script uses readCSer instead of readSer.
https://wiki.autosportlabs.com/AutomaticCameraControl#Lua_Script

View user's profile Send private message
Reply with quote
Post  
No response on any serial ports. I tried with/without the initSer command, tried 115200 and 921600 baud rates. Tried with all ports turned off, WiFi, Bluetooth, CAN, GPS.

Also tried sending the AT commands to the ESP8266 WiFi module. Still nothing.

Looks like the serial port commands via Lua don't work with the RCTrack2.

Code:

setTickRate(10) --TickRate is in Hz
initSer(0, 115200, 8, 0, 1)
initSer(1, 115200, 8, 0, 1)
initSer(2, 115200, 8, 0, 1)
initSer(3, 115200, 8, 0, 1)
initSer(4, 115200, 8, 0, 1)
initSer(5, 115200, 8, 0, 1)
initSer(6, 115200, 8, 0, 1)


function onTick()
port0 = readSer(0,100)
println("Port 0: " ..port0)
port1 = readSer(1,100)
println("Port 1: " ..port1)
port2 = readSer(2,100)
println("Port 2: " ..port2)
port3 = readSer(3,100)
println("Port 3: " ..port3)
port4 = readSer(4,100)
println("Port 4: " ..port4)
port5 = readSer(5,100)
println("Port 5: " ..port5)
port6 = readSer(6,100)
println("Port 6: " ..port6)

end


ESP8266 AT Instruction Set

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum