Issues adding mcp3008 to cayenne dashboard

I am working on a project where I am using a MCP3008 to read analog values from a piezo vibration sensor. I have watched the video on how to connect the mcp3008 to the raspberry pi and setup everything including turning on the SPI, I2C, and remote GPIO access on my pi and connected the pi to the cayenne dashboard. However, after downloading what seemed to be the correct files for the adafruit mcp3008 for the pi, I cannot get the cayenne dashboard to allow me to add the MCP3008 to my raspberry pi dashboard. I get the red circle with a cross through it not even allowing me to add it at all. Sorry if this is a mess of words but I have no idea where to begin looking for the problem. I have tried so many tutorials and looked through so many forums but it seems like I cant find the solution to my problem so I was wondering if anyone had any idea what I should try or what could be the problem. I am attaching some pictures of my setup and what I have enabled/disabled and if someone sees something wrong please let me know.

Also, if I go to my settings for my device it does not allow me to configure the SPI or I2C from the dashboard, if I enable SPI or I2C it asks if I want to reboot, but when I click yes, it does not actually change anything or even reboot the PI.

at this point I am not sure if I dont have a hardware issue or something else. It is not a power issue because I have some MCP code that checks my voltage on my sensor and everything and it shows 3.26 volts like normal. Extremely confused at this point because the tutorials seem so clear and straight forward, yet I cannot seem to get it to work.

you have two option:-

  1. Use plugin:-
    GitHub - myDevicesIoT/cayenne-plugin-mcp3xxx: An MCP3XXX extension plugin for Cayenne

  2. Use the cayenne python library to send data.
    GitHub - myDevicesIoT/Cayenne-MQTT-Python: Python Library for Cayenne MQTT API

I would suggest 2nd option.

So I did the 2nd option and I was able to successfully establish a connection to the dashboard. However, now I am confused as to how I am suppose to implement the analog converter And also send that data that the analog converter is receiving to the dashboard. From what I can tell, the tutorial doesn’t show anything about analog signals, it’s only about establishing a connection and something else about voltage and a Celsius reading but it’s not very explanatory. Do you have any links for how to do this exact same thing but to only send a analog data reading to the dashboard ?

The example is quite clear. You need to use client.virtualWrite(channel, data) to send data to cayenne. Where the channel is the MQTT channel and data is the data of the MPC3008 you need to send.

1 Like

So I understand that, but I’m assuming this means I need to write the code that makes the data from the sensor and then put that variable in the sensor data section? I don’t personally see where the code has a part that is looking for any sensor data, sorry if I sound dumb here, I’m not very good at reading python code coming from a Visual Basic background

you mentioned you have the code.

I do, I just wanted to make sure that I have to input my code in to the GitHub code and that I was not going to mess anything up by inputting it in

yes. you need to combine MCP and cayenne code together. So the sensor reading from MCP is sent to cayenne.

Okay this makes sense. Thank you! So everywhere sensor_value is, I just need to replace with the variable I declared as my MCP data value?

Nevermind I got it to work

Hello, I seem to have the same problem as you did. How did you resolve the issue? I am quite new to Python in general so I don’t quite understand the code in the link

Which parts don’t you understand?