Hi Forum,
I keep having problems with Particle Functions being unreliable. I have a function that is almost exactly the same in operation as the " Blink LED" example.
My application is broadcasting values to Ubidots using the standard Ubidots library, about every 30 seconds or so. But I also use a particle function controlled by a button widget on Ubidots that pings the Photon with a POST command that fires the function. I can prove any problem from the Ubidots side using a html script that is almost EXACTLY a copy of that used in the control LEDs example. It is definitely not Ubidots.
What happens is that the Photon simply does not respond to calls for Particle function - but continues doing everything else - no problem
When I test using the html script I get back the error:
{“ok”:false,“error”:“Exception during function call”}
Is anyone else having this problem? It has now got to the stage where I will have to build in a physical reset using hardware. A soft reset using System.reset(); does not seem to overcome this bug.I’m using firmware release 0.6.0 and wonder if there’s any benefit in upgrading to 6.1 or 6.2. This is a commercial trial and I hesitate to upgrade without good reason.
Any help or advice greatly appreciated
Best wishes,
Chris
Hi @kennethlimcp ,
Thanks as ever for your prompt response. My feeling is this is not a cloud issue - as it is only resolved (immediately) by resetting the Photon - after which it operates fine again for days. But I hope the Particle guys might have a fix
Nope, the particle guys got back to me recently and asked me to run a diagnostic. It involves quite a bit of integration ( for my modest skill level) but I will figure it out. In the mean time, I think I may have found a problem with my router and am looking to replace it first.
I have created a situation that ends in the same result which might help. In my case I was sending Strings using Particle.publish rather than cstrings. As documented quite often in this forum, strings are not handled very nicely on an embedded device like a Photon but I had been getting away with it up till now so I had ignored the advice. However I recently accidentally put a publish event inside a millis() timer and then forgot to reset the timer. The result: the Photon appeared to continue to function, responding to all my buttons, displays and sensors were doing their thing but the now swamped Publish events didn’t work and neither did any of my Particle functions. This appears to offer me two possible things that I caused to fail - either a huge queue of Particle events the device cannot possibly clear or heap
fragmentation through very excessive use of String.
For Ubidots I personally would recommend using webhooks rather than the Ubidots library, its secure and uses the intended Particle ecosystem rather than bypassing it all.
Thanks for taking the time to respond - always greatly appreciated. Couple of things… firstly, i’m dealing with a Particle.function - not a Particle.publish function in the bit of my code that’s failing. Yes, I use Particle publish in the Ubidots “broadcast” but that does not seem to be the problem - infact I can simulate it working fine while the other bit (the particle function) just dies until the Photon is reset (I’ve now established a soft reset System.reset() triggered by a millis timer will fix the problem). But it is a massive reliability problem for me.
While I get that webhooks are great and more secure than the Ubidots library, I had a lot of reliability problems with the webhooks when I first started this project (see here if you’re into history… Webhooks, the console and Ubidots) and the Ubidots library just worked.
I may revisit on a future iteration, but for now I’m trying to satisfy a commercial brief that is way over schedule.
In my experience above both publish and particle functions stopped working. On the reliability front the only issues I have seen are on the Ubidots end, specifically the free platform. As soon as you move to the industrial platform, no such issues.
The fact everything comes back as working after a reset points distinct fingers at something like memory corruption and working with strings is one thing that could cause that, equally something going awry with a pointer, dropping off the end of an array or any number of the horrible things C/C++ lets you do.
A quick scan through the Ubidots library suggests it also uses strings internally, primarily when receiving data rather than sending it.
Thanks again for your reply. I am using the commerial Ubidots platform and am convinced the problem is not there. I can recreate the error using a simple html code. The only component using strings is in the partcle.publish commands, which work fine and continue to work when the particle.function freezes
Hi @BulldogLowell, sorry bout the late reply. I’ve just migrated my platform from Photon to Electron - and also using a different router - I’d like to observe for a few days and advise. Please bear with me - I’ve had strong concerns about the router which was running a range extender - it seems there may have been some sort of network contention cockup and I’d just like to run a clean iteration for a few days and see how it goes.
Thanks
Just an update. I have been running the photon with the new router, I’m yet to have a problem - but this has, in the past, been a very unpredictable intermittent fault. I’ll copy all respondents in should it occur again.