Arduino Forum

Using Arduino => Interfacing w/ Software on the Computer => Topic started by: fernando1828 on Apr 08, 2019, 06:59 pm

Title: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 08, 2019, 06:59 pm
Hi everybody. After having surfed the network for a long time I found a direct connector between MS SQL server and arduino. The project I try to do is based on sending sensor values and recording them in the database. The idea is to not use any connector between arduino and SQL.
The problem is that the program does not compile (I mean the connector library example). I attach the libraries. Is there any other direct connector between SQL and Arduino?

Thanks!!

Link: https://github.com/mustafakemalgilor/arduino-mssql (https://github.com/mustafakemalgilor/arduino-mssql)
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 09, 2019, 12:39 pm
I'm not opening zip files. Post your sketch directly. Post links to the libraries. Post your error messages.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: Thee_Captain on Apr 09, 2019, 01:35 pm
I find it fairly straight forward to make an HTTP endpoint and handle the SQL on the server. It also creates an opportunity for a good API.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 09, 2019, 01:59 pm
Links:

Arduino to sql:  https://github.com/mustafakemalgilor/arduino-mssql (https://github.com/mustafakemalgilor/arduino-mssql)

UIPethernet: https://github.com/UIPEthernet/UIPEthernet (https://github.com/UIPEthernet/UIPEthernet)

Code: [Select]

//Included by myself!!!
#include <Dhcp.h>
#include <Dns.h>
#include <ethernet_comp.h>
#include <UIPClient.h>
#include <UIPEthernet.h>
#include <UIPServer.h>
#include <UIPUdp.h>
//Included by myself!!!

#include <Ethernet.h>
#include "sqlard.h"


uint8_t Ethernet_MacAddr[6] = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 }; /* MAC ADRESİ */
static byte Static_IPAddr[] = { 172, 16, 1, 2 };
static byte Gateway_IPAddr[] = { 172, 16, 1, 1 };
static byte Subnet_Mask[] = { 255, 255, 0, 0 };
EthernetClient client;

SQLard MSSQL(Gateway_IPAddr, 1433, &client);
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  while (!Serial);
  Ethernet.begin(Ethernet_MacAddr, Static_IPAddr, Gateway_IPAddr, Gateway_IPAddr, Subnet_Mask);
  if (MSSQL.connect())
  {
    MSSQL.setCredentials(L"arduino", L"ard_login", L"ard_password", L"hostx");
    MSSQL.login();
  }

}

void loop() {
  // put your main code here, to run repeatedly:
  int loop_count = 0;
  delay(5000);

  long affected_rows = MSSQL.executeNonQuery(L"INSERT INTO [dbo].[test]([data]) VALUES('deger1234') ");
  long yeni = MSSQL.executeNonQuery(L"DROP TABLE [dbo].[test23]");
  Serial.print(affected_rows);
  Serial.println(" row(s) affected.");
  if (!client) {
    Serial.println("disconnecting.");
    client.stop();
  }
  if (++loop_count == 10)
  {
    MSSQL.executeNonQuery(L"DELETE FROM [dbo].[test]");
    loop_count = 0;
  }
}


Errors (some of them):

Quote
In file included from sqlard_test.ino:5:0:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPClient.h:25:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import "Client.h"
  ^
In file included from sqlard_test.ino:5:0:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPClient.h:26:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import "utility/mempool.h"
  ^
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPClient.h:29:4: warning: #import is a deprecated GCC extension [-Wdeprecated]
   #import "utility/uip.h"
    ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:34:0,
                 from sqlard_test.ino:6:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPServer.h:23:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import "Server.h"
  ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:34:0,
                 from sqlard_test.ino:6:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPServer.h:24:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import "UIPClient.h"
  ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPUdp.h:23:0,
                 from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/Dhcp.h:7,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:5:24: error: redefinition of 'class UIPClient'
 #define EthernetClient UIPClient
                        ^
