Hi, I’ve changed my project to be compatible with MQTT as per Cayenne’s advise. I use the Arduino to control the blinds at home and it’s working OK. After changing I am experiencing some strange things and I believe it’s a bug.
I use channels 2 to 7. It’s pretty simple, a Custom Widget button, 0/1 to control the relay. After executing the command, pin goes to 1, I want to reset the pin to 0 so I use a trigger: if pin 2 is 1 then set pin 0.
If works for channels 4, 5, 6 & 7 but not for channels 2 & 3. It does execute the command but its does not reset to 0. All the channels are exactly the same and these 2 do not reset, I have to do it manually by clicking again on the icon.
Any idea of why this is happening ? With the “old” code it was working.
Hi, this is very strange. When I was using a Raspberry, after setting a GPIO to High I had to reset it to low and I did it by using a trigger (IF GPIOX → High than GPIOX-> Low). I swapped to Arduino and I tought I had to do the same thing. It seems that, with the MQTT library I do not need to reset the GPIOX. It does that by itself. Great but the symbol in the interface does not reset to Off, it stays lit. Well, by triggering the same way I was able to unlit the desktop symbol. This does not work for channels 2 & 3.
OK, let’s use channels 8 & 9. 10 & 11. 12 & 13. Channels 8 & 9 are @ 1,45V; 10 & 11 @ 5V; 12 @ changing between 2.2V and 2.7V; 13 @ 0V. I cannot use these channels. Are these the values they should present ? I am using shield 5100.
To create the action I use Custom Widget Button, Digital Actuator, Digital 0/1, Channel X, Icon Motor, Add widget. No code.
it is a bit confusing from the above detail you gave . so can you give points wise answers. so i can understand better your problem and help you out.
1)what is your project about.
2)can you post the code.
3)hardware you have used.
4)what problem you are facing
5)dashboard screenshot
6)trigger screenshot.
1)what is your project about - controlling blinds by activating the remote control. The transition to HIGH on the Arduino acts if you push the blind remote control button
2)can you post the code - there is no code. Which code do you mean ? I am using the Button Custom Widget as described before
3)hardware you have used - Arduino Uno with shield 5100
4)what problem you are facing - described earlier but the icon in the desktop does not reset to Unlit. It does not go OFF on channels 2 & 3 but is does on all the others
OK, I created a second device with another Arduino, created the widgets and then the Triggers. Now the icon is reset.
I also see the device is creating a Widget for channel 0. I delete it and it appears, again and again. Maybe another bug ?
BUT, the GPIO do not change state meaning I cannot control the blinds. As a precaution I did not delete the former device, I just added a new one. When I control the blinds with the old one, they work fine. With the new device, they don’t work. I started all over again and I got the same result.
I deleted all the triggers in the old one and created new ones. The same, in 4 of teh channels it does reset the icon. In 2 of them, it doesn’t.
I installed the code exactly as I did before. Any ideas ?
Its not a bug, mqtt adds channels automaticly based on the code.
You probably have CAYENNE_IN_DEFAULT somwhere in the code, and i think that is causing the problem.
CAYENNE_IN_DEFAULT maps pins according to hardware hardware pin 0 virtual pin 0, hardware pin 1 virtual pin 1 etc.
Since pins 2 and 3 are Interupt pins on arduino board maybe they cause the problem.
Delete CAYENNE_IN_DEFAULT part of the code and use CAYENNE_IN(1) CAYENNE_IN(2) etc. for every arduino pin you have actuator connected to. You can find code in mqtt exmples.