Need recap

Bonjour a tous, Hi all !

I need some recap… I don’t use rpi and cayenne since two years…

So, first i plug a switch on my rpi, GND to GND, VCC to 5 V and IN to GPIO 13.

I can turn on/off by cliking on GPIO dashboard ( in/out ), but switch don’t work on overview dashboard.

I think i don’t choose good chanel ( i choose 13 ). But when i add widget it work one time, when i clik create and after nothing…

I hope it’s clear ^^ next time i think i will use translator ^^

Thanks all :slight_smile:

You should connect to 3.3V not 5v. Next did you use a resistor for GPIO 13?
Have a look at this

Hi !

Thank you for your answer, but I think I mis explained.

When I save the widget the relay activates. But when I want to untap with the dashboard button it does not work. But if I disable it in the GPIO part of the dasboard it works.

Could you give me the correspondence of each GPIO with the “channel” when you add an actuator.

Thank you :slight_smile:

Salut !

Merci pour ta reponse, mais je pense que je me suis mal expliqué.

Quand j’enregistre le widget le relais s’active. Mais quand je veux le descatvier avec le bouton du dashboard ca ne fonctionne pas. Mais si je le desactive dans la partie GPIO du dasboard ca fonctionne.

Pourrais tu me donner la correspondance de chaque GPIO avec les “channel” lorcequ’on ajoute un actionneur.

Merci :slight_smile:

I 'm talking about relay not switch… Sry

i did not understand what you mean by this.

It’s just a unique ID to identify a sensor/actuator device. Similar to a channel number, but using a string instead. you can info about it in /etc/myDevices/devices.json

So first i create widget, i chose relay, i put name of relay i chose GPIO ect…

After this, i save widget. When i click save widget ( or something like this) relay do “click” so it work, When i go GPIO tab i can operate relay. But on dashboard when i click on buton, nothink.

you can turn ON/OFF relay from the GPIO tab but not using the button from the dashboard.
If so you might have selected the wrong channel while adding the relay button. Delete the button and add a new one with correct channel selected.

ok, but i can’t find equivalent on GPIO and channel. Example : For GPIO 21 wich channel i have to select when i create widget ?

Maybe you have table with corespondence ?

Thank for you interest, and sorry if i’m not clear i don’t use english often…

GPIO number is the same as channel number. For GPIO 21, you have to select channel 21.

Ok, but there’s 40 pin and only 26 channel for other pin it’s other categorie of widget ?

And last one, communication between RasPi and windows or phone with cayenne is so slow, it’s normal you think ?
Or maybe some settings ?