C:\Program Files (x86)\Arduino\libraries\Ethernet\src/EthernetClient.h:8:7: note: in expansion of macro 'EthernetClient'
 class EthernetClient : public Client {
       ^
In file included from sqlard_test.ino:5:0:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPClient.h:63:7: error: previous definition of 'class UIPClient'
 class UIPClient : public Client {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPUdp.h:23:0,
                 from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/Dhcp.h:7,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:6:24: error: redefinition of 'class UIPServer'
 #define EthernetServer UIPServer
                        ^
C:\Program Files (x86)\Arduino\libraries\Ethernet\src/EthernetServer.h:8:7: note: in expansion of macro 'EthernetServer'
 class EthernetServer :
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:34:0,
                 from sqlard_test.ino:6:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPServer.h:26:7: error: previous definition of 'class UIPServer'
 class UIPServer : public Server {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPUdp.h:23:0,
                 from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/Dhcp.h:7,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:4:18: error: conflicting declaration 'EthernetClass UIPEthernet'
 #define Ethernet UIPEthernet
                  ^
Error de compilación
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 09, 2019, 03:10 pm
Code: [Select]
//Included by myself!!!
#include <Dhcp.h>
#include <Dns.h>
#include <ethernet_comp.h>
#include <UIPClient.h>
#include <UIPEthernet.h>
#include <UIPServer.h>
#include <UIPUdp.h>
//Included by myself!!!

Why? Why did you stuck a bunch of useless #include statements in your code?
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 09, 2019, 03:57 pm
Why? Why did you stuck a bunch of useless #include statements in your code?
Oh, some of them are useless, but I only need one or two. Otherwise, I get another error.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: ieee488 on Apr 09, 2019, 04:26 pm
I find it fairly straight forward to make an HTTP endpoint and handle the SQL on the server. It also creates an opportunity for a good API.
How about put your money where your mouth is and show some code?
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 09, 2019, 04:56 pm
Quote
but I only need one or two. Otherwise, I get another error.
Which one(s)? What error?

The compiler is VERY specific. You need to learn to be, too.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 09, 2019, 05:12 pm
Which one(s)? What error?
The compiler asked me for the UIPethernet library.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 09, 2019, 06:02 pm
The compiler asked me for the UIPethernet library.
Show us the code without all the unnecessary #include statements, and exactly how the compiler asked you for the UIPethernet library.

The compiler is I is a crusty old f*ck, and doesn't ask for anything. It simply demands perfection.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 09, 2019, 07:16 pm
Quote
Show us the code without all the unnecessary #include statements, and exactly how the compiler asked you for the UIPethernet library.
Code: [Select]

 #include <Ethernet.h>
#include "sqlard.h"


uint8_t Ethernet_MacAddr[6] = { 0x74,0x69,0x69,0x2D,0x30,0x31 }; /* MAC ADRESİ */
static byte Static_IPAddr[] = { 172,16,1,2 };            
static byte Gateway_IPAddr[] = { 172,16,1,1 };
static byte Subnet_Mask[] = { 255,255,0,0 };
EthernetClient client;

SQLard MSSQL(Gateway_IPAddr, 1433, &client);
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  while (!Serial);
  Ethernet.begin(Ethernet_MacAddr, Static_IPAddr, Gateway_IPAddr, Gateway_IPAddr, Subnet_Mask);
  if(MSSQL.connect())
  {
      MSSQL.setCredentials(L"arduino", L"ard_login",L"ard_password",L"hostx");
      MSSQL.login();
  }
  
}

void loop() {
  // put your main code here, to run repeatedly:
  int loop_count = 0;
  delay(5000);

  long affected_rows = MSSQL.executeNonQuery(L"INSERT INTO [dbo].[test]([data]) VALUES('deger1234') ");
  long yeni = MSSQL.executeNonQuery(L"DROP TABLE [dbo].[test23]");
  Serial.print(affected_rows);
  Serial.println(" row(s) affected.");
  if (!client) {
    Serial.println("disconnecting.");
    client.stop();
  }
  if(++loop_count == 10)
  {
    MSSQL.executeNonQuery(L"DELETE FROM [dbo].[test]");
    loop_count = 0;
  }
}



Quote
The compiler is I is a crusty old f*ck, and doesn't ask for anything. It simply demands perfection.
Sure, I'm not perfect, thats why I am here!!!. I am using Arduino 1.6.5.
Error:

Quote
Opciones de compilación cambiadas, reconstruyendo todo
In file included from sqlard_test.ino:2:0:
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:13:27: fatal error: UIPEthernet.h: No such file or directory
   #include <UIPEthernet.h>
                           ^
compilation terminated.
Error de compilación
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 09, 2019, 08:27 pm
Code: [Select]
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:13:27: fatal error: UIPEthernet.h: No such file or directory
   #include <UIPEthernet.h>

If you think that that means that you need to add the same single statement to your sketch, what happens when you do that?

What it looks to me like is that you haven't downloaded and/or properly installed the UIPEthernet library.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 09, 2019, 08:49 pm
Code: [Select]
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:13:27: fatal error: UIPEthernet.h: No such file or directory
   #include <UIPEthernet.h>

If you think that that means that you need to add the same single statement to your sketch, what happens when you do that?

I got many errors, I've posted them before. (see my post # 2)

What it looks to me like is that you haven't downloaded and/or properly installed the UIPEthernet library.
I think the same, but I don't realice what Im doing wrong.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: Thee_Captain on Apr 10, 2019, 02:10 am
How about put your money where your mouth is and show some code?
Challenge accepted.

This is based off the ESP32 BasicHttpClient.ino example sketch. I thinned out some of it and moved the get request to its own function. That way it can be called by specialty "sensor" (anything really) functions.

You could do a similar sketch with Arduino's Ethernet WebClient example (https://www.arduino.cc/en/Tutorial/WebClient).

Code: [Select]
/**
 * BasicHTTPClient.ino
 *
 *  Created on: 24.05.2015
 *
 */

#include <Arduino.h>

#include <WiFi.h>
#include <WiFiMulti.h>
#include <HTTPClient.h>

#define USE_SERIAL Serial



WiFiMulti wifiMulti;
const char* ssid = "your_SSID";
const char* pass = "your_password";

char getURI[128] = "http://example.com/index.html";
//char getURI[128] = "http://example.com/flabberwab.html"; //404 Not Found - Test Response
//char getURI[128] = "http://example.com/device/5/sensor/251";


#define SENSOR_PIN 26


void setup() {
    USE_SERIAL.begin(115200);
    delay(3000);
    wifiMulti.addAP(ssid, pass);

    pinMode(SENSOR_PIN, INPUT);

    getRequest(getURI);
    delay(2000);
}

void loop() {
//  getRequest(getURI);
//  delay(5000);
  saveSensorValue();
  delay(5000);
}


void saveSensorValue(){
  char myDeviceEndPoint[128] = "http://example.com/device/5"; //your device endpoint
  int sensorVal = -1;
  char buf[12] = "";
  sensorVal = digitalRead(SENSOR_PIN);
  strcat(myDeviceEndPoint, "/sensor/"); //your sensor endpoint concatenated to your device endpoint
  strcat(myDeviceEndPoint, itoa(sensorVal, buf, 10) );
  getRequest(myDeviceEndPoint);
}



void getRequest(char* requestURI){
    // wait for WiFi connection
    if((wifiMulti.run() == WL_CONNECTED)) {
        HTTPClient http;
        USE_SERIAL.println("");
        http.begin(requestURI);

        USE_SERIAL.print("[HTTP] GET...\n");
        USE_SERIAL.println(requestURI);
       
        // start connection and send HTTP header
        int httpCode = http.GET();

        // httpCode will be negative on error
        if(httpCode > 0) {
            // HTTP header has been send and Server response header has been handled
            USE_SERIAL.printf("[HTTP] Response code: %d\n", httpCode);

            //request made it to the server
            //and has sent back a response
            if(httpCode == HTTP_CODE_OK) {
                String payload = http.getString();
                USE_SERIAL.println(payload);
            }
        } else {
          //Request did not reach the server
          USE_SERIAL.printf("[HTTP] Request failed, error: %s\n", http.errorToString(httpCode).c_str());
        }

        http.end();
    }
}
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 11, 2019, 01:08 am
Hey thank you very much for the answers, but let's not lose the goal:I want to connect the arduino with SQL directly with the program I've posted before.

Thanks!
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 11, 2019, 12:24 pm
Quote
I got many errors, I've posted them before. (see my post # 2)
Post #2 is not yours. Post #3 is, but that code contains a whole sh*tload of #include statements.

I want to see the code, and the compiler errors, where your added #include statements include ONLY UIPEthernet.h.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 12, 2019, 01:17 am
OK, I get (some of them):

Quote
n file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:33:0,
                 from C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:13,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPClient.h:25:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import "Client.h"
  ^
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPClient.h:26:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import "utility/mempool.h"
  ^
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPClient.h:29:4: warning: #import is a deprecated GCC extension [-Wdeprecated]
   #import "utility/uip.h"
    ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:34:0,
                 from C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:13,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPServer.h:23:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import "Server.h"
  ^
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPServer.h:24:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import "UIPClient.h"
  ^
In file included from sqlard_test.ino:2:0:
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:97:31: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
  SQLardRowElement<T> * prev = nullptr;
                               ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:97:31: error: 'nullptr' was not declared in this scope
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:157:31: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
  SQLardRowElement<T> * root = nullptr;
                               ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:159:31: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
  SQLardRowElement<T> * head = nullptr;
                               ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:160:35: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
  SQLardRowElement<T>  * current = nullptr;
                                   ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:157:31: error: 'nullptr' was not declared in this scope
  SQLardRowElement<T> * root = nullptr;
                               ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:159:31: error: 'nullptr' was not declared in this scope
  SQLardRowElement<T> * head = nullptr;
                               ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:160:35: error: 'nullptr' was not declared in this scope
  SQLardRowElement<T>  * current = nullptr;
                                   ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h: In member function 'void SQLardRowList<T>::Free()':
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:120:18: error: 'nullptr' was not declared in this scope
   while (node != nullptr)
                  ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h: In member function 'void SQLardRowList<T>::Enqueue(T)':
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:138:15: error: 'nullptr' was not declared in this scope
   if (root == nullptr)
               ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h: In member function 'void SQLardRowList<T>::MoveNext()':
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:147:18: error: 'nullptr' was not declared in this scope
   if (current != nullptr)
                  ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h: In member function 'bool SQLardRowList<T>::isEmpty()':
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:154:34: error: 'nullptr' was not declared in this scope
  bool isEmpty() { return root == nullptr; }
                                  ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h: In static member function 'static size_t SQLardUtil::sqlard_wcslen(const wchar_t*)':
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:314:12: error: 'nullptr' was not declared in this scope
   if (s == nullptr)
            ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h: In static member function 'static wchar_t* SQLardUtil::sqlard_wmemcpy(void*, const wchar_t*, size_t)':
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:329:12: error: 'nullptr' was not declared in this scope
   if (s == nullptr || d == nullptr)
            ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h: In static member function 'static SQLardColumnData* SQLardColumnData::ParseColumnData(uint8_t*, size_t&)':
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:460:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::BITTYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:461:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::INT1TYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:462:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::INT2TYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:463:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::INT4TYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:464:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::INT8TYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:465:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::DATETIMETYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:466:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::FLT4TYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:467:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::FLT8TYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:469:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::DECIMALNTYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:470:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::NUMERICNTYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:480:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::IMAGETYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:481:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::NTEXTTYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:482:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::TEXTTYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:490:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::BIGVARBINTYPE:
         ^
C:\Users\Fer\Documents\Arduino\libraries\arduino-mssql-master/sqlard.h:491:9: error: 'SQLardDataType' is not a class or namespace
    case SQLardDataType::BIGVARCHRTYPE:
         ^
           ^
Error de compilación

Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 15, 2019, 12:47 pm
Quote
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPClient.h:25:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import "Client.h"
  ^
Why don't you start by fixing this way-outdated library to use #include, instead of #import?

Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 18, 2019, 01:20 am
Ok, now i get:

Quote
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:28:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:4:18: error: conflicting declaration 'EthernetClass UIPEthernet'
 #define Ethernet UIPEthernet
                  ^
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet\src/Ethernet.h:81:22: note: in expansion of macro 'Ethernet'
 extern EthernetClass Ethernet;
                      ^
In file included from sqlard_test.ino:2:0:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:125:25: error: 'UIPEthernet' has a previous declaration as 'UIPEthernetClass UIPEthernet'
 extern UIPEthernetClass UIPEthernet;
                         ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:28:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:7:21: error: redefinition of 'class UIPUDP'
 #define EthernetUDP UIPUDP
                     ^
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet\src/Ethernet.h:86:7: note: in expansion of macro 'EthernetUDP'
 class EthernetUDP : public UDP {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/Dhcp.h:7:0,
                 from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:30,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPUdp.h:43:7: error: previous definition of 'class UIPUDP'
 class UIPUDP : public UDP
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:28:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:5:24: error: redefinition of 'class UIPClient'
 #define EthernetClient UIPClient
                        ^
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet\src/Ethernet.h:147:7: note: in expansion of macro 'EthernetClient'
 class EthernetClient : public Client {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:33:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPClient.h:63:7: error: previous definition of 'class UIPClient'
 class UIPClient : public Client {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:28:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:6:24: error: redefinition of 'class UIPServer'
 #define EthernetServer UIPServer
                        ^
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet\src/Ethernet.h:180:7: note: in expansion of macro 'EthernetServer'
 class EthernetServer : public Server {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:34:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPServer.h:26:7: error: previous definition of 'class UIPServer'
 class UIPServer : public Server {
       ^
In file included from sqlard_test.ino:4:0:
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet\src/Ethernet.h:197:7: error: redefinition of 'class DhcpClass'
 class DhcpClass {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:30:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/Dhcp.h:139:7: error: previous definition of 'class DhcpClass'
 class DhcpClass {
       ^
Multiple libraries were found for "Ethernet.h"
 Used: C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet
 Not used: C:\Program Files (x86)\Arduino\libraries\Ethernet
Error de compilación

Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 18, 2019, 02:01 pm
Quote
Used: C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet
 Not used: C:\Program Files (x86)\Arduino\libraries\Ethernet
MightyCore? It's time you told us what board you are compiling for.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 18, 2019, 03:31 pm
Oh I made a mistake, I was working on another project. Anyway, choosing arduino UNO I get errors.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 18, 2019, 05:05 pm
Quote
Anyway, choosing arduino UNO I get errors.
Feel free to share them with us. Or not.
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 22, 2019, 12:40 am
Quote
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:28:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:4:18: error: conflicting declaration 'EthernetClass UIPEthernet'
 #define Ethernet UIPEthernet
                  ^
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet\src/Ethernet.h:81:22: note: in expansion of macro 'Ethernet'
 extern EthernetClass Ethernet;
                      ^
In file included from sqlard_test.ino:2:0:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:125:25: error: 'UIPEthernet' has a previous declaration as 'UIPEthernetClass UIPEthernet'
 extern UIPEthernetClass UIPEthernet;
                         ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:28:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:7:21: error: redefinition of 'class UIPUDP'
 #define EthernetUDP UIPUDP
                     ^
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet\src/Ethernet.h:86:7: note: in expansion of macro 'EthernetUDP'
 class EthernetUDP : public UDP {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/Dhcp.h:7:0,
                 from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:30,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPUdp.h:43:7: error: previous definition of 'class UIPUDP'
 class UIPUDP : public UDP
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:28:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:5:24: error: redefinition of 'class UIPClient'
 #define EthernetClient UIPClient
                        ^
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet\src/Ethernet.h:147:7: note: in expansion of macro 'EthernetClient'
 class EthernetClient : public Client {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:33:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPClient.h:63:7: error: previous definition of 'class UIPClient'
 class UIPClient : public Client {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:28:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/ethernet_comp.h:6:24: error: redefinition of 'class UIPServer'
 #define EthernetServer UIPServer
                        ^
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet\src/Ethernet.h:180:7: note: in expansion of macro 'EthernetServer'
 class EthernetServer : public Server {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:34:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPServer.h:26:7: error: previous definition of 'class UIPServer'
 class UIPServer : public Server {
       ^
In file included from sqlard_test.ino:4:0:
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet\src/Ethernet.h:197:7: error: redefinition of 'class DhcpClass'
 class DhcpClass {
       ^
In file included from C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/UIPEthernet.h:30:0,
                 from sqlard_test.ino:2:
C:\Users\Fer\Documents\Arduino\libraries\arduino_uip-master/Dhcp.h:139:7: error: previous definition of 'class DhcpClass'
 class DhcpClass {
       ^
Multiple libraries were found for "Ethernet.h"
 Used: C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\hardware\avr\2.0.0\libraries\Ethernet
 Not used: C:\Program Files (x86)\Arduino\libraries\Ethernet
Error de compilación
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 22, 2019, 03:03 pm
Quote
C:\Users\Fer\AppData\Roaming\Arduino15\packages\MightyCore\
Still with the unexplained MightyCore...
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 22, 2019, 06:48 pm
Maybe I have a problem with the Mighty core library, later I will uninstall it. Anyway I am trying to connect the arduino with a c# program.

Thanks!!!!
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: PaulS on Apr 23, 2019, 05:43 pm
Quote
Anyway I am trying to connect the arduino
Which Arduino?
Title: Re: Problem with connector between Arduino and MS SQL Server
Post by: fernando1828 on Apr 24, 2019, 02:34 pm
Quote
Which Arduino?
Uno or mega.