Right, sorry about that, I’ll try to avoid confusing things further.
ok, i will try this
// Get the payload_raw which is Base64 encoded binary
$payload_raw = $json[‘uplink_message’][‘frm_payload’];
// Decode payload_raw in Base64, gives you binary so turn in to a hex string
$asHex = strtoupper(bin2hex(base64_decode($payload_raw)));
really sorry but i have very bad english and google is not my friend ^^
not work ^^
for the V2, i had spend a lot of time to found and now, i must spend time again (and i have 100 devices !!)
You and countless others.
Are you getting any errors? If so which?
Irrelevant - one script for 10,000 devices or 1 device - it makes no difference.
I’ll ask this again, because I’ve already coded the issue for you.
Did you look at the starter files that I created & linked to above?
The code for the PHP webhook shows EXACTLY how this is done?
yes i saw your code but i don’t found solution to adapt on my php script !
Does your server have a limit on the size of posted data? The new messages TTN sends are considerably larger and might require accepting larger post messages.
By the way, if you want help it helps if you answer questions we’re asking…
my server has no limit on the size
i am testing to put in base mysql the frm_payload to see if it work and to see format
i am testing a lot of thing and i thing i founded a way :
in my php file, i just put ‘ok’ in my base
when i call the script by url, i have ‘ok’ in my base, but when device send data, i have nothing in my base, as if webhook does’nt work
Huh?
$data = file_get_contents("php://input");
$json = json_decode($data, true);
$uplink_message = $json['uplink_message'];
$frm_payload = $uplink_message['frm_payload'];
…
here is my code but not work :
$payload_raw = $json[‘uplink_message’][‘frm_payload’];
// Decode payload_raw in Base64, gives you binary so turn in to a hex string
$asHex = strtoupper(bin2hex(base64_decode($payload_raw)));
// Example!
// This grabs the first two characters as hex and turns it in to a decimal number
$temp_int1 = hexdec(substr($asHex, 0, 4));
Yes, you’ve post that before and you say it’s not working.
Where in your code do you get the json data?
$data = file_get_contents(“php://input”);
// Decode it
$json = json_decode($data, true);
So given the differences between my working code and your not working code, how could you make your code work?
i just tested and the problem is not in the code !
i use http integration and now it is webhooks, but it is as webhooks don’t call my php file, i tested !!
i founded and it work !
the problem come from webhooks !
Great!
It’s not really clear what the problem was or why you quoted my code.
What was the problem so others can avoid the issue?
the problem was with webkooks ! we must check a case ! (uplink message)
and now i have a new problem :
All was ok since a few hours, but this morning, gateway receive end device information but application not receive ! all is same,I was sleeping and I didn’t touch anything