Benutzer-Werkzeuge

Webseiten-Werkzeuge


projekte:grossprojekte:lorawan:12_temp-feuchte

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Nächste ÜberarbeitungBeide Seiten der Revision
projekte:grossprojekte:lorawan:12_temp-feuchte [2020/03/18 19:35] fablab_wikiprojekte:grossprojekte:lorawan:12_temp-feuchte [2020/11/09 21:31] fablab_wiki
Zeile 127: Zeile 127:
 int pinDHT22 = 4; int pinDHT22 = 4;
 SimpleDHT22 dht22(pinDHT22); SimpleDHT22 dht22(pinDHT22);
-byte temperature = 0; +float temperature = 0; 
-byte humidity = 0;+float humidity = 0;
 // //
 // //
Zeile 193: Zeile 193:
   } else {   } else {
         // Eigene Sensoren         // Eigene Sensoren
-        byte temperature = 0; +        temperature = 0; 
-        byte humidity = 0;+        humidity = 0;
         int err = SimpleDHTErrSuccess;         int err = SimpleDHTErrSuccess;
         if ((err = dht22.read(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess)         if ((err = dht22.read(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess)
Zeile 204: Zeile 204:
           }           }
           //Serial.print("Sample OK: ");           //Serial.print("Sample OK: ");
-          //Serial.print((byte)temperature); Serial.print(" *C, "); +          //Serial.print(temperature); Serial.print(" *C, "); 
-          //Serial.print((byte)humidity); Serial.println(" RH%");+          //Serial.print(humidity); Serial.println(" RH%");
           //DHT22 sampling rate is 0.5HZ.           //DHT22 sampling rate is 0.5HZ.
           delay(2500);           delay(2500);
Zeile 211: Zeile 211:
           // d.h. Anzeige TTN 1. Byte 14 (Hex) ist 20 Grad Celsius           // d.h. Anzeige TTN 1. Byte 14 (Hex) ist 20 Grad Celsius
           //                  2. Byte 38 (Hex) ist 56 % Rel H           //                  2. Byte 38 (Hex) ist 56 % Rel H
-          payload[0] = temperature; +          payload[0] = int(temperature)
-          payload[1] = humidity;+          payload[1] = int(humidity);
           // Ende eigene Sensoren           // Ende eigene Sensoren
     // Prepare upstream data transmission at the next possible time.     // Prepare upstream data transmission at the next possible time.
Zeile 226: Zeile 226:
 // Ende eigenes Setup // Ende eigenes Setup
 // //
-#ifdef VCC_ENABLE +
-  // For Pinoccio Scout boards +
-  pinMode(VCC_ENABLE, OUTPUT); +
-  digitalWrite(VCC_ENABLE, HIGH); +
-  delay(1000); +
-#endif+
  
   // LMIC init   // LMIC init
Zeile 237: Zeile 232:
   // Reset the MAC state. Session and pending data transfers will be discarded.   // Reset the MAC state. Session and pending data transfers will be discarded.
   LMIC_reset();   LMIC_reset();
-  LMIC_setClockError(MAX_CLOCK_ERROR * 2 / 100); 
-  LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);      // g-band 
-  LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI);      // g-band 
-  LMIC_setupChannel(2, 868500000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);      // g-band 
-  LMIC_setupChannel(3, 867100000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);      // g-band 
-  LMIC_setupChannel(4, 867300000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);      // g-band 
-  LMIC_setupChannel(5, 867500000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);      // g-band 
-  LMIC_setupChannel(6, 867700000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);      // g-band 
-  LMIC_setupChannel(7, 867900000, DR_RANGE_MAP(DR_SF12, DR_SF7),  BAND_CENTI);      // g-band 
-  LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK,  DR_FSK),  BAND_MILLI);      // g2-band 
- 
-  LMIC_setLinkCheckMode(0); 
-  LMIC.dn2Dr = SF9; 
-  LMIC_setDrTxpow(DR_SF7, 14); 
   // Start job (sending automatically starts OTAA too)   // Start job (sending automatically starts OTAA too)
   do_send(&sendjob);   do_send(&sendjob);
Zeile 262: Zeile 243:
 Was kommt hinzu: (Zeilenangaben in Klammern)\\ Was kommt hinzu: (Zeilenangaben in Klammern)\\
 \\ \\
-  * (39) Bibliothek für den DHT22 (ist eine Einfachbibliothek, kann nur ganze Werte auslesen) +  * (39) Bibliothek für den DHT22 
-  * (45-48) Datenpin (Digitalpin 4), Initialisierung, Variablendefinition +  * (43-46) Datenpin (Digitalpin 4), Initialisierung, Variablendefinition 
-  * (112-133) Auslesen des Sensors mit Fehlerbehandlung, Übergabe der Daten in die Payload+  * (110-131) Auslesen des Sensors mit Fehlerbehandlung, Übergabe der Daten in die Payload
  
  
 \\ \\
 \\ \\
-Stand: 18.03.2020+Stand: 26.03.2020
  
projekte/grossprojekte/lorawan/12_temp-feuchte.txt · Zuletzt geändert: 2022/12/14 12:48 von michael