Alpaca issues

Issue #1314 closed
Kim Janny created an issue

I tested ASCOM Alpaca but I found there are some properties are not supported correctly.

For example, Telescope SiteElevation is float type but NINA only tried to convert it Int and threw exception.

I didn’t test all properties but RightAscensionRate and DeclinationRate are also showing the same issue.

https://ascom-standards.org/alpyca/alpaca.telescope.html#alpaca.telescope.Telescope.DeclinationRate

2024-05-17T20:51:32.6330|ERROR|AscomDevice.cs|GetProperty|380|An unexpected exception occurred during GET of AlpacaTelescope.SiteElevation:
System.Text.Json.JsonException: '0xEF' is an invalid end of a number. Expected a delimiter. Path: $.Value | LineNumber: 0 | BytePositionInLine: 11.
---> System.Text.Json.JsonReaderException: '0xEF' is an invalid end of a number. Expected a delimiter. LineNumber: 0 | BytePositionInLine: 11.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes) at System.Text.Json.Utf8JsonReader.TryGetNumber(ReadOnlySpan1 data, Int32& consumed)
at System.Text.Json.Utf8JsonReader.ConsumeNumber()
at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)
at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
at System.Text.Json.Utf8JsonReader.Read()
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value) at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) --- End of inner exception stack trace --- at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo1 jsonTypeInfo)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at ASCOM.Alpaca.Clients.DynamicClientDriver.SendToRemoteDevice[T](UInt32 clientNumber, HttpClient client, Int32 timeout, String uriBase, Boolean strictCasing, ILogger logger, String method, Dictionary`2 parameters, HttpMethod httpMethod, ImageArrayTransferType imageArrayTransferType, ImageArrayCompression imageArrayCompression, MemberTypes memberType) in J:\ASCOMLibrary\ASCOM.Alpaca\ASCOM.Alpaca.Clients\DynamicClientDriver.cs:line 854
at ASCOM.Alpaca.Clients.DynamicClientDriver.GetValue[T](UInt32 clientNumber, HttpClient client, Int32 timeout, String URIBase, Boolean strictCasing, ILogger logger, String method, ImageArrayTransferType imageArrayTransferType, ImageArrayCompression imageArrayCompression, MemberTypes memberType) in J:\ASCOMLibrary\ASCOM.Alpaca\ASCOM.Alpaca.Clients\DynamicClientDriver.cs:line 492
at ASCOM.Alpaca.Clients.DynamicClientDriver.GetValue[T](UInt32 clientNumber, HttpClient client, Int32 timeout, String URIBase, Boolean strictCasing, ILogger logger, String method, MemberTypes memberType) in J:\ASCOMLibrary\ASCOM.Alpaca\ASCOM.Alpaca.Clients\DynamicClientDriver.cs:line 471
at ASCOM.Alpaca.Clients.AlpacaTelescope.get_SiteElevation() in J:\ASCOMLibrary\ASCOM.Alpaca\ASCOM.Alpaca.Clients\AlpacaDevices\AlpacaTelescope.cs:line 1186
at InvokeStub_AlpacaTelescope.get_SiteElevation(Object, Object, IntPtr*)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Comments (3)

  1. Kim Janny reporter

    This is a JSON result when I run the Python reference code.

    b'{"Value":94.0,"ClientTransactionID":10,"ServerTransactionID":8874,"ErrorNumber":0,"ErrorMessage":""}'

  2. Log in to comment