BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Compiling Error Message

Hey Blynk Community!

I had to reinstall my old mac and unfortunately i lost my arduino project files.
Blynk was running fine over Ethernet and Local PiServer.

Now i want to compile some sample codes but after updating ArduinoOSX and Blynk Library i alway get the error message below.

My Hardware:
• Mega2560+W5100 over Ethernet.
• Local Blynk RaspPI Server, running and connectable via app.
• newest Blynk Library, newest Arduino Build



#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "hidden";

#define W5100_CS  10
#define SDCARD_CS 4

void setup()
{
  // Debug console
  Serial.begin(9600);

  pinMode(SDCARD_CS, OUTPUT);
  digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card

  Blynk.begin(auth);
  // You can also specify server:
  //Blynk.begin(auth, "blynk-cloud.com", 80);
  Blynk.begin(auth, IPAddress(000,000,000,00), 1234);
}

void loop()
{
  Blynk.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

```cpp

void loop()

I get the error message:
In file included from /Applications/Arduino.app/Contents/Java/libraries/Ethernet/src/Dns.cpp:8:0:
/Applications/Arduino.app/Contents/Java/libraries/Ethernet/src/Dns.cpp: In member function ‘uint16_t DNSClient::BuildRequest(const char*)’:
/Applications/Arduino.app/Contents/Java/libraries/Ethernet/src/utility/w5100.h:457:25: warning: result of ‘(256 << 8)’ requires 18 bits to represent, but ‘int’ only has 16 bits [-Wshift-overflow=]
#define htons(x) ( (((x)<<8)&0xFF00) | (((x)>>8)&0xFF) )
~^
/Applications/Arduino.app/Contents/Java/libraries/Ethernet/src/Dns.cpp:164:18: note: in expansion of macro ‘htons’
twoByteBuffer = htons(QUERY_FLAG | OPCODE_STANDARD_QUERY | RECURSION_DESIRED_FLAG);
^~~~~
Sketch uses 21348 bytes (8%) of program storage space. Maximum is 253952 bytes.
Global variables use 666 bytes (8%) of dynamic memory, leaving 7526 bytes for local variables. Maximum is 8192 bytes.

Any help much appreciatet!

Try commenting out one of the Blynk.begin(); statements. You have two.

  Blynk.begin(auth);
  // You can also specify server:
  //Blynk.begin(auth, "blynk-cloud.com", 80);
  Blynk.begin(auth, IPAddress(000,000,000,00), 1234);

Thanks a lot, that did it for the Error!

But now after successfully compiling and Uploading, I open the serial monitor and see that it is trying over and over To connect to the pi server. With no success.

I suspect it is the BlynSimpleEthernet.h Library. It is grayed out. I am unable to find it in the archive.
I will try to find it from github and install it manually I guess.

If you mean that in the in the Arduino IDE the library name isn’t highlighted in a colour then this is irrelevant. The colour coding simply relates to how the keywords file is structured in the library.

What exactly does your serial monitor say?

Pete.

[ng to 192.168.178.24
[0] Getting IP…
[5704] IP:192.168.178.38
[5705]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.6.1 on Arduino Mega

[5825] Connecting to 192.168.178.24
[10867] Connecting to 192.168.178.24
[15872] Connecting to 192.168.178.24
[20877] Connecting to 192.168.178.24
[25881] Connecting to 192.168.178.24


192.168.178.38 that is an Air Conditioner
192.168.178.24 is the PiServer with port 9443 open
BlynkiOS App is able to communicate with server but unable to connect to the Mega.