Help me please, trying to get this project off the ground, I feel like it should be more simple than this… I got the sketch to compile, loaded onto my MKR1000 but no joy. The app says my project is not on line. Auth code, and home wifi data is correct in sketch. What am I missing here?
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <Adafruit_BMP280.h>
#include <WiFi101.h>
#include <BlynkSimpleMKR1000.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "Q4RG3xxxxxxxxxxxxxxxxxxxxxxxxGu8ipgh";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "skynetvan213";
char pass[] = "xxxxxxxxxxxxxx462";
#define BMP_SCK (5)
#define BMP_MISO (2)
#define BMP_MOSI (4)
#define BMP_CS (1)
Adafruit_BMP280 bmp; // I2C
//Adafruit_BMP280 bmp(BMP_CS); // hardware SPI
//Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);
void setup()
{
// Debug console
Serial.begin(9600);
Serial.println(F("BMP280 test"));
if (!bmp.begin()) {
Serial.println(F("Could not find a valid BMP280 sensor, check wiring!"));
while (1);
}
/* Default settings from datasheet. */
bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, /* Operating Mode. */
Adafruit_BMP280::SAMPLING_X2, /* Temp. oversampling */
Adafruit_BMP280::SAMPLING_X16, /* Pressure oversampling */
Adafruit_BMP280::FILTER_X16, /* Filtering. */
Adafruit_BMP280::STANDBY_MS_500); /* Standby time. */
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
}
void loop()
{
Blynk.run();
Serial.print(F("Temperature = "));
Serial.print(bmp.readTemperature());
Serial.println(" *C");
Serial.print(F("Pressure = "));
Serial.print(bmp.readPressure());
Serial.println(" Pa");
Serial.print(F("Approx altitude = "));
Serial.print(bmp.readAltitude(1013.25)); /* Adjusted to local forecast! */
Serial.println(" m");
Serial.println();
delay(2000);
}
@emtjim the first thing that you’re missing is the triple backticks at the beginning and end of your code that make it display correctly on this forum.
Please edit your post with the pencil icon at the bottom, and add the triple backticks.
Triple backticks look like this:
```
I think I need to be more clear, I know very little of how this works. I really only need to get this to work as I don’t intend on multiple projects. So I’m learning slowly…
I’m not seeing a thing when I open the monitor, Im not sure the sketch is making it past the setup. I would think at a minimum I would see the MKR 1000 link up with the app in Blynk and maybe get corrupt data but I can’t even get a link in to Blynk…
and I did read the suggested article you referenced.
Thanks Bill,
I did pare down to one sensor (BME280) the make things a bit easier. Still working on the Blynk connection issue and will look at the BMP code. I know I have connectivity as I had to run a I2C scanner to get the sensor address. Unfortunately the 1000 can’t find the sensor. but I’m getting there.
it sends values to V0, V1 and V2 virtual pins on your app… so, you need to type in your wifi acc and your auth token, and adjust your value labels accordingly, on interval time you need to select PUSH, and assign each value label or whatever widget to each of virtual pins… note that the second code doesnt print anything in serial, if you want you can add debug yourself…
I got it! I had to redo the sketch with less junk in it but in the end it works great and in fact it worked so well I have added two additional sensors. Next step is a load cell and I’m done. Thanks for the input.