For almost three weeks, I am observing something wrong with TTN. The TTN actually received the message from the sensors and it is unable to send it to our webhook. Did anyone also face the same issue? I get the following error.
The Webhook works normally fine. This abnormal behaviour from TTN appears just for one or two hours and then it starts working fine. I don’t think that I have an issue with Webhook settings or our backend API.
I did not explain my problem in the first place. The main issue that I am having now is that for a certain period of time I get this Failed to send the webhook message in the TTN and at this time I also don’t get any data at my endpoint API. After some hours, the TTN starts again sending data to Webhook and I also receive data at my endpoint API.
Hi Imran, what does the error metadata tell you? Click on one of the error messages to expand and see more… you may get a clue. I’m busy migrating GW’s and nodes to V3 and missed fact one of my early migrations was throwing a similar webhook error. When I checked I saw it was still linking to a temp server set up by Nick @descartes to support the Things Summer Academy…now long since switched off. I simply deleted the errant webhook. You may find similar clues… a malformed/corrupt url, dead service, changed connection/service no longer correctly formatted or whatever… worth a peep. If you don’t understand why you see capture as text (not a picture) and post here for others to assist where poss.
Why are you including both a Downlink API key and an Authorization header with a TTS key? The first is so you can do Downlinks - the other headers are only for your convenience. Are you using the key to do other things? If so, nice trick. I’m going to use that as it saves embedding the key in the PHP settings!
I think the simplest thing to do will be to run another webhook in parallel that doesn’t need the extras. Perhaps if you use this:
as is - it literally just logs the incoming messages to tab files - and has been well exercised by the Summer Academy students - it will tell us if there is an issue with the Downlink API Key & additional headers setup. Which will be all on the TTS side as it is literally fire & forget.
As always, thank you so much @descartes for your valuable suggestion and guide. Actually, I just analyzed the metadata and found this error is because of my API.
This is just for validation/authorization.
As you have experience in this field, I am wondering, why the same API works for sometimes and why it does not work for sometimes? Does the TTN send different metadata for the same kind of sensors in the same application?
Was your API returning an error code - not something I’ve tried but again, will give that a go - I wasn’t aware that the TTS waited around for a response!
As far as I know it sends exactly what we see in the console - so it’s whatever comes up after the payload formatter.
I guess this is an error, which comes from the Laravel framework.
`"body": "<!doctype html>\n<html class=\"theme-light\">\n<!--\nError: Object of class stdClass could not be converted to string in file /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 332\n\n#0 /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(398): Illuminate\\Filesystem\\FilesystemAdapter->prepend()\n#1 /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\\Filesystem\\FilesystemManager->__call()\n#2 /var/www/gcdb/app/Http/Controllers/SensorDataController.php(49): Illuminate\\Support\\Facades\\Facade::__callStatic()\n#3 /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\SensorDataController->getData()\n#4 /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction()\n#5 /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\\Routing\\Controlle",`
[/quote]
I’m not saying don’t have a web application - I’m saying that the load on your server from an incoming uplink will be variable and that using a web application framework to parse some JSON and put it in to a database seems like asking for scaling issues.
Not that I’ve been coding Personal Home Page since Rasmus bought it out at the same time Håkon created CSS but just before Brendan bought us LiveScript, just at the time Tim drafted a standard for his HTML thing. Not sure quite how it got so out of hand since, I blame JQuery, it started a trend.
If you’re building a larger application, it’s totally fine to use a framework like Laravel/Rails/Django/… and implement webhook receiving logic into that larger application.
I think the conclusion of this discussion is that this is not an error in The Things Stack, but an error coming from @LoRa_AuH’s application (formatted for readability):
<!doctype html>
<html class="theme-light">
<!--
Error: Object of class stdClass could not be converted to string in file /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 332
#0 /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(398): Illuminate\Filesystem\FilesystemAdapter->prepend()
#1 /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Filesystem\FilesystemManager->__call()
#2 /var/www/gcdb/app/Http/Controllers/SensorDataController.php(49): Illuminate\Support\Facades\Facade::__callStatic()
#3 /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\SensorDataController->getData()
#4 /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction()
#5 /var/www/gcdb/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\Routing\Controlle...
So this is not something we can fix on the TTN side, but should be fixed in your code.
How did you solved this problem? because I am also suffering this problem , at ThingSpeak in csv file entries are show with timestamp value but not any data. here I am explaining how do integration
create new channel
Copy the Write API Keys
The Thingstack open
TTN Integration–>Enter Channel ID, paste WRite APIKeys and create
After this i am also suffering from problem . Please help . Please give solution step by step . Thankyou so much
and I am senting an integer value from LoRaWAN node to multigateway channel my data is reached at ThingStack but from here not reached to Thingspeak
What is this payload? Is it MAC payload? I send the packet from LoRa node to gateway after that packet goes to TTN server. What is this packet carrying? Please explain each and every part of the packet. and how retrieve this packet?
Thankyou