Hi all,
I’m trying to control a 4channel relay using an arduino micro plus an adafruit cc3000 wifi module, but it keeps on crashing every minute or so!
using serial debug:
[121876] LED1: off
[121877] LED1: on
[121878] LED1: off
[133393] Sent 65535/5
[133395] Connecting to 45.55.195.102:8442
[190716] Connecting to 45.55.195.102:8442
and sometimes it goes heartbeat timeout
and on the app it says that arduino pro micro goes offline.
i’ve updated the adafruit cc3000 to the latest firmware v1.14
and i’ve tried a local-server setup with and without serial debug, but exactly with the same result. any thing with the code?
and here is a sample code (the same result if i try with only 1x relay or npn (tried both):
#define NPN1_PIN 6
#define NPN2_PIN 9
#define NPN3_PIN 11
#define NPN4_PIN 12
void setup()
{
pinMode(NPN1_PIN, OUTPUT);
pinMode(NPN2_PIN, OUTPUT);
pinMode(NPN3_PIN, OUTPUT);
pinMode(NPN4_PIN, OUTPUT);
}
// Enable/disable relay using virt pin 1
BLYNK_WRITE(1)
{
if (param[0].asInt()) {
digitalWrite(NPN1_PIN, HIGH);
//BLYNK_LOG("NPN1: on");
} else {
digitalWrite(NPN1_PIN, LOW);
// BLYNK_LOG("NPN1: off");
}
}
// Enable/disable relay using virt pin 2
BLYNK_WRITE(2)
{
if (param[0].asInt()) {
digitalWrite(NPN2_PIN, HIGH);
//BLYNK_LOG("NPN2: on");
} else {
digitalWrite(NPN2_PIN, LOW);
// BLYNK_LOG("NPN2: off");
}
}
// Enable/disable relay using virt pin 3
BLYNK_WRITE(3)
{
if (param[0].asInt()) {
digitalWrite(NPN3_PIN, HIGH);
// BLYNK_LOG("NPN3: on");
} else {
digitalWrite(NPN3_PIN, LOW);
// BLYNK_LOG("NPN3: off");
}
}
// Enable/disable relay using virt pin 4
BLYNK_WRITE(4)
{
if (param[0].asInt()) {
digitalWrite(NPN4_PIN, HIGH);
// BLYNK_LOG("NPN4: on");
} else {
digitalWrite(NPN4_PIN, LOW);
// BLYNK_LOG("NPN4: off");
}
}
void loop()
{
Blynk.run();
}