ARDUINO MEGA + ENC28J60 - brak połączenia z serwerem

Post Reply
KrzysiekW
Posts: 9
Joined: Sat Jan 26, 2019 2:52 pm

Sun Apr 14, 2019 6:41 pm

Witam,

Próbuję przejść z Ethernet Shield na ENC28J60 niestety bezskutecznie :(
Elektrycznie wszystko raczej dobrze podłączone bo z debug-ów widzę że pobiera adres IP, jednak na tym się kończy.
Nie mogę w żaden sposób podłączyć się do serwera. Poniżej mój kod, a w zasadzie to gotowy przykład. Dokładnie ten sam kod z podłączoną biblioteką dla Shield-a działa poprawnie. Rejestruje się na serwerze. Za każdym razem usuwałem urządzenie z serwera.

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 <UIPEthernet.h>
#include <SuplaDevice.h>

/*
 * This example requires UIPEthernet library installed. 
 * https://github.com/ntruchsess/arduino_uip 
 */

void setup() {

  Serial.begin(9600);
 
  // Replace the falowing GUID
  char GUID[SUPLA_GUID_SIZE] = {};
  // with GUID that you can retrieve from https://www.supla.org/arduino/get-guid


  // Ethernet MAC address
  uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};

  /*
   * 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 - RELAY
  SuplaDevice.addRelay(44);           // 44 - Pin number where the relay is connected      
                                      // Call SuplaDevice.addRelay(44, true) with an extra "true" parameter 
                                      // to enable "port value inversion"
                                      // where HIGH == LOW, and LOW == HIGH   

  // CHANNEL1 - RELAY
  SuplaDevice.addRelay(45);           // 45 - Pin number where the relay is connected   

  // CHANNEL3 - TWO RELAYS (Roller shutter operation)
  SuplaDevice.addRollerShutterRelays(46,     // 46 - Pin number where the 1st relay is connected   
                                     47);    // 47 - Pin number where the 2nd relay is connected  

  // CHANNEL4 - Opening sensor (Normal Open)
  SuplaDevice.addSensorNO(A0); // A0 - Pin number where the sensor is connected
                               // Call SuplaDevice.addSensorNO(A0, true) with an extra "true" parameter
                               // to enable the internal pull-up resistor


  // CHANNEL5 - Opening sensor (Normal Open)
  SuplaDevice.addSensorNO(A1); // A1 - Pin number where the sensor is connected

  /*
   * 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 
                    mac,               // Ethernet MAC address
                    "svr11.supla.org",  // SUPLA server address
                    xxx,                // Location ID 
                    "yyyy");           // Location Password
    
}

void loop() {
  SuplaDevice.iterate();
}
Bardzo proszę Szanownych Forumowiczów o pomoc, mi niestety pomysły się skończyły :(
Attachments
log.png
log.png (27.15 KiB) Viewed 746 times
Post Reply