Infinite reset loop
Infinite reset loop
I made a small mistake in my lua script and it seems like my RCP is stuck in an infinite reset loop.
Tried downgrading and upgrading the firmware but that did nothing.
I also probably lost my config without saving so thats depressing.
How can you get out of an infinite reset loop?
added info: Watching the uptime in the app it resets every 4 seconds.
Tried downgrading and upgrading the firmware but that did nothing.
I also probably lost my config without saving so thats depressing.
How can you get out of an infinite reset loop?
added info: Watching the uptime in the app it resets every 4 seconds.
Last edited by zechdz on Tue Feb 09, 2016 3:55 pm, edited 1 time in total.
vroom
I now sometimes get this when I try to connect. Even though when I do successfully connect the top bar says 2.8.7
- Attachments
-
- unspecified-4.png (33.41 KiB) Viewed 12295 times
Last edited by zechdz on Tue Feb 09, 2016 3:47 pm, edited 1 time in total.
vroom
It was continuously resetting so when I tried the command below it wouldn't connect far enough for me to issue the resetConfig command, just like the app because the RCP wouldnt stay on for more than 4 seconds.
The docs also say that when updating firmware, when you put into bootloader mode the app will not connect but firmware can be updated. In the same way, in bootloader mode I could not use the below command to connect.
My issue was using
> "else if" like in java instead of "elseif" like in lua
The docs also say that when updating firmware, when you put into bootloader mode the app will not connect but firmware can be updated. In the same way, in bootloader mode I could not use the below command to connect.
Eventually I just overwrote the firmward back and forth many times and tried to write a blank lua script many times, and it eventually worked.screen /dev/tty.rcpport
My issue was using
> "else if" like in java instead of "elseif" like in lua
vroom
zechdz,
When the unit first powers on, there is a 5 second window to disable the LUA run time by clicking the front button. Try that and see if it gets you back in the game.
That is also pretty bad if the LUA run time is able to crash the RCP unit. Once you get out of the loop, will you kindly post the code that you believe is causing the issue so we can fix it. Thanks.
When the unit first powers on, there is a 5 second window to disable the LUA run time by clicking the front button. Try that and see if it gets you back in the game.
That is also pretty bad if the LUA run time is able to crash the RCP unit. Once you get out of the loop, will you kindly post the code that you believe is causing the issue so we can fix it. Thanks.
Andrew Stiegmann (Stieg)
Principal Engineer
Autosport Labs Inc.
Principal Engineer
Autosport Labs Inc.
Now Im in situation that nothing allows me to update script:
- Flash firmware through bootloader (flashes, script stays)
- resetConfig through terminal stucks after Flashing Default Logger Config PASS
- press button shortly within 5 seconds after load - doesn't stop script from loading
- writing script through the App - timeout waiting for setScriptCfg
- Reload of config says "Port Closed"
Spent few hours already.
It shows me that old script sometime and then it goes to disconnect-connect cycle so I can't read log or update script.
It shows me detected v0.0.0 and so on once I'm trying to read a log.
- Flash firmware through bootloader (flashes, script stays)
- resetConfig through terminal stucks after Flashing Default Logger Config PASS
- press button shortly within 5 seconds after load - doesn't stop script from loading
- writing script through the App - timeout waiting for setScriptCfg
- Reload of config says "Port Closed"
Spent few hours already.
It shows me that old script sometime and then it goes to disconnect-connect cycle so I can't read log or update script.
It shows me detected v0.0.0 and so on once I'm trying to read a log.
Now tried to put same script and same story again. This is the script:
Code: Select all
local a=3;local b=43.5;local c=addChannel("CAN",1,0,0,300,"Hz")initCAN(0,500000)setTickRate(1000)local d=true;function onTick()if d then d=false;for e=1,10 do rxCAN(0,5)end;readCANmap()end;if d then local f=getUptime()local g=0;repeat collectgarbage()g=g+1 until getUptime()>f+1000;setChannel(c,g)end end;local h={}local i="0123456789ABCDEF"function readCANmap()local j=1;while j<=string.len(i)do local k=0;while k~=44 and k~=59 and k~=64 do println(k)j=j+1;k=string.byte(i,j)end end end;function readCAN(l,m)for e,n in ipairs(l)do local o=n[3]local p=n[4]if p==nil then p=o;o=1 end;if m%o==0 then local q=n[5]if q==nil then q=0;for r,s in ipairs(p)do q=q+s[1]end;q=q/8;n[5]=q end;local t=readCANdata(n[1],n[2],q)if t~=nil then local u=1;for e,s in ipairs(p)do local v=setChannelData(s,t,u)u=u+v end end end end end;function setChannelData(s,t,u)if s[2]==nil and s[9]==nil then return s[1]end;if s[9]==nil then if s[5]==nil then s[5]=""end;if s[6]==nil then s[6]=1 end;if s[7]==nil then s[7]=0 end;if s[8]==nil then s[8]=false end;local w=0;if s[6]<0.001 then w=4 elseif s[6]<0.01 then w=3 elseif s[6]<0.1 then w=2 elseif s[6]<1 then w=1 end;s[9]=addChannel(s[2],1000,w,s[3],s[4],s[5])s[2]=nil;s[3]=nil;s[4]=nil;s[5]=nil end;setChannel(s[9],getBitsNumber(t,u,s[1],s[8])*s[6]+s[7])return s[1]end;local x={0x1,0x3,0x7,0xF,0x1F,0x3F,0x7F,0xFF,0x1FF,0x3FF,0x7FF,0xFFF,0x1FFF,0x3FFF,0x7FFF,0xFFFF,0x1FFFF,0x3FFFF,0x7FFFF,0xFFFFF,0x1FFFFF,0x3FFFFF,0x7FFFFF,0xFFFFFF}local y,z,A=bit.band,bit.bxor,bit.bnot;local B,C=bit.lshift,bit.rshift;function getBitsNumber(D,E,F,G)local H=(8-(E+F-1)%8)%8;local I=1+(E-1-(E-1)%8)/8;local J=D[I]if F+H>8 then J=D[I+1]+B(J,8)if F+H>16 then J=D[I+2]+B(J,8)end end;J=C(J,H)J=y(J,x[F])if G then J=unsign16Bits(J)end;return J end;function unsign16Bits(K)if K>0x7FFF then local L=C(K,8)local M=y(K,0xFF)local N=0-B(y(-A(0x1000+L),0x00FF),8)N=N-y(-z(0x1000+M,0x0000),0x00FF)-1;return N end;return K end;function readCANdata(O,P,q)local Q={2,0x21,255,255,255,255,255,255}local R={48,8,0,255,255,255,255,255}local S=100;local T=P>255;if T then Q[1]=5;Q[2]=0x23;Q[3]=C(P,16)Q[4]=y(C(P,8),x[8])Q[5]=y(P,x[8])Q[6]=q else Q[3]=P end;res=txCAN(0,O,0,Q,S)if res~=1 then return nil end;local t={}local U,V,W=rxCAN(0,S)if U==nil then return nil end;local X=W[1]==0x10;local e=1;local Y=3;if X then Y=Y+1 end;if not T then Y=Y+1 end;while Y<9 do t[e]=W[Y]e=e+1;Y=Y+1 end;if not X then return t end;res=txCAN(0,O,0,R,S)if res~=1 then return nil end;local Z=(W[2]+1)/7;for _=1,Z do local U,V,W=rxCAN(0,S)if U==nil then return nil end;local Y=2;while Y<9 and e<q+1 do t[e]=W[Y]e=e+1;Y=Y+1 end end;return t end