Integrating non-sensor data (Cayenne API)

I have an existing system that monitors a well pump and water usage that runs on an arduino. I’d like to pull summary data from the arduino (it exposes a REST interface) onto the PI and display that in the Cayenne app as if it were a sensor.

Is here a way to do this sort of thing? It looks like Cayenne only knows how to integrate via the GPIO system.

1 Like

@jim.barstow

Jim, welcome to the Cayenne Community!

No Arduino yet, but @bestes did mention this-

From: Network Speed, Processes, CPU Temp: this morning.

Again Jim, welcome,

Ian

The need isn’t specific to an arduino since I retrieve the data from the Arduino via a simple REST web api. (In fact, arduino integration probably wouldn’t help since the data is ONLY exposed via the REST web interface.) In general, it would be very useful to expose some arbitrary piece of data as if it were a sensor. For example, suppose you had a thermostat and could retrieve the current set temperature to the pi via some non-GPIO interface. It would be nice to be able to expose that data on the pi as if it were a sensor. This also allows massaging of the data before it is published.

Something like UART, BLE, USB, WiFi, maybe that upcoming ESP8266?

Am I getting the idea now? You’ll have to bear with me, I’m not the brightest candle on the cake.

Passing hard data back and forth. I’m sure the Cayenne engineers will jump at the challenge.

:hot_pepper:… SQL server…:hot_pepper:

Ian

What Cayenne needs is to expose an abstraction layer. Instead of handling specific hardware, they need to be able to handle a “generic” interface. This interface would act like some generic sensor that would return a value when queried. On the pi, the developer could then implement this interface so they would be free to obtain data from wherever they want. Might be some piece of hardware that Cayenne doesn’t support or it might be from some other system. In my case, I have a network of arduino’s linked by XBee radios that measures and aggregates data on water usage and pump activity. I’d like to write a piece of code that runs on the pi that takes this water usage data and returns a value that looks like a sensor that returns water usage over the last 15 minutes. I already have an app I wrote for the iPhone that graphs all data but I have to be on site to use it. What I want is to be able to get a quick snapshot when I’m not on site and to be able to send an alert when it looks like there is a problem.

2 Likes

YES ESP-826
I love it as a very simple wifi port, next edition with have the BTle etc…
YES ! Serial
This is why I like serial so much as just a few wires and a micro (any system / chip with uart capability) can interface very neatly. I like picaxe in this respect as it is very middle ground 8 pin package and a few wires and you get this sort of thing going on…


I would Love to integrate Cayenne into this and forward variables into the system.

Okay… this example is a little complex as it is forwarding radio packets over my Cicadacom protocol to and from other 08M2 chips.

Another reason I think serial is important is that a host of radio modules like the more advanced transparent end to end transceiver serial modules would just hook ditect to ttyAMAO as above image with just 4 wire jumpers.

~ Andrew

I can only support the idea. Would be nice to have a generic sensor that can be updated with a REST call to Cayenne backend. The platform now supports only limited set of sensors that have to be directly connected to Rasp Pi GPIO ports. The positive is that it is easy for beginners and well documented but of limited use and inapplicable for larger projects.

Well put.
I imagine filching data out of some registers in Cayenne would be even simpler to implement ? Inore the direct serial approach above it will be too complex and this is easy dealt to with pyserial providing some Generic Variable functionality is provided.

This is how I see it:

  • Presently Generic DI and DO can be set up and used via the GPIO header. Heaps and heaps of DI and DO so no worry
  • Playful AI and AO is pretty much No Go at present unless a limited range of sensors is used.
  • How about ‘Virtual’ or ‘Global’ variables or functions of some kind can some how be Read and or Written so that behave like virtual AI and AO within some shell / command / python script or similar.
  • Add Device > these as playful gadgets / set-able slider values but behave just like any other sensor variable input. Even if it was limited to 00.0 to 100.0% but I think that when setting up the variable number data type via the it would be easy to choose functionality like un/signed byte/word bit/resolution, float etc would be handy.
  • Add them also in a summary in the GPIO tab or similar like this or e.g. the WebIOPi Devices tab

Rip out some lines of Pi py Simmer over a low heat stirring occasionally
Enjoy… ?

~ Andrew

Moving this to Ideas / Suggestions category so it can be tracked in the road map, hope you don’t mind.

-B

Great
~ Andrew

Hey @jim.barstow,

Wanted to let you know that we just Beta released the Cayenne MQTT API. if you have some time, check it out and let us know what you think :slight_smile:

-B

1 Like

Good stuff. I would still be keen to see some close to native serial data direct into and out of the Pi. Lots of our projects continue to use this approach. The basic LoRa modules (Note Not LoRaWAN) are now on line streaming data from the vineyard now as point to point ultra long range backhaul units. These couple into a dozen lines of python and this post student formatted CSV data direct to various server GUI projects.

Even switching on (enabling in cayenne ?) the serial terminal that works well already at the WebIOPi level I would Love to see as a method to post at least txt type messages into say some kind of a Cayenne window or gadget.

Nearest patch, fix, workaround at the moment is having to remote to desktop, install and run minicon sessions…

~ Andrew