I am new to this app. I figured out how to turn on and off a LED but now I would like to control a servo motor. I realize that it doesn’t work just to add a servo as an actuator for some reason. I guess I could have it work as a light switch actuator but idk how to make that work.
Long story short, how can I control a servo with cayenne

1 Like

which device are you using raspberry pi (with cayenne pi agent) or arduino ?

Raspberry pi 3

there are two ways to do this:

  1. Add a pca9685 plugin to your cayenne pi agent and then modify the plugin code to work with servo motor. GitHub - myDevicesIoT/cayenne-plugin-pca9685: A PCA9685 plugin for Cayenne
  2. Use adafruit servo example code and add the cayenne python example code Cayenne-MQTT-Python/examples at master · myDevicesIoT/Cayenne-MQTT-Python · GitHub. this is much easier as just combine the two examples.

do i really need to add pca9685 to my hardware components to run a servo? or can i just use a mqqt? thanks

this two will make you understand the difference between them.

im sorry im just a beginner, but i really need to connect my two servo motor, 2 lights and a camera is this possible using cayenne? thank you so much and im using a raspberry pi 3b

yes, it is possible with cayenne. But you need PCA9685 extension board to connect it to pi.

thank you helps a lot


Im sorry but may i ask how can i put a camera on my cayenne im using the raspberry pi camera thank you

do you want to show the raspberry pi camera video on the cayenne dashborad (which is not possible) or do you want to capture an image when a button is pressed on the cayenne dashboard have a look at this Take picture when motion with Pi 3 and Agent 2.0 CayenneMQTTClient() and notify by email - how to trigger a script on Pi 3

I need a button on my cayenne dashboard that can access the camera on my raspberry pi. Is it even possible?

isnt, this what you want?

I think it only shows the capture image if motion is detected
But i need a live video status of my camera. Is it possible?

are you familiar with python? you will have to modify the code to take photo.

Can you give me some configuration thank you so much

this library to connect to cayenne GitHub - myDevicesIoT/Cayenne-MQTT-Python: Python Library for Cayenne MQTT API and this for raspberry pi camera picamera — Picamera 1.13 Documentation. you need to combine both the code.

Thank you for the help i will follow everything you told me.

Hi how am i going to add the cayenne example code to the

in the cayenne code, first read the position of the slider and set the servo position depending on the value.

def on_message(message):
    print("message received: " + str(message))
    if ( == 4) and (message.value == "0"):
            pwm.set_pwm(0, 0, servo_min)
    if ( == 4) and (message.value == "1"):
            pwm.set_pwm(0, 0, servo_max)