Missing Connectivity option


#1

Hello!

In the Cayenne dashboard no Connectivity options:
• Digital,
• Analog.
only one is offered – Virtual.

Why do not I see these options?
Help please find out.
Thank you.


#2

this is because of the new cayenne MQTT version. you need to use virtual channel for communication between cayenne and your device and then code it to use it in digital or analog as you want.
example code:

CAYENNE_IN(1)
{
  if (getValue.asInt() == 0) {
    digitalWrite(2, HIGH);
  }
  else {
    digitalWrite(2, LOW);
  }
}

where CAYENNE_IN(1) : 1 is the virtual channel you have to select in the widget setting on the dashboard


#3

Does this mean that the new Cayenne MQTT version does not have the ability to add widget or device without writing code, as shown in the record “Introduction to Cayenne”.?


#4

I’m not sure what you mean, for Arduino devices you were always required to provide the code to send the data to Cayenne. Were you able to figure it out?


#5

@adam he is talking about adding a generic digital output without any code. @ramunas1 it very easy now . When you want to add a digital button to turn on/off led you have to do the following:
Add a digital output widget and select channel as 2.
Now in the code to connect add the following lines of code:

CAYENNE_IN(2)
   {
    int x = getValue.asInt ();
    digitalWrite (led_pin, x);
   }

So the CAYENNE_IN function is used to read actuator command and it is stored in X which is written to led_pin.


#6

Ah, yes I actually forgot about that.