Regarding SPI from NodeMCU to Arduino during MQTT Transmission

Hello, so i am receiving data vis MQTT on Nodemcu. I want to send that data to LCD Screen connected to arduino. The arduino is connected to Nodemcu and i am using SPI to send data. Nodemcu is master and arduino is slave. But my code doesnt seem to work. Can someone help me out as tomorrow is my deadline for IOT Project.

CODE:

#include<SPI.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>

const char* ssid = "Kunal";
const char* password =  "asdsad";
const char* mqttServer = "m14.cloudmqtt.com";
const int mqttPort = bla;
const char* mqttUser = "bla";
const char* mqttPassword = bla";

WiFiClient espClient;
PubSubClient client(espClient);

char buff[] = "Hello slave\n";

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived in topic: ");
  Serial.println(topic);
  Serial.print("Message:");
  for (int i = 0; i < length; i++) {
    buff[i] = (char)payload[i];
    SPI.transfer((char)payload[i]);
    Serial.print((char)payload[i]);
  }
  Serial.println();
  Serial.println("-----------------------");
 
}

void setup() {
  Serial.begin(9600);
  SPI.begin();  /* begin SPI */
  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.println("Connecting to WiFi..");
  }
  Serial.println("Connected to the WiFi network");
 
  client.setServer(mqttServer, mqttPort);
  client.setCallback(callback);
 
  while (!client.connected()) {
    Serial.println("Connecting to MQTT...");
 
    if (client.connect("ESP8266Client", mqttUser, mqttPassword )) {
 
      Serial.println("connected");  
 
    } else {
 
      Serial.print("failed with state ");
      Serial.print(client.state());
      delay(2000);
 
    }
  }
  client.publish("esp/test", "Hello from ESP8266");
  client.subscribe("esp/test");
 //Serial.begin(9600); /* begin serial with 9600 baud */
}

void loop() {
  client.loop();
}

Nodemcu is master and arduino is slave.

I doubt that this is the case. Why do you think that the master-slave relation is that way around?

But my code doesnt seem to work.

That's a description like "the Internet does not work". We don't know more now than that you have some problems but we have no clue what these problems are.

That code does provide some serial output. Post the output you get!

The code you posted doesn't control a display so you might have to post some more code that does that.

the SPI Master and Slave examples communication works on your setup?

Yes, it does. I ran the following example: NodeMCU SPI with Arduino IDE | NodeMCU

ok, the instead of "Hello slave" send the data you want to show on the LCD and in arduino receive them and print to lcd