Can I control devices using raspberry pi and relay board

I have installed openhab2 on my raspberrypi 3 and connected GPIO Pins to relay board, Can I control appliances? But its not working! Does I need ESP8266 Module to control relays? If it is please give me code for ESP8266 to control devices using OPENHAB2.Thank you

I have used the exec binding to control RPI relay boards - e.g.

Switch REl1 “Relay 1” (Kitchen,DO3) {exec=">[ON:python /opt/relay/relay.py 1 ON] >[OFF:python /opt/relay/relay.py 1 OFF]"}

see https://github.com/openhab/openhab1-addons/wiki/Exec-Binding

I’m no longer using the relay board, as I have separated the RPI from the IO, but had it working reliably a year or so ago