RPi2, mqtt, arduino and relays, cant bind them together

Hello, i have some issues with my setup.

I run OpenHAB and mosqitto on Raspberry PI 2 with OSMC (debian).

I try to controll a 4 channel relay that is connected to Aarduino Nano.

I use nrf24l01 tranceivers on the RPI2 and Nano.

I have got the 2 units to talk to eachother with a ping-pong tutorial.
I have also made the relay switch on every channel so the problem is not with the hardware (not from MQTT command but with a “local” sketch uploaded to the Nano).

In openHab i have made a binding so that it sends MQTT commands to the Mosquitto broker and i can see that the commands is getting to the broker.

But now im stuck, does anyone have a link or tips on how to set up the sketch on the Nano to receive and execute commands from the broker?

Hello Tore,

I guess this might be more of a question for an Arduino forum, but this link helped me once make an Arduino MQTT broker for a friend:

1 Like