jeffpiazza / derbynet

Open-source Pinewood Derby race management, built around a web server and database
MIT License
100 stars 70 forks source link

NewBold Turbo Timer - Unfinished Heat issue - Win 11 #286

Closed majora15 closed 9 months ago

majora15 commented 9 months ago

Doing some testing to prepare for our pinewood derby in 2 weeks. We have the NewBold Turbo Timer, communication is over usb. When I run through a race that has a "car not finished" the timer doesn't reset. When looking at the timer logs it looks like there is an issue. The log I'm providing has a successful race, and then a race that Lane 4 never completes.

Is there an additional setting or a setting I need to remove from the start up to fix this issue?

start java -jar derby-timer.jar -n COM5 -d NewBold -delay-reset-after-race 10 -newline-expected-ms 10 pack442.xxxxxxxxxxxxxx/derbynet

timer-20240115-0936.log

jeffpiazza commented 9 months ago

It looks like the Turbo timer is prone to reporting a "lane 0" result, and it's not being handled very gracefully by derby-timer.jar. I'll have a fix up shortly.

majora15 commented 9 months ago

timer-20240115-0953.log timer-20240115-1002.log Here are two more log files if you need additional.

jeffpiazza commented 9 months ago

Try downloading the latest .jar from https://derbynet.org/download/derby-timer.jar and see if that doesn't work better for you.

majora15 commented 9 months ago

I'll check it out now.

majora15 commented 9 months ago

It looks like it is doing the same thing, I downloaded from the above url.

timer-20240115-1350.log

majora15 commented 9 months ago

Something else I tested, and the results were as I expected. If you have 2 cars jump the track and don't finish, lets say lane 1 and 4 complete. It will have the scores for lanes 1 and 4, then two 0 lanes with 0.000 time.

Let's also say that the worst thing happens, only 1 lane completes, the same thing happens, only lane 1 has results and there are 3 lane 0s. Now in that unlucky of even I would probably record the time of lane 1 on paper, rerun the race, then go back and modify lane 1's time. This would totally be a fluke thing, but definitely will happen.

Now you do have the other worst case that all 4 don't finish... maybe there was a big pile up on the I-4. :D You would have 4 - 0s with 0.0000 times. Very unlikely, and most likely would redo that run. However, it looks like the java timer app "crashes" and receive anything until you restart it. Easy solution there is to just restart the timer, but maybe some people won't think of it.

I know nothing about coding in java or I could help with the solution but count me in as a tester for this timer. I know the "manual" process to get this working again, so if you don't get around to fixing it before our derby race no worries.

Thank you for all the work you do to support everyone!

majora15 commented 9 months ago

Attaching all 3 scenarios as stated above from the logs:

timer-20240115-1912-two-cars-don't-finish.log timer-20240115-1915-three-cars-don't-finish.log timer-20240115-1925-four-cars-don't-finish.log

majora15 commented 9 months ago

I noticed there is a -lane option, but when setting this in the logs it is still showing lane_count=0. Wondering if this is maybe a solution to the problem just for NewBold timers, is to allow to override the number of lanes, then look for results for each lane. When a lane isn't reported it gets the max value. Just a thought.

lordscarlet commented 9 months ago

We just ran our event this weekend. We had one car that consistently DNF. After 10s DerbyNet would call the race done, and give the DNF a time of 10s.

I believe that is set in the settings, under Previous heat linger time (sec.) for "Now Racing".

majora15 commented 9 months ago

What timer are you using? From the logs I have attached the java timer is crashing because of how the results are being sent. I already have that setting set.

For example the return one heat was the following:

<-- 1 1.1109 2 1.4759 3 1.9233 0 0.0000 +09:38:17.155I Caught throwable from handler for LANE_RESULT java.lang.ArrayIndexOutOfBoundsException: -17

Lane 4 never "finished", however NewBold Turbo returns lane 0 instead of 4. This happens for each lane that doesn't finish. Then the exception happens which then intern fails to record the times. So it can't record the "10.000" since it wasn't able to parse the results.

lordscarlet commented 9 months ago

I am far from an expert, so I could easily be wrong.

I don't know what our timer is, and I don't have it in my possession to check, unfortunately.

majora15 commented 9 months ago

I understand, at least I have a workaround for the time being.

majora15 commented 9 months ago

@jeffpiazza wondering if the download of the java timer I downloaded had the fix it in since I am still able to reproduce the issue.

jeffpiazza commented 9 months ago

You may have gotten an older version if you used the https://derbynet.org/download/derby-timer.jar link previously. (The link has been fixed now, and should reliably be the latest version going forward.)

java -jar derby-timer.jar -v

will tell you the jar version. The (hoped) fix is present in any of the v9.0 series, but not earlier versions.