I am using Pi4J to connect to the Relay with the below java code but the current does not flow from COM port to the NO port. The red led on the Relay port does turn on.
I even tried to check if the device_tree exists in /boot/config.txt but it doesn't exist. (As specified in one of the forum topic viewtopic.php?f=28&t=104076). I am banging my head on this since a week now.
Am I missing something? Could it be that my relay is faulty?
Code: Select all
pin = gpioController.provisionDigitalOutputPin(RaspiPin.GPIO_00, "light", PinState.LOW);
pin.toggle();
Code: Select all
gpio readall
+-----+-----+---------+------+---+--B Plus--+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| 17 | 0 | GPIO. 0 | OUT | 0 | 11 || 12 | 0 | IN | GPIO. 1 | 1 | 18 |
| 17 | 0 | GPIO. 0 | OUT | 1 | 11 || 12 | 0 | IN | GPIO. 1 | 1 | 18 |