Webhook reply with Sigfox downlinkmessage

Hallo,
My goal is to include some data from device data in to the downlinkmessage.
I retrive a value from the Input control on my Dashboard and store this in the Workflow storage.
This is the Downlinkmessage value that is added to the Device attributes via the Storage:get_node.
and so on.

WorkflowPicture

now to my Webhook rply Node:

the Losant example: Collect, Monitor, and Visualize your Sigfox Data with Losant

used this String:

 {
	"{{ data.body.device}}": {
		"downlinkData": "0000000000000000"
	}
}

This works fine.

my not working String looks like that:

{
	"{{ data.body.device}}": {
		"downlinkData": "{{data.body.dmsg}}"
	}
}

the data.body.dmsg have the value of i.e. 11 and can be used in the body of an email with the email-node.
But i on my Sigfox backend im getting errors.

I hope that someone can help me with this.

Hello!

Could you provide me with some more information on what Sigfox errors you are getting?

Thanks,
Julia

The Sigfox_Backend Error:

Error_Preview

Error

But i found the problem.
The Sigfox_downlinkmessage have to be exactly 8 Byte long.
So i changed my value of 11 to 1100000000000000

but thanks for your quick response.

1 Like

Hi everybody,

i am new to losant. I try the same but i can’t get it to work. I try to read a value from a range slider an send it as downlink message.

The static values from this tutorial Collect, Monitor, and Visualize your Sigfox Data with Losant work fine.

Is there a tutorial how to get this to work?

Best regards
Frank

Hi @Frank_Schleking,

Could you provide some additional information on the specific error or issue you are facing? Is it occurring within the workflow? Are you able to successfully trigger the workflow from the dashboard (Input Control Block)? Or is the error occurring between Losant and Sigfox?

Thanks so much!
Julia

Hi @JuliaKempf,

my problem is to replace the static value

 {
	"{{ data.body.device}}": {
		"downlinkData": "0000000000000000"
	}
}

with the slider-value (in this case: data.body.rueckmeldung)

{
	"{{ data.body.device}}": {
		"downlinkData": "{{data.body.rueckmeldung}}"
	}
}

First i created an attribute: rueckmeldung

then i created a slider an a button:
1

then i configured the slider and the button:


my workflow looks like this:

the left part works fine with the static value. i can see the value in the downlink callback in the sigfox backend.

in the virtual button configuration i did not change anything.

my storage:set value node:

then in webhook reply i replaced the static value with “{{data.body.rueckmeldung}}”

I hope you can help me.

Thank you and best regards
Frank

Hi @Frank_Schleking,

I believe your problem is occurring as you are trying to send the literal value of the range slider to Sigfox, which will be between 0 and 100 . Has this value been modified to be 8 bytes in length?

I would recommend adding a Debug Node to the end of your Virtual Button Workflow as well so you can see each time this is triggered from your dashboard.

Thanks so much!
Julia

Hi @JuliaKempf,

i added a debug node at the end.

It says “null”

i want to write the slider value “range-0” to my device tag “data.body.rueckmeldung” as a string filled with zeroes so the string is always 8-Bytes wide.

Thank you very much and best regards
Frank

Hi @Frank_Schleking,

My next suggestion would be to ensure you are triggering the correct workflow. Within the Input Control Block, select the workflow and be sure you have selected the correct Virtual Button to trigger:

Please let me know if you currently have this configuration!

Thanks,
Julia

Hi @JuliaKempf,

yes got it.

My workflow looks like this:

11

how do I have to configure these blocks?

Best regards
Frank

@Frank_Schleking,

Are you seeing something not work with your workflow? Or, are you seeing any error or problem?

Hello Losant Team, I was reading the case but I couldn’t resolve mine.
I’m using this workflow to get a string from my dashboard:
image

The result is a string which is saved to my table:

sigfoxPayload": “31e254078d039000”

When I receive a callback from sigfox, I get the value from table to send it to webhook reply:

I get the value of my table and I put it to:

payload.data.body.sigfox

Then I use the payload for webhook Reply:

After all this, sigfox shows error in payload:

Status : [INVALID_PAYLOAD] Data (Hexa) : N/A

Could you help me to understand what is happening?
Thank you in advance

Hi @Gibran_Cordova,

Welcome to the Losant forums!

Is your webhook “SF Callback” Configured to wait for replies?

Thank you,
Heath

Also, @Gibran_Cordova,

It looks like {{data.body.device}} is not on your payload.

Thank you,
Heath

Hi Heath, thx for your quick response.
Yes! that was the problem, I noticed that after get data from table, the body of my payload changes.

After that, the device id dissapears from the body

I tryed to use get and set storage, but I couldn’t make it works.

I had to put the ID manually to succesfully send the callback, and it works!
image

But it’s just a temporary solution. How can I pass the payload and use it in my callback node?
Thanks in advance
Gibran