"Input string was not in a correct format" when radio is keyed

classic Classic list List threaded Threaded
4 messages Options
Mark KJ5NS Mark KJ5NS
Reply | Threaded
Open this post in threaded view
|

"Input string was not in a correct format" when radio is keyed

Doubled checked all the port settings.  v1.7.9, 8410 firmware 2.03k... power on/off works, standby/opr works, raw telemetry data is constantly changing, same issues after computer reboot.  Appreciate any assistance.
Dan AE9K Dan AE9K
Reply | Threaded
Open this post in threaded view
|

Re: "Input string was not in a correct format" when radio is keyed

This post was updated on .
Hi Mark,

That message can occur when the monitor attempts to convert data received from the amp to a numeric value yet the characters being converted don't represent a number.  There are two possible causes:

1) Telemetry data is valid when sent but is corrupted on the wire due to RFI on the USB line.

2) The amp firmware code is putting invalid data in a particular position within the telemetry string only when in states 4 or 5 (transmitting, still in EBS and transmitting, out of EBS, respectively).

For #1 the way to see if this is the case is to simply transmit into a dummy load.  If the issue occurs when transmitting into an antenna but not into a dummy load, then RFI is likely the cause.  Although each telemetry line has a checksum appended to the end, I haven't yet added an option to verify the checksums and skip parsing those telemetry strings that fail to validate.

#2 can occur because the amp is passing a digit that's much larger than anticipated.  For example, the monitor tries to convert a string of digit characters representing the average power into a 16 bit integer but the string won't fit in 16 bits (i.e. the conversion needs to be to a 32 bit integer).  This is a tricky one to troubleshoot as there are lots of conversions going on.  My suggestion would be to log the telemetry outside of the monitor (since the monitor crashes at the moment it receives the suspect data element).  Use PuTTY or similar terminal emulator and configure it to log everything to a file.  The key is to use the monitor before this as the monitor will leave the amp in streaming telemetry mode.  Close the monitor and start the terminal emulator (using the same port parameters as the monitor).  You should see telemetry lines starting with $APA21 scrolling quickly.  Configure the terminal emulator to log to a file.  Then do some transmit tests.  When complete, stop the terminal emulator and send me the log file it generated.  I can quickly assess the maximum values for each element position and see if any of those exceed the variable sizes I'm trying to stuff them into.

Scenario #2 isn't common given the amount of testing that has occurred with 2.03k but can arise due to the math the firmware does on values it's working with that are generated by analog-to-digital converters.  I only have a few snippets of the firmware's source code so it's possible Gordon allocated a 32 bit integer variable for a given purpose and based on a reasonable range of values expected I've only allocated a 16 bit integer - thus leaving the potential for such a conversion problem.

Try the dummy load test.  If that doesn't point to RFI, do the terminal emulator logging test and send me the log file. We'll get this figured out.

73,

Dan
AE9K
Mark KJ5NS Mark KJ5NS
Reply | Threaded
Open this post in threaded view
|

Re: "Input string was not in a correct format" when radio is keyed

Hello Dan,
I want to thank you for your support!!  I wound the usb cable at the amplifier and at the computer into a snap on ferrite with three turns on each end. Started with fresh down load on software. Every thing works great!!!

Thank Again
73
KJ5NS, MARK
Dan AE9K Dan AE9K
Reply | Threaded
Open this post in threaded view
|

Re: "Input string was not in a correct format" when radio is keyed

Mark,

I'm glad to hear the fix was the easier of the two options.

The issue you had is motivation for me to go back and add checksum validation code to the monitor.  That will allow me to expose a message that telemetry is getting corrupted in the same line where "Streaming mode is enabled" appears ... and just not parse the corrupted data.

It's on my to-do list.

73,

Dan
AE9K