I’m impressed with the features and ease of use with Cayenne. What I’m trying to determine is how to perform math on sensor data. Is this possible with Cayenne? I’m seeing mentions of “custom code” with Arduino and if I interpret correctly, the only way to do it on Raspberry Pi is using it as a Bring Your Own Thing (BYOT), but I don’t want to lose the ease of setup using the widgets.
Here is what I think I want to do with my project.
- Read supported digital sensor values
- Read an analog value (I do have the option of going through an ADC for Raspberry Pi) and filter this value somehow. I do see that some inputs have filtering options.
- Based on those values and some logic, actuate some different digital outputs. 4. The math and logic on the inputs and outputs is more complicated than just greater than or equal.
- I can currently re-program on the device for my project, but what I like about Cayenne is the cloud/mobile phone app bi-directional capability.
I’ve already got some Raspberry Pi’s, Arduino’s (including MKR1000) and a Photon, so I’m open to options, just looking for the most straightforward. I have yet to find the ideal platform. Cayenne looks close, but the current lack of custom code for inputs and outputs looks to be my major showstopper. I also saw some mention of custom Python code in the works, is this happening?
Hey @eric_c_strauss, thanks for your interest in Cayenne and welcome to the community.
We had/have a bullet point for adding some sort of custom code capability for the non-BYOT Raspberry Pi connected devices, but I’ll be honest that it’s not a big internal priority at the moment since this can be accomplished when connecting your Pi via MQTT/BYOT.
I do appreciate your point about the ease of widget creation via the ‘Raspberry Pi’ agent option, but encourage you to give the MQTT Python Client a try. It’s not a whole lot more complicated than the traditional agent, especially after initial setup, and its a whole lot more powerful (and lighter weight on the CPU/RAM).
With the BYOT/MQTT connectivity, instead of connecting your device and sensors, and then adding widgets to receive data for them, you just need to publish the sensor data from your client, and we’ll auto-create widget for you to edit and customize. In that sense it might even be a tad easier once you learn the general format of the publish statements. I’d be happy to help you get up and running with it if you run into any issues. If you try the example client it has some fake sensor data in it that shows you the general format for sending values via MQTT.
1 Like
Thank you for the help getting started and the honest response with the custom code priority. I will most certainly need some help getting going. I hope to get a start on it soon.
1 Like