Arduino MKR1000, sending beer temperature disconnects after a few hours

Hi community

I’m using Blynk to monitor and log fermentation temperature.
The hardware is:

The MAX31865 sends temperature data via SPI to the Arduino MKR1000 which in turn sends it to Blynk.

The Blynk app is set to show the value on V5, this works well.

The error happens after a few hours of running. The device is disconnected from the app and the MKR1000 is blinking yellow/orange.

It seems that the time before the MKR1000 disconnects increases with a larger timer interval so I suspect this may be the cause of the issue, but I have not been able to determine what I’m doing wrong.

The sketch on the MKR1000:

#define BLYNK_PRINT SerialUSB

#include <SPI.h>
#include <WiFi101.h>
#include <BlynkSimpleMKR1000.h>
#include <Adafruit_MAX31865.h>

float Data;

//software SPI: CS, DI, DO, CLK
Adafruit_MAX31865 max = Adafruit_MAX31865(10, 11, 12, 13);

// The value of the Rref resistor. 430 Ohm on PT100 (from datasheet)
#define RREF      430.0
// 100.0 for PT100, 1000.0 for PT1000
#define RNOMINAL  100.0

char auth[] = "XXXX";
char ssid[] = "XXXX";
char pass[] = "XXXX";

BlynkTimer timer;

void setup()
  Blynk.begin(auth, ssid, pass);
  max.begin(MAX31865_3WIRE);  // 3Wire for 3 wire probe. 4Wire for 4 wire probe...
  timer.setInterval(5000L, myTimerEvent);

void loop()
//  uint16_t rtd = max.readRTD(); //
//  float ratio = rtd;            //  
//  ratio /= 32768;               //;; 

void myTimerEvent()
  Data = max.temperature(RNOMINAL, RREF);
  Blynk.virtualWrite(V5, Data);

I would deeply appeciate any help my beer is at stake here :slight_smile: