Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
I am using Sigfox extension and it works fine for uplink.
I have read in documentation that downlink is not supported I don't really understand why :
I am using it simply outside Thingworx just by answering using a JSON message with the device ID and payload to send to sigfox when receiving a GET callback
(cgi-bin / python script)
exemple :{"FFFFF":{"downlinkData":"4142434441424344"}}
I am trying to use the "setDownlinkMessage" without success
I don't know what to put in "message" and "thingName" input, I tried many things but always (invalid payload in Sigfox logs)
Thanks for help
Pascal
Solved! Go to Solution.
solution given by support and working for me :
What is needed is to get results formatted as JSON. Two things are needed to make that happen:
So, when you configure the downlink in Sigfox, you need to include this Accept=application/json in your url parameter.
Also, you may have to enable disable Filter Content-Type under PlatformSubsystem in TWX.
In order to investigate, I have uploaded the extension into Eclipse java.
I cannot find any java code, just xml structures in the extension.
My question :
where can I find the code associated to the POST request send by SIGFOX in order to put the right json message in the answer ?
Thanks
hello
nobody is using Sigfox with thingworx who could help me to fix this downlink issue or should I re-developp a new one ??
Is this extension developped by Sigfox or by Thingworx ?
Thanks
Have you perhaps found a solution yet?
hello
still no solution !!
it works fine using a python script but not from Thingworx when I'm trying to return the downlink message
Sigfox API is requesting a Json to be returned when the POST procedure is executed:
{
"device_id" : { "downlinkData" : "deadbeefcafebabe"}
}
the problem is that when using "result" in Thingworx API I cannot return this simple json
var downlink = '{ "' + device + '" : { "downlinkData" : "' + "deadbeefcafebabe" + '" }}'
var result= JSON.parse(downlink);
I tested with postman
my python script :
raw
{"F0A62":{"downlinkData":"4142434441424344"}}
Content-Type: text/html; charset=utf-8
<head>
</head>
<body>
OK
</body>
pretty
{
"F0A62": {
"downlinkData": "4142434441424344"
}
}
Thingworx return using result :
<HTML><HEAD><TITLE>ThingWorx: Thing com.thingworx.things.ConfiguredThing@4ab6f80c : Response From Execution Of CallbackData</TITLE><LINK rel='Stylesheet' href='/Thingworx/css/thingworxapi.css' type='text/css'></LINK><META http-equiv='Content-Type' content='text/html'></META><META http-equiv='cache-control' content='no-cache, no-store'></META><META http-equiv='expires' content='-1'></META><META http-equiv='pragma' content='no-cache, no-store'></META></HEAD><BODY><IMG SRC="/Thingworx/images/ThingworxLogo.png"/><BR/><H1>CallbackData</H1><TABLE><TR><TH>result</TH></TR><TR><TD>{"F0A62":{"downlinkData":"deadbeefcafebabe"}}</TD></TR></TABLE></BODY></HTML>
pretty
<HTML>
<HEAD>
<TITLE>ThingWorx: Thing com.thingworx.things.ConfiguredThing@4ab6f80c : Response From Execution Of CallbackData</TITLE>
<LINK rel='Stylesheet' href='/Thingworx/css/thingworxapi.css' type='text/css'></LINK>
<META http-equiv='Content-Type' content='text/html'></META>
<META http-equiv='cache-control' content='no-cache, no-store'></META>
<META http-equiv='expires' content='-1'></META>
<META http-equiv='pragma' content='no-cache, no-store'></META>
</HEAD>
<BODY>
<IMG SRC="/Thingworx/images/ThingworxLogo.png"/>
<BR/>
<H1>CallbackData</H1>
<TABLE>
<TR>
<TH>result</TH>
</TR>
<TR>
<TD>{"F0A62":{"downlinkData":"deadbeefcafebabe"}}</TD>
</TR>
</TABLE>
</BODY>
</HTML>
of course this is not well interpreted by Sigfox ....
solution given by support and working for me :
What is needed is to get results formatted as JSON. Two things are needed to make that happen:
So, when you configure the downlink in Sigfox, you need to include this Accept=application/json in your url parameter.
Also, you may have to enable disable Filter Content-Type under PlatformSubsystem in TWX.