Always the same problem :

  • I plug my relay (GND VCC and IN on GPIO 21.

  • I create the widget / devices on the dashboard, I put a name, I choose the devices (raspberry PI MQTT) I choose GPIO integrated, I choose the widget and I validate.

  • when I validate the relay activates. When I want the deactivated (with the button) nothing happens. I can not control it. But in the GPIO panel I can activate and deactivate the relay by selecting out / in.

And temperature sensor work on one wire pin, so i think communication between cayenne and RasPi work

it is excluding power GND and other special function pins.

what time frame do you want?

which channel have you used?

I use channel 21 with GPIO 21 and i test with channel 13 and GPIO 13 it’s same problem

if you have connected the relay to GPIO 21 and the channel 21, then run this command:

tail -f /var/log/myDevices/cayenne.log | grep sys:gpio:21;value

if 13 then change the 21 to 13 in the above line.

Change the state of the button and see the output in the terminal.

After 20 secondes it say this :

2019-05-30 20:48:08 - myDevices - INFO - Send changed data: [{‘sys:cpu;load’: 2.8}, {‘sys:cpu;temp’: 43.47}, {‘sys:ram;usage’: 482017280}, {‘sys:storage:/;usage’: 5897928704}, {‘dev:MnnqytMs0qDxKHu’: 1}, {‘sys:gpio:21;value’: 1}]

do many times it say this :

2019-05-30 20:48:08 - myDevices - INFO - Send changed data: [{‘sys:cpu;load’: 2.8}, {‘sys:cpu;temp’: 43.47}, {‘sys:ram;usage’: 482017280}, {‘sys:storage:/;usage’: 5897928704}, {‘dev:MnnqytMs0qDxKHu’: 1}, {‘sys:gpio:21;value’: 1}]
2019-05-30 20:50:20 - myDevices - INFO - OnMessage: {‘suffix’: ‘value’, ‘channel’: ‘sys:gpio:21’, ‘payload’: ‘0’, ‘cmdId’: ‘GoGDt7oMHKsKJ1I’}
2019-05-30 20:50:20 - myDevices - INFO - ExecuteMessage: {‘suffix’: ‘value’, ‘channel’: ‘sys:gpio:21’, ‘payload’: ‘0’, ‘cmdId’: ‘GoGDt7oMHKsKJ1I’}
2019-05-30 20:50:23 - myDevices - INFO - Send changed data: [{‘sys:cpu;load’: 1.5}, {‘sys:cpu;temp’: 47.236}, {‘sys:ram;usage’: 536678400}, {‘sys:storage:/;usage’: 5898358784}, {‘dev:MnnqytMs0qDxKHu’: 0}, {‘sys:gpio:21;value’: 0}]
2019-05-30 20:50:24 - myDevices - INFO - OnMessage: {‘suffix’: ‘value’, ‘channel’: ‘sys:gpio:21’, ‘payload’: ‘1’, ‘cmdId’: ‘5MCoJIHw0HLoKKy’}
2019-05-30 20:50:24 - myDevices - INFO - ExecuteMessage: {‘suffix’: ‘value’, ‘channel’: ‘sys:gpio:21’, ‘payload’: ‘1’, ‘cmdId’: ‘5MCoJIHw0HLoKKy’}
2019-05-30 20:50:41 - myDevices - INFO - OnMessage: {‘suffix’: ‘function’, ‘channel’: ‘sys:gpio:21’, ‘payload’: ‘IN’, ‘cmdId’: ‘KpF4FwxswoHDprq’}
2019-05-30 20:50:41 - myDevices - INFO - ExecuteMessage: {‘suffix’: ‘function’, ‘channel’: ‘sys:gpio:21’, ‘payload’: ‘IN’, ‘cmdId’: ‘KpF4FwxswoHDprq’}
2019-05-30 20:50:42 - myDevices - INFO - OnMessage: {‘suffix’: ‘function’, ‘channel’: ‘sys:gpio:21’, ‘payload’: ‘OUT’, ‘cmdId’: ‘JqvsrrnsxpsIJIz’}
2019-05-30 20:50:42 - myDevices - INFO - ExecuteMessage: {‘suffix’: ‘function’, ‘channel’: ‘sys:gpio:21’, ‘payload’: ‘OUT’, ‘cmdId’: ‘JqvsrrnsxpsIJIz’}
2019-05-30 20:50:42 - myDevices - INFO - Send changed data: [{‘sys:gpio:21;value’: 0}]
2019-05-30 20:50:44 - myDevices - INFO - OnMessage: {‘suffix’: ‘function’, ‘channel’: ‘sys:gpio:21’, ‘payload’: ‘IN’, ‘cmdId’: ‘JvwFxIJHnKtIHG5’}
2019-05-30 20:50:44 - myDevices - INFO - ExecuteMessage: {‘suffix’: ‘function’, ‘channel’: ‘sys:gpio:21’, ‘payload’: ‘IN’, ‘cmdId’: ‘JvwFxIJHnKtIHG5’}
2019-05-30 20:50:44 - myDevices - INFO - Send changed data: [{‘sys:gpio:21;value’: 1}]
2019-05-30 20:50:53 - myDevices - INFO - Send changed data: [{‘sys:cpu;load’: 2.3}, {‘sys:cpu;temp’: 45.622}, {‘sys:ram;usage’: 522252288}, {‘sys:storage:/;usage’: 5898371072}, {‘sys:gpio:21;function’: ‘IN’}]

But relay don’t do nothink except if i change in/out in gpio table

if i use wiringpi with gpio readall, PIN 21 is all time IN even if my relay is open or close ( activate by gpio table on cayenne )

as seen in the logs, you are receiving the change in state of the GPIO 21. that mens it should work. Though not sure why it is not working for you.
Is there any sensor connected to your pi and you need the data history? if not, can you delete the device and re-add a new one.
Once the installation is done, in your terminal add tail -f /var/log/myDevices/cayenne.log for the logs to keep on loading.
Next, add a new relay button and check the logs if you see any error message produced.

it’s so strange because with GPIO panel it switch instentaly… I will try your solutions

i’ve try to delete and re add device, nothing better…

it’s totally crazy, if I plug my GPIO 21 on the VCC relay when I activate or deactivate the red LED relay turns on and off. So the fate works. But when I put it on the “IN” relay nothing happens. Unless it is enabled with the GPIO pannel …

It’s crazy

So it’s me i’m stupid… I plug relay with 5 Volt and here’s problem… Now it work !

So sorry for loose your time !