Arduino Yun + Particle Photon with shared auth code?

If I’m sending say- humidity data- to a Blynk virtual pin from an Arduino Yun…

BLYNK_READ(1) {  //Humidity Display
  int h = myClimate.readHumidity();
  Blynk.virtualWrite(1, h);
}

…Can I snag that data from the virtual pin with a:

BLYNK_WRITE(1) {
    int setting = param.asInt();
    h = setting;
};

on my Particle Photon if I’m using the same auth code or do I need to use bridge?

You could use same auth token. But I recommend to use another virtual pin for that just to avoid confusion.

If you wand to deliver some value from device A to device B, you should setup bridge.

Well, I don’t really need devices sending info to each other- I’m just looking to send a number from device A to a virtual pin (a dedicated v-pin specifically for this purpose), and use device B to take that value and data log it.

For some reason, I’m not able to get this to work between my yun and photon…

Here’s my code on each device, and I’ll bold the parts of the yun that are the most important:

// This #include statement was automatically added by the Particle IDE.
#include "blynk/BlynkSimpleParticle.h"

char auth[] = "xxx";

int humidity;

void setup() {
  Blynk.begin(auth);
}

//Data Logging from Blynk Virtual Pins

BLYNK_WRITE(10) {
    int setting = param.asInt();
    humidity = setting;
}

//Rewriting Value to VPin 11 for testing purposes.  
BLYNK_READ(11) { 
     Blynk.virtualWrite(11, humidity);
  }

void loop() {
  Blynk.run();
}

Yun Code:

#include <Bridge.h>
#include <BlynkSimpleYun.h>
#include <Wire.h>
#include "SparkFunHTU21D.h"
#include "kSeries.h"

HTU21D myClimate;

kSeries K_30(8, 9); //CO2 Read

int photonValue;


//Blynk token
char auth[] = "xxx";

void setup()
{
  Bridge.begin();
  Blynk.begin(auth);

  myClimate.begin();

}

//Sending photonValue to V Pin 10
BLYNK_READ(10) {
  int h = myClimate.readHumidity();
  photonValue = h;
  Blynk.virtualWrite(10, h);
}

void loop() {
  Blynk.run();

}

Any thoughts? And I should also note that the same Blynk sketch is detecting both devices (it says a device is off when I upload new code to either), and I am able to send values originating from my photon to the same blynk sketch as the yun… I just can’t do the thing I want to do :smile: .

It sounds rather contradicting :wink:

You should probably use different auth tokens for your devices.