Neuling versucht´s mit dem Genuino MKR1000 - Sketch liefert Fehlermeldungen

Guten abend hier ins Forum....

Ich bin absoluter Arduino-Neuling und habe auch gar keine Erfahrungen mit Programmierung von Sketches.

Ab und an bastel´ ich ein wenig mit dem Raspberry herum und habe bisher auch immer Lösungen für meine Probleme gefunden. Da ich aber heute erst mit Arduino angefangen habe bin ich noch sehr unbedarft. Ich habe die Arduino IDE installiert und diverse Bib´s dazu installiert.

Der Genuino wird als Board an Com3 erkannt.
Bei mir ist als Programmer AVRISP mkII voreingestellt.

Ich würde für´s erste gerne dieses Projekt umsetzen :

Den / das Sketch habe ich aus der Anleitung kopiert und mit den notwendigen Daten fürs WLAN gefüttert. Bei Uberprüfung des Sketches schmeißt es mir folgende Fehlermeldungen raus:


Arduino: 1.6.8 (Windows 7), Board: "Arduino/Genuino MKR1000"

In file included from C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:32:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFiClient.h:28:7: error: redefinition of 'class WiFiClient'

class WiFiClient : public Client {

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:31:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFiClient.h:27:7: error: previous definition of 'class WiFiClient'

class WiFiClient : public Client {

^

In file included from C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:34:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFiServer.h:28:7: error: redefinition of 'class WiFiServer'

class WiFiServer : public Server {

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:32:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFiServer.h:31:7: error: previous definition of 'class WiFiServer'

class WiFiServer : public Server {

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:37:17: error: redeclaration of 'WL_NO_SHIELD'

WL_NO_SHIELD = 255,

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:26:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/utility/wl_definitions.h:51:2: note: previous declaration 'wl_status_t WL_NO_SHIELD'

WL_NO_SHIELD = 255,

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:38:19: error: redeclaration of 'WL_IDLE_STATUS'

WL_IDLE_STATUS = 0,

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:26:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/utility/wl_definitions.h:52:9: note: previous declaration 'wl_status_t WL_IDLE_STATUS'

WL_IDLE_STATUS = 0,

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:39:2: error: redeclaration of 'WL_NO_SSID_AVAIL'

WL_NO_SSID_AVAIL,

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:26:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/utility/wl_definitions.h:53:9: note: previous declaration 'wl_status_t WL_NO_SSID_AVAIL'

WL_NO_SSID_AVAIL,

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:40:2: error: redeclaration of 'WL_SCAN_COMPLETED'

WL_SCAN_COMPLETED,

^
In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:26:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:


Da ich nicht weiß, ob alle Fehlermeldungen wichtig sind...hier aber ab 9000 Zeichen Schluss ist, poste ich den zweiten Teil drunter .....

Ich denke, es liegt an den #include - Anweisungen, habe aber keine Ahnung, was ich wie machen muss...

Über eine Hilfestellung wäre ich sehr dankbar.

beste Grüße

Kroiter

Hier der zweite Teil :

C:\Program Files (x86)\Arduino\libraries\WiFi\src/utility/wl_definitions.h:54:9: note: previous declaration 'wl_status_t WL_SCAN_COMPLETED'

WL_SCAN_COMPLETED,

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:41:2: error: redeclaration of 'WL_CONNECTED'

WL_CONNECTED,

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:26:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/utility/wl_definitions.h:55:9: note: previous declaration 'wl_status_t WL_CONNECTED'

WL_CONNECTED,

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:42:2: error: redeclaration of 'WL_CONNECT_FAILED'

WL_CONNECT_FAILED,

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:26:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/utility/wl_definitions.h:56:9: note: previous declaration 'wl_status_t WL_CONNECT_FAILED'

WL_CONNECT_FAILED,

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:43:2: error: redeclaration of 'WL_CONNECTION_LOST'

WL_CONNECTION_LOST,

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:26:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/utility/wl_definitions.h:57:9: note: previous declaration 'wl_status_t WL_CONNECTION_LOST'

WL_CONNECTION_LOST,

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:44:2: error: redeclaration of 'WL_DISCONNECTED'

WL_DISCONNECTED

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:26:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/utility/wl_definitions.h:58:9: note: previous declaration 'wl_status_t WL_DISCONNECTED'

WL_DISCONNECTED

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:45:3: error: conflicting declaration 'typedef enum wl_status_t wl_status_t'

} wl_status_t;

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:26:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/utility/wl_definitions.h:59:3: error: 'wl_status_t' has a previous declaration as 'typedef enum wl_status_t wl_status_t'

} wl_status_t;

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:48:6: error: multiple definition of 'enum wl_enc_type'

enum wl_enc_type { /* Values map to 802.11 encryption suites... */

^

In file included from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:26:0,

from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/utility/wl_definitions.h:62:6: error: previous definition here

enum wl_enc_type { /* Values map to 802.11 encryption suites... */

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:6:0:

C:\Users\N\Documents\Arduino\libraries\WiFi101\src/WiFi101.h:64:7: error: redefinition of 'class WiFiClass'

class WiFiClass

^

In file included from C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:1:0:

C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:34:7: error: previous definition of 'class WiFiClass'

class WiFiClass

^

C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino: In function 'void loop()':

C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:129:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

if (millis() >= millis_start + 10000) {

^

C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino: In function 'void startWifi()':

C:\Users\N\Documents\Arduino\GenuinoMKR1000-Temp-thethings.io\GenuinoMKR1000-Temp-thethings.io.ino:143:33: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

WiFi.begin(WIFI_AP, WIFI_PWD);

^

Bibliothek WiFi in Version 1.2.7 im Ordner: C:\Program Files (x86)\Arduino\libraries\WiFi wird verwendet
Bibliothek WiFi101 in Version 0.9.1 im Ordner: C:\Users\N\Documents\Arduino\libraries\WiFi101 wird verwendet
Bibliothek OneWire in Version 2.3.2 im Ordner: C:\Users\N\Documents\Arduino\libraries\OneWire wird verwendet
Bibliothek thethingsiO_mkr1000 im Ordner: C:\Users\N\Documents\Arduino\libraries\thethingsiO_mkr1000 (legacy) wird verwendet
Bibliothek SPI in Version 1.0 im Ordner: C:\Users\N\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.5\libraries\SPI wird verwendet

exit status 1
Fehler beim Kompilieren für das Board Arduino/Genuino MKR1000.

Hier hab ich mal den / das Sketch :

#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>

#include <WiFi101.h>
#include <WiFiClient.h>
#include <OneWire.h>

#include <thethingsiO_mkr1000.h>


OneWire  ds(2);

#define WIFI_AP "xxx"
#define WIFI_PWD "xxx"

int status = -1;
int millis_start;

#define TOKEN "xxx"


thethingsiOWiFi thing(TOKEN);


void setup(void) {
  millis_start = millis();
  Serial.begin(115200);
  startWifi();
}

void loop(void) {
  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;

  if ( !ds.search(addr)) {
    Serial.println("No more addresses.");
    Serial.println();
    ds.reset_search();
    delay(250);
    return;
  }

  Serial.print("ROM =");
  for ( i = 0; i < 8; i++) {
    Serial.write(' ');
    Serial.print(addr[i], HEX);
  }

  if (OneWire::crc8(addr, 7) != addr[7]) {
    Serial.println("CRC is not valid!");
    return;
  }
  Serial.println();

  // the first ROM byte indicates which chip
  switch (addr[0]) {
    case 0x10:
      Serial.println("  Chip = DS18S20");  // or old DS1820
      type_s = 1;
      break;
    case 0x28:
      Serial.println("  Chip = DS18B20");
      type_s = 0;
      break;
    case 0x22:
      Serial.println("  Chip = DS1822");
      type_s = 0;
      break;
    default:
      Serial.println("Device is not a DS18x20 family device.");
      return;
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44, 1);        // start conversion, with parasite power on at the end

  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.

  present = ds.reset();
  ds.select(addr);
  ds.write(0xBE);         // Read Scratchpad

  Serial.print("  Data = ");
  Serial.print(present, HEX);
  Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
    Serial.print(data[i], HEX);
    Serial.print(" ");
  }
  Serial.print(" CRC=");
  Serial.print(OneWire::crc8(data, 8), HEX);
  Serial.println();

  // Convert the data to actual temperature
  // because the result is a 16 bit signed integer, it should
  // be stored to an "int16_t" type, which is always 16 bits
  // even when compiled on a 32 bit processor.
  int16_t raw = (data[1] << 8) | data[0];
  if (type_s) {
    raw = raw << 3; // 9 bit resolution default
    if (data[7] == 0x10) {
      // "count remain" gives full 12 bit resolution
      raw = (raw & 0xFFF0) + 12 - data[6];
    }
  } else {
    byte cfg = (data[4] & 0x60);
    // at lower res, the low bits are undefined, so let's zero them
    if (cfg == 0x00) raw = raw & ~7;  // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
    //// default is 12 bit resolution, 750 ms conversion time
  }
  celsius = (float)raw / 16.0;
  fahrenheit = celsius * 1.8 + 32.0;
  Serial.print("  Temperature = ");
  Serial.print(celsius);
  Serial.print(" Celsius, ");
  Serial.print(fahrenheit);
  Serial.println(" Fahrenheit");
  if (millis() >= millis_start + 10000) {
    thing.addValue("Temperature", celsius);
    thing.send();
    millis_start = millis();
  }
}

void startWifi() {
  Serial.println("Connecting MKR1000 to network...");
  //  WiFi.begin();
  // attempt to connect to Wifi network:
  while ( status != WL_CONNECTED ) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(WIFI_AP);
    WiFi.begin(WIFI_AP, WIFI_PWD);
    // wait 10 seconds for connection:
    delay(10000);
    status = WiFi.status();
  }
}