Unreachable [fixed: issue was with the relays]

Hi to all,
Im using Pi 3 model B, with raspbian (Jessy) version 8, Build Debian.
The dashboard that im using are Web and iOS.
The problem is that I can add devices (relays and probes), but they don’t apear in the iOS. The web dashboard show me the sensors and actuators, but I can’t interact with them, they show the message “unreachable”
could anyone help me with this?
Thank you very much

Hello and Welcome to Cayenne Community.
I would suggest you to test some of the following things:

  1. Can you check your Kernel version with the following command: uname -a
  2. Can you check your internet connection
  3. Can you check port 8181 if is open?

Thank you.

1 Like

I downgrade to 4.4. The problem is solved.
Now I have a new problem, the relay dont work

You may want to delete and re-create the widget if you’re still using the one that was created while you were running the 4.9 kernel. I’m not 100% sure if this is necessarily, but just to create a clean baseline for further testing.

1 Like

Or you can restart the dashboard :wink: I suggest this operation. The last time that my RPI was updated to 4.9 Kernel, after downgrade I had to restart the dashboard :slight_smile:

1 Like

I have try both options…many times… but dint work ¿any suggestion?

Does the relay work outside of Cayenne (if you test it with something like a Python script)? Just to take Cayenne out of the problem for a minute a verify we don’t have any wiring or hardware issues.

1 Like

I have tried to do it with python poer I did not know how to do it (I followed the instructions of the video but something I should have done wrong).
Then I tried with the command line the following:
sudo -i
echo “5” > /sys/class/gpio/export
echo “out” > /sys/class/gpio/gpio5/direction
echo “1” > /sys/class/gpio/gpio5/value
But didn’t work…

I get it to open and close the relay changed the pin from input to output from cayenne.

Is it work now ?

No yet…

How can I help you ?

I dont now khow I must continiu… the raspberry dont change the state of the pins. Only when i change the output into inputs, a can open and close the relays

I tried the script I originally linked and had trouble with it too, maybe there was something I was missing with it, or I linked something no good.

This one, on the other hand, worked great as a test of my wiring and relay, so I could verify that the circuit worked outside of Cayenne. It will prompt you for a number of cycles and a cycle length, and then turn the GPIO on and off in a loop.

In this case I have my relay with an LED wired to Pin 23, but you can change it to whatever pin you’d like. If it still doesn’t work, maybe let me know the pin/try a different one? I know there are some special reserved ones on the Pi and maybe that’s what is causing you trouble.

import RPi.GPIO as GPIO ## Import GPIO Library
import time ## Import 'time' library.  Allows us to use 'sleep'

GPIO.setmode(GPIO.BCM) ## Use BCM pin numbering
GPIO.setup(23, GPIO.OUT) ## Setup GPIO pin 23 to OUT

## Define function named Blink()
def Blink(numTimes, speed):
    for i in range(0,numTimes): ## Run loop numTimes
        print "Iteration " + str(i+1) ##Print current loop
        GPIO.output(23, True) ## Turn on GPIO pin 23
        time.sleep(speed) ## Wait
        GPIO.output(23, False) ## Switch off GPIO pin 23
        time.sleep(speed) ## Wait
    print "Done" ## When loop is complete, print "Done"
    GPIO.cleanup()

## Prompt user for input
iterations = raw_input("Enter the total number of times to blink: ")
speed = raw_input("Enter the length of each blink in seconds: ")

## Start Blink() function. Convert user input from strings to numeric data types and pass to Blink$
Blink(int(iterations),float(speed))
1 Like

Can you send me the code that does not work on PM ?

This is what happened:

It’s really hard to tell what your wiring is hooked up to, but if I had to guess you aren’t hooked up to pin 23. Can you take a picture of the wiring?

Im sure its the 23
[image1.JPG]

That’s the wrong pin. While that is “GPIO pin 23” it’s not pin 23. @rsiegel is using board numbering in the python script so you’ll need to move the red wire to physical pin 23. I take that back, the comment is wrong. GPIO.setmode(GPIO.BCM) is GPIO numbering, so it should be correct. So, next question, what at those wires hooked to on the relay?

1 Like

And here the relay

[image1.JPG]