Viewing historical data (and other newbie questions)

I learned about Cayenne from an ad on the site, was quite impressed by the dashboard display and would like to use it in a variety of monitoring applications.

To get started, I followed the Manually Publishing / Subscribing tutorial, installing MQTT.fx and configuring a simulated temperature sensor per the example. The widget appeared as expected and correctly shows an updated value upon changing the source data and clicking Publish. I set up a trigger and received the expected SMS upon sending a value above the threshold.

However, numerous things are not working properly and I don’t know how to troubleshoot them.

  1. When re-opening the dashboard, the widget reads zero, until the next publish event occurs (even though Retained was selected for previous transmissions). For example, if room temperature is reported every five minutes, you’d have to wait up to five minutes to see the current value. Chrome, Firefox, IE all fail the same way.

  2. Upon clicking the Details and Chart button, the live data chart shows up fine, but selecting any history option causes the spinner to run indefinitely, until the sub-window is closed. Once closed, clicking the button again won’t reopen it, even if all browser windows are closed (including killing any stuck instances with Task Manager) and the browser is relaunched. If you try with another browser, you can open the chart again, but only once. Failed attempts give a JavaScript error (example from Firefox console):

Error: is null
  1. Because of the above website issues, I tried the Android app. It apparently installed correctly and I can log in ok but get a “No devices added” error. Upon attempting to add a device, the only choices offered are Raspberry Pi and Arduino.

  2. I tried the iOS app; unfortunately the results were same as above.

  3. So, maybe this does need a Pi. I have several, but they are all running ‘big’ projects, such as RasPBX or Kodi. Is Cayenne generally compatible?

  4. Assume that (5) is not an issue, or that a Pi is dedicated to Cayenne. It appears that all of the examples involve sensors and actuators connected to analog or digital I/O ports on the Pi. My stuff is not like that. They connect via USB (Honeywell weather station), via the LAN (alarm system, Insteon gateway), via manufacturer’s cloud API (Neurio, Honeywell thermostat) or by scraping the manufacturer’s portal page (thermostat furnished by power company). I assume that the related scripts would use MQTT to keep Cayenne updated. Is that correct? If so, it seems unrelated to the Pi and could run just as well on e.g. a Windows PC or a Mac. Does running this code on a PI magically cause the mobile apps to work? If so, does it actually have to run on a Pi or does one just need to declare that it does?

  5. Finally, when it’s all working, I’d like to display an array of widgets in a corner of the screen as a Windows Gadget or similar. Basic requirements are that it starts upon Windows login in the correct screen position, is reasonably robust, e.g. continues by itself after a network outage, never requires re-entry of a password, and does not waste any screen real estate on Windows UI elements, browser UI elements, or Cayenne UI elements, i.e. only the widgets appear. Has anyone implemented such a display?

Thanks for taking the time to read my long tale of woe. Any suggestions will be gratefully appreciated.


Hi @Stewart, welcome to the Cayenne Community.

Thank you for your questions and feedback, and let me apologize that you spun your wheels trying to find this out when I have a pretty quick answer for most of this.

For 1 through 4 (and part of 6), we’ve been building the platform iteratively over the last year. We started with Raspberry Pi, then added Arduino support, then recently released LoRa support and the MQTT API that you’re asking about. One of the consequences of this is that we go through periods where these groupings have partial feature support, and that’s the case with MQTT-added devices/widgets at the moment. There may be some other limitation that I’m not thinking of at the moment, but you’ve hit on the big two: right now our mobile apps don’t have MQTT (or LoRa) support, and our widget historical data graphs on the web dashboard aren’t configured for MQTT/LoRa devices either.

So the short answer is that these weren’t working because they are still in development, but they should both see improvement in Q1 of this year, so it will get better soon!

For #5, we’re not aware of any specific incompatibility with common Pi software like those you mentioned, but of full disclosure I would say to consider that for as amazing as Raspberry Pi’s are (and they are amazing, they cream any PC I had in college in the late 90’s let alone what I had as a kid :slight_smile: ), they are still resource constrained in a modern context, and we specifically have a few resource usage bugs to work out with our Raspberry Pi agent software after many hours of uptime. All of that said, I would still encourage you to try it out on an ‘occupied’ Pi so long as its not running anything mission critical. You can always uninstall our agent software with just two terminal commands.

On #6, you could absolutely pass data from a PC or Mac (really, any OS) to Cayenne via the MQTT API and view/interact with it in the web browser dashboard at But the widgets created from that data will still not appear on the mobile apps or with graph history until we fully support these for MQTT-added data.

For the last question, I can tell you that while right now Cayenne is primarily focused around getting data into the dashboard by various means and viewing/manipulating it there, we are planning to add HTTP and Webhook API functionality later this year. This should be a big help in building an application/web view that displays data from Cayenne outside of the ‘containers’ that are the Cayenne dashboard/mobile apps.

Wow, many thanks for the prompt and comprehensive reply.

So, I’m left with one new question: Is there a good way within the present fully functional RPi + mobile app setup, to take data from an external source and get it into Cayenne? A separate process would obtain the data (usually from the network or USB) and somehow make it look like a supported device. I’d like not to resort to kludges like having the source process control an analog output, connected to an analog input that is read by Cayenne, or tying two GPIOs together so the source process could emulate a DS18B20, or …




This is probably the #1 request I’ve made to the development team and I would hope it is still a high priority on the backlog after the other high priorities features are developed :wink:

What we discussed is a generic file i/o widget that would read a file on your Pi and display that data on the dashboard. This way, you could simply create a cron job to get your user data into file, and done.

Also want it to work the other way, where switch or slider data from the dashboard ends up in a file for your local scripts to process and make decisions on.

It is possible to do all this with MQTT on the Pi, but as @rob mentioned, historical viewing is not implemented for MQTT yet.

There are ways to create drivers to work with the native Cayenne framework, but I’ve looked at this, and the process is not for the faint of heart. It would take many stiff drinks and bruised knuckles, and really the whole point of Cayenne is to keep the scary bits away from users and bring IoT to the Everyman.

All in good time.