My Electron has 7 particle functions and most do nothing more than set a flag that controls flow in loop(). 9 times out of ten they work just fine. Occasionally, nothing happens and the RECIPE log shows PARTICLE ACTION ERROR. If I do nothing more than press the DO button on my iPhone again it works. The loop program does nothing that blocks for any excessive time. No delay is longer than 1000. What do I do? I can’t tell my customer that if he finds his tank empty to try the START PUMP BUTTON again. Could it be because these functions are sometimes called from loop()? It seems that documentation should warn about recursion if it’s possible. My shut_valve function is called from loop() as well as through IFTTT DO. Help!
The iPhone DO icons change form as IFTTT processes the function call. Perhaps Particle could persuade IFTTT to use color (red) to indicate that IFTT has detected some error. Suppose I use IFTT and an ELECTRON to shut off house water main when I leave house for extended time. I would be real unhappy if returned to find my house flooded from a leak and the shut valve function not executed because of the random PARTICLE ACTION ERROR.
Are these errors consistent? As in, can you click it, say 50 times, and it will always fail a couple of times?
If so, would you mind trying the same thing, but then use this page to call them? That should rule out IFTTT.
Sharing your code would also give us some more insight as to what might be going on
The following is my first reply but I see that I screwed up the test because I ran “this” BEFORE starting the ELECTRON so I never saw or used the particle function list. Keep that in mind while interpreting my reply. We novices can screw up any instruction.
I followed your instruction “this” which appears to log IFTTT interface some of which I have seen in DASHBOARD. Program ran perfectly with much heavier DO usage than ever before. To make sure I checked the IFTTT log for each function. Did “this page” change the processing and point to an error?
My heavy use of DO taught me that a small circle appears at top of iPhone screen, it then gets a check mark, then the TITLE blinks. What do I tell my customer - That the sequence indicates success? What is success from POV of IFTTT? I will right now try it again w/o “this” and see if it works as well. I did notice one curiosity. Each DO makes an entry in my status log. For this first time ever, Cell Quality dropped from 43 to 25 for one entry. db was unchanged: -79. My test bed is stationary.
Thanks for the help. This system is going in a hydroponic farm to manage a tank farm. Hope to sell many more if I can get it to be reliable.
Will update this reply after running next test.
What is your opinion of risk in my calling the Particle.functions from loop also. Do you see danger?
got the error right off PARTICLE ACTION ERROR. Probably because I selected DO on my iPhone too soon while the ELECTRON RGB led was still flashing cyn. trying to connect. So that’s not good because the connection can drop anytime and a remote user won’t now that his function select / action is going down the drain. Will try now to reproduce. including using “this”. Thanks again I feel we’re getting someplace. I also noticed that the DO TITLE did not blink on the failed test.
OK I can definitely get a PARTICLE ACTION ERROR in IFTTT DO log (by the way notice that the log selection icon, three vertical bars, goes red when there is an error nice!) by selecting DO from my smart device while the cyan RGB ELECTRON LED is flashing looking for connection. This makes DO unfit for commercial use as the remote user doesn’t have a neat way of seeing that his command was trashed. Connections can come and go. I’m sure that caused the random failures I was investigating. I’ve seen the cyan flashing at various time even though I have a good signal (43). Who knows maybe my wife is using her phone to look at FB. True, I send a status tweet to verify an action. But I can’t
tell a customer to go to twitter every time he does a function to see if there was a verification. I don’t understand why if IFTTT can advise of the PARTICLE ACTION ERROR it can’t also display error on the user’s smart device??? As an aside it does appear that the DO TITLE flashes on success but not on error. If I’m correct, it is a small step to a commercial quality feedback.
Alright, there’s a bunch going on.
The page I linked to does nothing special whatsoever. It’s a simple interface to call functions, request variables and display your SSEs.
Do you have some visual indication on the electron to see if the function get called successfully, a blinking D7 or something? You could then use the page I linked to to trigger the function to rule out IFTTT as a middleman.
If you do want some feedback from the device that the function was executed, you could have it respond with a publish, that would trigger a notification on mobile? Then you’ve gone full circle, and should also be a more reliable method to check if the call made it, and things were receiver properly. That does come with an increase of data however.
If you’re planning on a commercial application, I wouldn’t use IFTTT as your main control method. I’d much rather opt for a webapp, or if need be, a native app. I don’t find IFTTT reliable enough for any critical situations, but that’s more on their end than it is on Particle.
Thanks I have tons of feedback everything on a serial log as well as lights on relay board and status LEDs on breadboard… I’m with you IFTTT isn’t going to cut it. I have to have feed back on remote users’ devices.
However, I was checking the accuracy of my reply and much to my surprise found that flashing cyan is not discussed in GUIDE. We’ve gone this far, so I like to know just what flashing cyan means. I looked at my Electron and it does flash (10HZ) cyan at times including every start up from power off condition.
You’re right Anyhow, most light patterns should be similar for all devices, so this should still hold true for the electron as well: https://docs.particle.io/guide/getting-started/modes/photon/#connecting-to-the-cloud
Thanks… going there now. I’m not sure I understand the titles. I’m thinking you’re a volunteer expert. Extra thanks if so… and for my next issue can you point me to where I can see how the code snippets are posted in a little scrollable window. HTML?
To have code blocks nicely formatted just wrap your code block between these
```HTML // HTML block here
// C++ code here
More to read here https://community.particle.io/t/forum-tips-and-tricks/3999
I fully agree with this statement:
But there might be a workaround to make things more reliable using IFTTT. The unreliability might come from calling a function. If the particle is not available at that exact point in time, the function is not run.
Would it be different if you set a cloud variable using DO? Your loop code could then check the variable and react to it. If I’m right, this would ensure that your code in tolerant to network outages and suchlike events happening to your Particle.
For peace of mind, do this using an IFTTT trigger on your Particle publishing a status message and routing through Pushbullet:
That’d be queued cloud calls, which are on the backlog. They’ll hopefully be implemented some time soon, since they could be really useful.
Considering you’re using an ifttt app to trigger it, you might as well just use their notifications(?) One less third party to rely on.
- Thanks Moors7 and mayhew1955. I’m going with write my own smartphone app to turn stuff on and off plus display sensor data… I’m thinking MIT app inventor. The SDK stuff in Particle documents seems intimidating to me.
- Would it be easier for a nubie (I just got the cloud pun) to slowly adapt Tinker one change at a time? Advice?
- last question. I don’t find any way to read Particle.variable from photon or electron. The Particle.variable example shows a get. How do I do that from my Photon or electron?
I’m using your dashboard provided here to find out why Particle.function isn’t showing up. It doesn’t show up in your dashboard either. I’m sure it’s a particle problem because the test sketch is the coffee example in the Particle Reference Doc. Everything anyone could possibly want is in the screenshots for ELECTRON FUNCTION… in troubleshooting category my post today. Thanks in advance for any help.[troubleshooting post]
Adding a link to that post would be an idea - don’t expect others to search for it