Offline behaviour


#1
  • R.Pi 3

  • Web UI

This may be a known issue or could be meant to work this way by design. It seems to me that Cayenne has a fatal flaw and that is my triggers only work when the PI is online. When it goes offline, nothing triggers. I am not talking about seeing the triggers on the Web UI. I don’t expect those to work since it is offline. However, I do expect that all the triggers fire appropriately on the Pi itself. It should have everything it needs to do that locally.

For example, my test circuit contains:
1- Blue LED
2- PIR sensor
3- Red LED
4- Temp Sensor
5- Fan

When the temperature exceeds a threshold, the red LED goes on, and the fan turn on.
When the temperature goes below that threshold, the red LED turns off and the fan turns off.
When the PIR goes high, the blue LED turns on.
When the PIR goes low, the blue LED turns off.

This is a simple proof-of-concept project that I setup to test Cayenne out. I’ve verified that all this works when it is online.
When the pi is offline however, none of the triggers fire. This is really bad. If I had triggered the fan when I was online, but then went offline, I will no longer detect the temperature going below the threshold event and so the fan and light will be on forever (or until the Pi goes online again). Other bad things could happen if events don’t trigger just because it’s not online.

Is there any reason why the onboard Cayenne agent can’t execute the triggers as it knows them from the last time it was online?

Thank you


#2

@rsiegel can correct me if I’m wrong, but I’m pretty sure currently triggers are all ran server side so the data needs to get to Cayenne first, then the server processes the trigger, then the server sends the action. I agree there are definitely benefits to running the triggers locally.


#3

Thank you for replying.

That’s very interesting that they decided to use server-side triggering. No wonder it takes so long.

Is there any reason the server itself can’t run on the Pi? The Pi 3 is a very capable device That way, the agent would just connect to itself. I could then just launch a browser and point it to localhost:8181 to access the dashboard.

It would reduce the load on your cloud servers too.


#4

Yep, local servers have been brought up before but I think the cayenne team is still quite a way from it. I’ve experimented a bit with node-red and cayenne to create a relay using node-red to get data to and from cayenne. This allows you to do triggers locally or really anything else you want to do and then use cayenne for a data display only. Using Node-RED as a Local Fallback Server


#6

@adam: Thank you for the NodeRED workaround. Very interesting.
@Bill: Thank you for letting me know about Blynk (and the interesting revisions)

I am a bit baffled and conflicted. Although I want to love Cayenne, I can’t.
Cayenne iOS app won’t run on my iOS 8.4 iPhone. It also won’t run on my mobile browsers (this is by design apparently)
It won’t run offline. It is slow to react due to server side triggering.

I threw together a few lines of Python that did all the actions above as well as send me a notification (and email) to my phone via the free Instapush service.


#7

I feel your pain.
I’m loyal to the myDevices people because-
Cayenne was the first IoT program
that actually allowed my custom made hardware
to WORK!

I’ve had nothing but dissappointment using Home Assistant
and Blynk.

The Blynk community is…um…“hostile”. Although the Blynk community is 300% the size of Cayenne, the people on that community don’t really offer to help other people. (my personal experience).

The problem with Home Assistant is- their admin, “Baloob”. That guy is worth avoiding. Plus- I’ve never been able to get any questions answered, and never gotten HA to work. At all.

But- @frakman , I have already made a stink to the Cayenne peeps about EXACTLY what you are reporting. I was pretty much told that this is how Cayenne will be- if you drop offline, it does nothing.

On the plus side- with myDevices- you get Benny Estes, kreggly, adam and a plethora of technical typse that will jump in and help you out (if you ask nice). (I am working on that “nice” part. I try…


#8

Bill I’m disappointed I didn’t make your list, I’m a relatively nice guy! :wink: Maybe I fall somewhere in that plethora.

But yes, Cayenne as it stands today does require an internet connection to run. It was designed to be a generic platform that can handle all sorts of IoT devices and boards, a lot of which are much less capable than a Raspberry Pi, and don’t have the processing power (or even disk space) to run all of the logic that drives it locally.

That said the idea of a locally run Cayenne ‘server’ remains a point of discussion internally so as I’ve said before on here, if you like the idea, speak up about it! Just understand that it’s not part of our currently scheduled development so it’s not coming next month or anything like that.


#9

Hi @frakman,

Yep, this is true. And Enabling triggers to run without internet access is brought up often by the Cayenne community. It is something we would like to do, absolutely. It’s a matter of road map priority compared to other features and things that we are working on right now. If it’s any consolation, the Scheduling feature was designed to be saved locally on the Pi and continue to run on schedule in cases of loss of internet connection.

With fast hard-wire internet connection, triggers can be very fast. WiFi can slow down triggers and also depends on the sensor itself sometimes. Like PIR motion sensor can have 5 second reset depending on how hardware is programmed.

I’m sorry, but we only support iOS 9+ at this time.

The good news: We have just received a large investment and should receive additional very soon. Which means we can bring on more resources and start releasing more features that Cayenne users voice a need for. :slight_smile:


#10

lol…you beat me to it!

-B


#11

I just tried Blynk today and was quickly able to turn LEDs on and off. Impressive how quickly it responded from my iOS app too.

Reading temperature, however, was not easy and sounded like it needed some js code to run on the device first. Cayenne wins in that department.

I searched their forums and know what you mean about the hostile environment. Anyone who says ‘here, let me google that for you’ doesn’t really want to help.


#12

Truely, @rsiegel , you are at the top of the “nice guy” list. :slight_smile: I thought that went un-said.

I mean…you allow ME in here.


#13

So, @frakman , you managed to get a response from every principal involved in Cayenne developement. I’d say that they care.

TRY to get a response from the BLYNK or Home Assistant people. :wink:

The only help you’ll find for HA is the Brun Automation guy.
He’s helpful. Kind of.