#include "application.h" error preventing setup of arduino mega

I’m sure I am being an idiot, but I have tried the troubleshooting document and I am not sure what to do next.

I am trying to set up an arduino mega with a 5100 ethernet shield. I have got the hardware connected, downloaded the ide, downloaded the Cayenne library and installed it. In my sketch I have included the cayenne library. When I click compile I receive an error message:

In file included from C:<somelocalpath>\Arduino\megatest1\megatest1.ino:2:0:

C:<somelocalpath>\Arduino\libraries\Cayenne/BlynkApiParticle.h:15:25: fatal error: application.h: No such file or directory

#include “application.h”

                     ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

Would anyone be able to say what is causing this message? It seems to be that something I am doing is not liking the Cayenne library as it errors out before the example sketch I included from the website as instructed.

I have tried uninstalling and reinstalling the cayenne library, rolling it back to the previous version and manually unzipping it into the relevant directory, but none of these seem to fix it. Please forgive my complete lack of technical knowhow here, today is my first hands on experience with anything arduino!

many thanks in advance,
James

No problem James! This is a no judgement community :slight_smile: We all started out where you are starting, I’m excited for you!

So once you download the cayenne library, you don’t need to manually add it to your sketch file. It can sort of automatically be referenced. All you should need to do is go through the add device process for Arduino and copy/paste the code into your Arduino IDE, then your Arduino should come online.

Keep me updated with your progress, you can also check out the Cayenne docs section if you want step by step on how to get started with Ardiuno. Again, welcome aboard!

-B

Many thanks for your help bestes, It really was clear looking back with hindsight lol! Still I greatly appreiate being able to get going that bit quicker.

I am having the exact same issue. I have tried what you recommend but I get the error that it can’t find the file application.h from the BlynkApiParticle.h called by EthernetShieldW5100.ino I am trying to compile the example sketch. I can’t even just compile the library w/o this error. I have tried commenting out #include(s) and the problem just shifts from one file to another. I have tried taking out what looked like the extraneous libraries to no avail. Any ideas what I can try next.

Thanks

Hi @jett,

Can you copy and paste the code you are trying to upload to your Arduino?

-B

Here you go. It is only the libraries included when I click Sketch → Include Libraries → Cayenne
I have replace the hash sign with blsign text and greater than symbol and less than symbol with their text

lbsign include LessThan [BlynkApiArduino.h] GreaterThan
lbsign include LessThan [BlynkApiParticle.h] GreaterThan
lbsign include LessThan [BlynkParticle.h] GreaterThan
lbsign include LessThan [BlynkSimpleCC3000.h] GreaterThan
lbsign include LessThan [BlynkSimpleEnergiaWiFi.h] GreaterThan
lbsign include LessThan [BlynkSimpleEsp8266.h] GreaterThan
lbsign include LessThan [BlynkSimpleEsp8266_SSL.h] GreaterThan
lbsign include LessThan [BlynkSimpleEthernet.h] GreaterThan
lbsign include LessThan [BlynkSimpleEthernet2.h] GreaterThan
lbsign include LessThan [BlynkSimpleEthernetV2_0.h] GreaterThan
lbsign include LessThan [BlynkSimpleIntelEdisonWiFi.h] GreaterThan
lbsign include LessThan [BlynkSimpleLinkItONE.h] GreaterThan
lbsign include LessThan [BlynkSimpleParticle.h] GreaterThan
lbsign include LessThan [BlynkSimpleRBL_CC3200.h] GreaterThan
lbsign include LessThan [BlynkSimpleRBL_WiFi_Mini.h] GreaterThan
lbsign include LessThan [BlynkSimpleRedBear_Duo.h] GreaterThan
lbsign include LessThan [BlynkSimpleSerial.h] GreaterThan
lbsign include LessThan [BlynkSimpleShieldEsp8266.h] GreaterThan
lbsign include LessThan [BlynkSimpleShieldEsp8266_HardSer.h] GreaterThan
lbsign include LessThan [BlynkSimpleShieldEsp8266_SoftSer.h] GreaterThan
lbsign include LessThan [BlynkSimpleTinyDuino.h] GreaterThan
lbsign include LessThan [BlynkSimpleTI_CC3200_LaunchXL.h] GreaterThan
lbsign include LessThan [BlynkSimpleTI_TivaC_Connected.h] GreaterThan
lbsign include LessThan [BlynkSimpleUIPEthernet.h] GreaterThan
lbsign include LessThan [BlynkSimpleUserDefined.h] GreaterThan
lbsign include LessThan [BlynkSimpleWifi.h] GreaterThan
lbsign include LessThan [BlynkSimpleWiFiShield101.h] GreaterThan
lbsign include LessThan [BlynkSimpleWiFiShield101_SSL.h] GreaterThan
lbsign include LessThan [BlynkSimpleWiFly.h] GreaterThan
lbsign include LessThan [BlynkSimpleWildFire.h] GreaterThan
lbsign include LessThan [BlynkSimpleYun.h] GreaterThan
lbsign include LessThan [BlynkWidgets.h] GreaterThan
lbsign include LessThan [CayenneClient.h] GreaterThan
lbsign include LessThan [CayenneDefines.h] GreaterThan
lbsign include LessThan [CayenneEthernet.h] GreaterThan
lbsign include LessThan [CayenneEthernetClient.h] GreaterThan
lbsign include LessThan [CayenneEthernetW5200.h] GreaterThan
lbsign include LessThan [CayenneEthernetW5500.h] GreaterThan
lbsign include LessThan [CayenneSerial.h] GreaterThan
lbsign include LessThan [CayenneTemperature.h] GreaterThan
lbsign include LessThan [CayenneTMP102.h] GreaterThan
lbsign include LessThan [CayenneTypes.h] GreaterThan
lbsign include LessThan [CayenneVCNL4000.h] GreaterThan
lbsign include LessThan [CayenneWiFi.h] GreaterThan
lbsign include LessThan [CayenneWiFi101.h] GreaterThan
lbsign include LessThan [CayenneWiFiClient.h] GreaterThan
lbsign include LessThan [CayenneYun.h] GreaterThan
lbsign include LessThan [WidgetBridge.h] GreaterThan
lbsign include LessThan [WidgetLCD.h] GreaterThan
lbsign include LessThan [WidgetLED.h] GreaterThan
lbsign include LessThan [WidgetRTC.h] GreaterThan
lbsign include LessThan [WidgetSD.h] GreaterThan
lbsign include LessThan [WidgetTerminal.h] GreaterThan

