2020-08-25, 05:48 AM
ÍI’ve been playing for a while with the STALK_read.py trying to make my ST2000+ work with the autopilot app without success. Also tried the new standard signalk connection. I’ve found that the 9c seatalk1 datagram gets translated to signalk but not the 84 that reports autopilot state.
This is one example taken from my device:
$STALK,84,56,e,0,0,0,0,0,8*0F
I tried even pasting it into the Data Fiddler but it didn’t translate into any delta. I also installed the nmea signalk parser and got the same result so i did a step trace debug of the code and found that when it parses for the values of:
[U, VW, V, XY, Z, M, RR, SS, TT]
I get this results:
[ 5, 14, 14, 0, NaN, NaN, 0, 0, 8 ]
And the function returns a null after finding the NaNs
Those values are parsed like this:
var Z = parseInt(parts[4].charAt(1), 16)
var M = parseInt(parts[5].charAt(1), 16)
After this finding i tried the following modified datagram adding some zeros:
$STALK,84,56,e,00,00,00,00,00,8*3F
And the translation worked in both command line parser and data fiddler.
In conclusion I see two posible solutions, modify the STALK_read.py code to add the additional zeros or modify the parser so it can parse the single 0 correctly (I guess charAt(0)).
If anybody can guide me to the location of the files on sk server and which solution will be more suitable I can try making the changes, test and report the final solution.
Best regards,
Cari20
This is one example taken from my device:
$STALK,84,56,e,0,0,0,0,0,8*0F
I tried even pasting it into the Data Fiddler but it didn’t translate into any delta. I also installed the nmea signalk parser and got the same result so i did a step trace debug of the code and found that when it parses for the values of:
[U, VW, V, XY, Z, M, RR, SS, TT]
I get this results:
[ 5, 14, 14, 0, NaN, NaN, 0, 0, 8 ]
And the function returns a null after finding the NaNs
Those values are parsed like this:
var Z = parseInt(parts[4].charAt(1), 16)
var M = parseInt(parts[5].charAt(1), 16)
After this finding i tried the following modified datagram adding some zeros:
$STALK,84,56,e,00,00,00,00,00,8*3F
And the translation worked in both command line parser and data fiddler.
In conclusion I see two posible solutions, modify the STALK_read.py code to add the additional zeros or modify the parser so it can parse the single 0 correctly (I guess charAt(0)).
If anybody can guide me to the location of the files on sk server and which solution will be more suitable I can try making the changes, test and report the final solution.
Best regards,
Cari20