Unable to combine SPI radio and i2c sensor in same code


I am using an Adafruit RFM69HCW to received messages from a remote sensor (which works fine).
Also a local SHT35D board from closedcube (this also works fine).
Everything works until i combine the 2 devices, the only thing that is shared between them is voltage and ground together with the Arduino MKR1010 Wifi.
My suspicion is that the libraries from each of the devices are incompatible but i am clueless at this point.

PIN 11 & 12 are to the sensor
PIN 5,6,7,8,9,10 are to the radio

This is the Radiohead fork for the adafruit radio: GitHub - adafruit/RadioHead: A github'ified version of http://www.airspayce.com/mikem/arduino/RadioHead/
Here is the library for the SHT sensor: GitHub - closedcube/ClosedCube_SHT31D_Arduino: Arduino library for ClosedCube SHT31-D (SHT30-D, SHT35-D) Digital Humidity & Temperature Sensor breakout board

Here is my code:

#include <SPI.h>
#include <RH_RF69.h>
#include <WiFiNINA.h>
#include <ClosedCube_SHT31D.h>
#include <Wire.h>

#define SECRET_SSID "xxxx"
#define SECRET_PASS "xxxx"

// wifi setup
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;
int status = WL_IDLE_STATUS;

WiFiClient client;

ClosedCube_SHT31D sht3xd;

/************ Radio Setup ***************/

// Change to 434.0 or other frequency, must match RX's freq!
#define RF69_FREQ 868.0
#define RFM69_INT     7
#define RFM69_CS      6
#define RFM69_RST     5
#define LED           13
#define TX_POWER      20

// Singleton instance of the radio driver
RH_RF69 rf69(RFM69_CS, RFM69_INT);

void setup() 
  while (!Serial) { delay(1); } // wait until serial console is open, remove if not tethered to computer

  sht3xd.begin(0x45); //sht address

    Serial.println("[ERROR] Cannot start sht-31d periodic mode");

  // rf69 manual reset
  pinMode(RFM69_RST, OUTPUT);
  digitalWrite(RFM69_RST, LOW);
  digitalWrite(RFM69_RST, HIGH);
  digitalWrite(RFM69_RST, LOW);
  if (!rf69.init()) {
    Serial.println("RFM69 radio init failed");
    while (1);
  Serial.println("RFM69 radio init OK!");
  if (!rf69.setFrequency(RF69_FREQ)) {
    Serial.println("setFrequency failed");

  rf69.setTxPower(14, true);  // range from 14-20 for power, 2nd arg must be true for 69HCW

  // The encryption key has to be the same as the one in the server
  uint8_t key[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
  Serial.print("RFM69 radio @");  Serial.print((int)RF69_FREQ);  Serial.println(" MHz");

  //check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);

  // attempt to connect to Wifi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:

  // you're connected now, so print out the data:
  Serial.print("You're connected to the network");

void loop() {

 //char postdata[100];
 int siteid = 1;
 if (rf69.available()) {
    printResult("Periodic Mode", sht3xd.periodicFetchData());
    // Should be a message for us now   
    uint8_t buf[RH_RF69_MAX_MESSAGE_LEN];
    uint8_t len = sizeof(buf);
    if (rf69.recv(buf, &len)) {
      if (!len) return;
      buf[len] = 0;

      Serial.print("Received [");
      Serial.print("]: ");
      Serial.print("RSSI: ");
      Serial.println(rf69.lastRssi(), DEC);



} //end void loop

void printWifiData() {
  // print your board's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");

  // print your MAC address:
  byte mac[6];
  Serial.print("MAC address: ");

void printCurrentNet() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");

  // print the MAC address of the router you're attached to:
  byte bssid[6];
  Serial.print("BSSID: ");

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");

  // print the encryption type:
  byte encryption = WiFi.encryptionType();
  Serial.print("Encryption Type:");
  Serial.println(encryption, HEX);

void printMacAddress(byte mac[]) {
  for (int i = 5; i >= 0; i--) {
    if (mac[i] < 16) {
    Serial.print(mac[i], HEX);
    if (i > 0) {

void printResult(String text, SHT31D result) {
  if (result.error == SHT3XD_NO_ERROR) {
    Serial.print(": T=");
    Serial.print("C, RH=");
  } else {
    Serial.print(": [ERROR] Code #");

I'd suggest asking on the Adafruit forum.

I now have asked the same question there.
Although this is still a programming question, and not all the sensors are from adafruit.