void setup() {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:

}

I get this error:
Arduino: 1.6.4 (Windows 8.1), Board: “Arduino Uno”

In file included from CayenneWANShield.ino:2:0:
C:\Users\Admin\Documents\Arduino\libraries\Cayenne/BlynkApiParticle.h:15:25: fatal error: application.h: No such file or directory
#include “application.h”
^
compilation terminated.
Error compiling.

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

Hi @jett,

Okay I think I see what is going on. So once you’ve download the Cayenne library to your IDE, you don’t need to actually go and add the entire library to your sketch file when you upload code to your board. Rather than try and explain, I hope is okay if I direct you to a getting started video that I created for Arduino.

If you go to your account you can copy and paste the code given to you :slight_smile:

Hope this helps, keep us updated!

-B

I did try that per another post: Here is the sketch and the error:
/*
Cayenne Ethernet Example

This sketch connects to the Cayenne server using an Arduino Ethernet Shield W5100
and runs the main communication loop.

The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.

Steps:

  1. Set the token variable to match the Arduino token from the Dashboard.
  2. Compile and upload this sketch.

For Cayenne Dashboard widgets using digital or analog pins this sketch will automatically
send data on those pins to the Cayenne server. If the widgets use Virtual Pins, data
should be sent to those pins using virtualWrites. Examples for sending and receiving
Virtual Pin data are under the Basics folder.
*/

//#define CAYENNE_DEBUG // Uncomment to show debug messages
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneEthernet.h>

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token = “AuthenticationToken”;

void setup()
{
Serial.begin(9600);
Cayenne.begin(token);
}

void loop()
{
Cayenne.run();
}

Error:
Arduino: 1.6.4 (Windows 8.1), Board: “Arduino Uno”

Build options changed, rebuilding all

In file included from C:\Users\Admin\Documents\Arduino\libraries\Cayenne/CayenneEthernet.h:24:0,
from EthernetShieldW5100.ino:21:
C:\Users\Admin\Documents\Arduino\libraries\Cayenne/BlynkSimpleEthernet.h:18:22: fatal error: Ethernet.h: No such file or directory
#include <Ethernet.h>
^
compilation terminated.
Error compiling.

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

I turned on verbose logging and this is what I get. In case it is helpful.

Build options changed, rebuilding all
Using library Cayenne in folder: C:\Users\Admin\Documents\Arduino\libraries\Cayenne

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10604 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Users\Admin\Documents\Arduino\libraries\Cayenne C:\Users\Admin\AppData\Local\Temp\build1142733671237944690.tmp\EthernetShieldW5100.cpp -o C:\Users\Admin\AppData\Local\Temp\build1142733671237944690.tmp\EthernetShieldW5100.cpp.o
In file included from C:\Users\Admin\Documents\Arduino\libraries\Cayenne/CayenneEthernet.h:24:0,
from EthernetShieldW5100.ino:21:
C:\Users\Admin\Documents\Arduino\libraries\Cayenne/BlynkSimpleEthernet.h:18:22: fatal error: Ethernet.h: No such file or directory
#include <Ethernet.h>
^
compilation terminated.
Error compiling.

Hmmm. Where did you get that code? It looks like it is missing an important line of text…specifically the #include <CayenneEthernet.h> Can you copy and paste the code I’ve provided below to try? You’ll have to input your own Auth Token.

/*
Cayenne Ethernet Example

This sketch connects to the Cayenne server using an Arduino Ethernet Shield W5100
and runs the main communication loop.

The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.

Steps:
1. Set the token variable to match the Arduino token from the Dashboard.
2. Compile and upload this sketch.

For Cayenne Dashboard widgets using digital or analog pins this sketch will automatically
send data on those pins to the Cayenne server. If the widgets use Virtual Pins, data
should be sent to those pins using virtualWrites. Examples for sending and receiving
Virtual Pin data are under the Basics folder.
*/

//#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneEthernet.h>

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "AuthenticationToken";

void setup()
{
	Serial.begin(9600);
	Cayenne.begin(token);
}

void loop()
{
	Cayenne.run();
}

So right now I am simply trying to get the sketch to build. I just copied and pasted the code you included and I am still getting an error just building the sketch. I’m not trying to upload it to my Arduino yet. Anyway, here’s the error text:

In file included from C:\Users\Admin\Documents\Arduino\libraries\Cayenne/CayenneEthernet.h:24:0,
_ from EthernetShieldW5100.ino:21:_
C:\Users\Admin\Documents\Arduino\libraries\Cayenne/BlynkSimpleEthernet.h:18:22: fatal error: Ethernet.h: No such file or directory
_ #include <Ethernet.h>_
_ ^_
compilation terminated.
Error compiling.