For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
36 1 2 2

Need assistance with Web Sockets - Json conversion error.

Hello,

I am testing my Web Socket connection using the “WebSocket API Try it Now! Documentation Zip File” from TR DEV Community. It connects and seems to work fine, until I request a symbol. I see the error message "Json conversion error." See details below.

Thx

Gary

-------------------------------------------------------------------------------------------

Google Chrome
Version 63.0.3239.132 (Official Build) (64-bit)
Windows 10 Enterprise

SENT:
{
"ID": 2,
"Key": {
"Service": "IDN_RDF",
"Name": ".DJI"
}
}
RECEIVED:
[
{
"ID": 2,
"Type": "Status",
"Key": {
"Service": "IDN_RDF",
"Name": ".DJI"
},
"State": {
"Stream": "ClosedRecover",
"Data": "Suspect",
"Text": "Json conversion error."
}
}

treprdp-apiwebsocketsrrto
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
36 1 2 2

Hi @Gurpreet.

I think I solved the issue! I changed the following setting in my ads_pop.cnf:

*ads*IDN_RDF*dataType : 2 ---> 6

Thanks

Gary

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thank you for sharing.

I found one incorrect configuration in ads_pop.cnf.

*ads*defaultJsonServiceId : IDN_RDF

*ads*defaultJsonServiceId requires a serviceId.

The serviceId of IDN_RDF is 257. Therefore, the correct configuration is:

*IDN_RDF*serviceId : 257
...
*ads*defaultJsonServiceId : 257
@jirapongse.phuriphanvichai

Thx for catching that... now my default service works as it should!

Upvotes
78.1k 246 52 72

I can replicate the issue by configuring ADS to use SSL protocol instead of RSSL protocol

*ads*routeList : hostssl
*ads*hostssl.route*serviceList : IDN_RDF
*ads*hostssl.route*port : rmds_ssl_sink
*ads*hostssl.route*hostList : 192.168.27.48
*ads*hostssl.route*userName : DACS_CASCADE
*ads*hostssl.route*protocol : sslauto
*ads*hostssl.route*singleOpen : True
*ads*hostssl.route*compressionType : 1
*ads*hostssl.route*pingInterval : 2

The routeList uses hostssl route which connects to rmds_ssl_sink port with sslauto protocol.

You need to configure ADS to use RSSL protocol instead, as shown below.

*ads*routeList : hostrssl
...

*ads*hostrssl.route*serviceList :  ELEKTRON_DD
*ads*hostrssl.route*port : rmds_rssl_sink
*ads*hostrssl.route*hostList : 192.168.27.46
*ads*hostrssl.route*userName : DACS_CASCADE
*ads*hostrssl.route*protocol : rssl
*ads*hostrssl.route*singleOpen : True
*ads*hostrssl.route*allowSuspectData : True
*ads*hostrssl.route*disableDataConversion : True
*ads*hostrssl.route*compressionType : 1

The routeList of the above configurations uses hostrssl route which connect to rmds_rssl_sink port with rssl protocol.

Please change routeList to use rssl route protocol. If it doesn't solve the problem, please share the following information:

  • The version of ADS
  • The ADS configuration file
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
36 1 2 2

Thanks for your answer... I did check this setting, and it appears to be correct.

I am using ADS version 3.2.0.L1... have attached config file. Please let me know if you find anything out of place.ads-popcnf-egv-csd1.txt


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
36 1 2 2

Also... I should mention that this ADS 3.2 POP is being fed by TREP 2.6.1 ADH/ADS. Would this cause the issue? (Edge ---> adh 2.6.1 ---> ADS 2.6.1 ---> ADS 3.2)

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
21.8k 57 14 21

Hi @gary.backes Are you using the latest version of download package?

What response do you get, when following request is sent (omitted service name):

{
    "ID": 2,
    "Key": {
        "Name": ".DJI"
    }
}

In my setup I get the JSON error, when the service name requested does not match the service name provided by infrastructure.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.