Problem z ds18b20 dla SD, przy esp32board =>3.0.0

User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

Cześć, jest problem z ds18b20 dla esp32 boards 3.1.3, choć z tego co czytam to problem jest od 3.0.0 wzwyż.
Poniżej logi z kompilacji przykładu ds18b20 dla SuplaDevice.

Code: Select all

In file included from C:\Arduino\libraries\OneWire\OneWire.cpp:144:
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'uint32_t directRead(uint32_t)':
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:134:17: error: 'GPIO' was not declared in this scope
  134 |         return (GPIO.in >> pin) & 0x1;
      |                 ^~~~
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:136:17: error: 'GPIO' was not declared in this scope
  136 |         return (GPIO.in1.val >> (pin - 32)) & 0x1;
      |                 ^~~~
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'void directWriteLow(uint32_t)':
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:149:9: error: 'GPIO' was not declared in this scope
  149 |         GPIO.out_w1tc = ((uint32_t)1 << pin);
      |         ^~~~
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:151:9: error: 'GPIO' was not declared in this scope
  151 |         GPIO.out1_w1tc.val = ((uint32_t)1 << (pin - 32));
      |         ^~~~
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'void directWriteHigh(uint32_t)':
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:162:9: error: 'GPIO' was not declared in this scope
  162 |         GPIO.out_w1ts = ((uint32_t)1 << pin);
      |         ^~~~
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:164:9: error: 'GPIO' was not declared in this scope
  164 |         GPIO.out1_w1ts.val = ((uint32_t)1 << (pin - 32));
      |         ^~~~
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'void directModeInput(uint32_t)':
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:187:13: error: 'GPIO' was not declared in this scope
  187 |             GPIO.enable_w1tc = ((uint32_t)1 << pin);
      |             ^~~~
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:189:13: error: 'GPIO' was not declared in this scope
  189 |             GPIO.enable1_w1tc.val = ((uint32_t)1 << (pin - 32));
      |             ^~~~
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h: In function 'void directModeOutput(uint32_t)':
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:213:13: error: 'GPIO' was not declared in this scope
  213 |             GPIO.enable_w1ts = ((uint32_t)1 << pin);
      |             ^~~~
C:\Arduino\libraries\OneWire\util/OneWire_direct_gpio.h:215:13: error: 'GPIO' was not declared in this scope
  215 |             GPIO.enable1_w1ts.val = ((uint32_t)1 << (pin - 32));
      |             ^~~~
https://github.com/PaulStoffregen/OneWire/pull/134

https://forum.arduino.cc/t/onewire-libr ... /1266351/4
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79
User avatar
klew
Posts: 13908
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

To jest błąd z biblioteki OneWire
Najlepsze suple dla Twojego domu :mrgreen:
User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

klew wrote: Sat Mar 01, 2025 1:25 pm To jest błąd z biblioteki OneWire
Wiem, ale nie kompilują się przykłady SuplaDevice z ds18, więc zgłaszam tutaj.
Po cofnięciu się do boardów niższych niż 3.0.0, kompiluje bez problemu.
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79
User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

Na boardach =>3.0.0
nie kompiluje się np. ten przykład:

Code: Select all

/*
Copyright (C) AC SOFTWARE SP. Z O.O.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#include <SuplaDevice.h>

/*
 * This example requires Dallas Temperature Control library installed. 
 * https://github.com/milesburton/Arduino-Temperature-Control-Library
 */
// Add include to DS sensor
#include <supla/sensor/DS18B20.h>


// Choose proper network interface for your card:
#ifdef ARDUINO_ARCH_AVR
  // Arduino Mega with EthernetShield W5100:
  #include <supla/network/ethernet_shield.h>
  // Ethernet MAC address
  uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
  Supla::EthernetShield ethernet(mac);

  // Arduino Mega with ENC28J60:
  // #include <supla/network/ENC28J60.h>
  // Supla::ENC28J60 ethernet(mac);
#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
  // ESP8266 and ESP32 based board:
  #include <supla/network/esp_wifi.h>
  Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
#endif

void setup() {

  Serial.begin(115200);

  // Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
  char GUID[SUPLA_GUID_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

  // Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
  char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

  /*
   * Having your device already registered at cloud.supla.org,
   * you want to change CHANNEL sequence or remove any of them,
   * then you must also remove the device itself from cloud.supla.org.
   * Otherwise you will get "Channel conflict!" error.
   */

  // CHANNEL0-3 - Thermometer DS18B20
  // 4 DS18B20 thermometers at pin 23. DS address can be omitted when there is only one device at a pin
  DeviceAddress ds1addr = {0x28, 0xFF, 0xC8, 0xAB, 0x6E, 0x18, 0x01, 0xFC};
  DeviceAddress ds2addr = {0x28, 0xFF, 0x54, 0x73, 0x6E, 0x18, 0x01, 0x77};
  DeviceAddress ds3addr = {0x28, 0xFF, 0x55, 0xCA, 0x6B, 0x18, 0x01, 0x8D};
  DeviceAddress ds4addr = {0x28, 0xFF, 0x4F, 0xAB, 0x6E, 0x18, 0x01, 0x66};

  new Supla::Sensor::DS18B20(23, ds1addr);
  new Supla::Sensor::DS18B20(23, ds2addr);
  new Supla::Sensor::DS18B20(23, ds3addr);
  new Supla::Sensor::DS18B20(23, ds4addr);


  /*
   * SuplaDevice Initialization.
   * Server address, LocationID and LocationPassword are available at https://cloud.supla.org 
   * If you do not have an account, you can create it at https://cloud.supla.org/account/create
   * SUPLA and SUPLA CLOUD are free of charge
   * 
   */

  SuplaDevice.begin(GUID,              // Global Unique Identifier 
                    "svr1.supla.org",  // SUPLA server address
                    "email@address",   // Email address used to login to Supla Cloud
                    AUTHKEY);          // Authorization key
    
}

void loop() {
  SuplaDevice.iterate();
}
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79
User avatar
klew
Posts: 13908
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

A ten merge do OneWire był już wydany? Masz aktualna bibliotekę OneWire?
Najlepsze suple dla Twojego domu :mrgreen:
User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

klew wrote: Sat Mar 01, 2025 1:40 pm A ten merge do OneWire był już wydany? Masz aktualna bibliotekę OneWire?
Aktualizacja biblioteki OneWire do najnowszej wersji rozwiązuje problem.
Dzięki.
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79
User avatar
klew
Posts: 13908
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

SOYER wrote: Sat Mar 01, 2025 2:19 pm
klew wrote: Sat Mar 01, 2025 1:40 pm A ten merge do OneWire był już wydany? Masz aktualna bibliotekę OneWire?
Aktualizacja biblioteki OneWire do najnowszej wersji rozwiązuje problem.
Dzięki.
Sam podałeś rozwiązanie w pierwszym poście ;)
Najlepsze suple dla Twojego domu :mrgreen:
User avatar
SOYER
Posts: 1623
Joined: Wed Aug 10, 2022 12:29 pm
Location: Kryry
Been thanked: 2 times

Post

Tak, jednak nie wiedziałem, że to tak działa. Myślałem, że ta biblioteka onewire jest jakoś „zaszyta” w SD i trzeba to zaktualizować.
https://youtube.com/@tomaszhamer8134?si=_J1cT_QWsXxgt1Fm
https://kryry01.aqi.eco/pl
https://app.weathercloud.net/d4311785603
https://github.com/Soyer79

Return to “Ogólna dyskusja”