Compilation Failed. Please report this issue on our forum.

had a sketch working fine for several weeks and have been making updates throughout. This morning I tried to compile it on the web editor and got the following error…
“Compilation Failed. Please report this issue on our forum.”

Other older sketches I have still compile fine.

Any thoughts? If not, I’m going to start backing out changes until I find out what I screwed up.

sketch below:

/*
This Sketch uses a 0 - 100 PSI 12V pressure sensor connected to analog pin 1 and the inverted input of an opamp.
The opamp will turn on a 2N2222A NPN transistor, which in turn turn on a relay to powerup the arduino Nano.
On power up the Nano will power a 2N222NPN tranistor, turning on the relay to keep itself powered for
10 minutes or until the water pressure is high enough and then the Nano commands the generator off and kills power to itself.
Used for water pressure control by turning on the remote generator when pressure drops below 30psi
and holding it on until pressure is greater than 59 for 1 minute.

A 315MHz remote controlled by pin 7 on the Arduino is used switch the Generator between modes from HC-05 BLE to HM10 BLE and vice versa.

This sketch requires a linked set of BLE’s between the generator and the pressure sensor.
it uses 2 nano’s one at the generator end (see BLE_remote_gen_9600… sketch)
and one at the pressure sensor (below sketch)

See attached diagram for circuit configuration

Pressure sensor transfer function is linear with 0.5v = 0psi & 4.5v = 100psi.
*/
const int remotePin = 7; //Digital i/o 7 - Turns on remote
const int pwrSustPin = 12; //digital i/o 12 - sustains power after wake up and kills power after repressurizing
int hold = 0;
int stop = 0;
const int pressPin = 1; //Analog input 1
float pressCnts;
float pressVolts;
float pressPSI;
long tmNew = 0;
long tmOld = 0;
long tmr = 0;
int u = 0;
int j = 0;
int high = 0;
long tm1New = 0;
long tm1Old = 0;
long tmr1 = 0;
int start = 1; //issues a start request immediately on power-up

void setup() {
Serial.begin(38400); //set comm baud to HC05 rate
pinMode(remotePin, OUTPUT);
digitalWrite(remotePin, LOW);
pinMode(pwrSustPin, HIGH); // initalize power sustain Pin high to keep power on after a wake up.

delay(10000); //allow 10 sec for module to wake-up and sync BLE’s with Generator
}

void loop() {
tm1New = millis(); //timer to track power up time
if(tm1New - tm1Old > 10000 || tm1New - tm1Old < 0) {
tm1Old = tm1New;
}
tmr1 = tmr1 + tm1New - tm1Old;
tm1Old = tm1New;
/*
if(tmr1 > 2000) { //this is a diagnostic tool meant to be commented out for normal use
tmr1 = 0;
Serial.println(pressPSI);
Serial.println(pressCnts);
}
*/
if(tmr1 > 605000) {
digitalWrite(pwrSustPin, LOW); // shutdown power if on for more than 10 minutes & 5 sec
}

pressCnts = analogRead(pressPin); //read sensor 4 times and average the result to filter noise
pressCnts += analogRead(pressPin);
pressCnts += analogRead(pressPin);
pressCnts += analogRead(pressPin);
pressCnts = pressCnts/4;
if(pressCnts > 103 && pressCnts < 922) { //if sensor reading is in-range, calculate water pressure
pressVolts = pressCnts * 5/1024 - 0.5;
pressPSI = pressVolts * 25;
}
else {pressPSI = 100;} //if out of range, set to 100PSI

if((pressPSI < 30 && hold == 0) || start == 1) { //start generator if water pressure low
start = 0;
high = 0;
tmr = 0;
j = 0;
while(j < 3) { //send start command to generator 3 times to ensure it goes through
Serial.println(“w”);
j++;
delay(50);
}

digitalWrite(remotePin, HIGH); //trigger the remote to change iOS on the gen controller
delay(4000);
digitalWrite(remotePin, LOW);
delay(10000); //allow 10 sec for servo to change states and BLE to sync with Generator

j = 0;
while(j < 3) { //send start command to generator 3 more times to ensure it goes through
Serial.println(“w”);
j++;
delay(50);
}

digitalWrite(remotePin, HIGH); //trigger the remote to change iOS on the gen controller back to starting state
delay(4000); //BLE will change if held for between 3 - 9 seconds
digitalWrite(remotePin, LOW);
delay(500); //allow time for servo to change states

stop = 1; //reset flag to allow stop commands to be send
hold = 1; //prevent sending multiple start requests when pressure low

}
if(pressPSI > 59) { //start timer when pressure gets above 59 psi
high = 1;
}
if(high == 1) {
tmNew = millis();
if(tmNew - tmOld > 1000 || tmNew - tmOld < 0) {
tmOld = tmNew;
}
tmr = tmr + tmNew - tmOld;
tmOld = tmNew;
}
if((tmr > 1000 && stop == 1) || tmr1 > 600000){ //stop generator when tmr exceeds 2 minute change back to 120000 after test or when engine’s been on for 30 minutes
u = 0;
while(u < 3) { //send stop command to generator 3 times to ensure it goes through
Serial.println(“x”);
u++;
delay(50);

}
digitalWrite(remotePin, HIGH); //trigger the remote to change iOS on the gen controller
delay(4000);
digitalWrite(remotePin, LOW);
delay(5000); //allow time for servo to change states and pair with generator BLE

u = 0;
while(u < 3) { //send stop command to generator 3 times to ensure it goes through
Serial.println(“x”);
u++;
delay(50);
}
digitalWrite(remotePin, HIGH); //trigger the remote to change iOS bakc to original state
delay(4000);
digitalWrite(remotePin, LOW);
delay(50); //allow time for servo to change states

stop = 0; //reset stop flag to prevent multiple stop cammands when timer is high
hold = 0; //reset hold flag when pressure is high, so gen can start again when pressure gets low
high = 0; //reset High flag after sending engine stop command
digitalWrite(pwrSustPin, LOW);
}

}

Here's a link to the sketch.

https://create.arduino.cc/editor/yorarider/5392caa0-342f-4679-a7ff-111d550de255

It failed to TRANSFER to my sketchbook but I copied and pasted it from the window into a blank sketch and it compiled fine for a YUN and a UNO.

What board are you using ?
Also check your preferences to see if you have reached your sketch limit.

EDIT
BTW please use CODE TAGS ( </> ) to post sketches as the forum has been known to munge characters.

Thanks, I checked my preferences and it says, I’m only using 4% of my allocated space and only 24 out of a possible 100 sketches, so I don’t see a problem there. I deleted some of my older sketches anyway and it didn’t help. Other sketches compile just fine, so I think it’s something in this sketch.

I’ve seen this note before “Use CODE TAGS (</>)”, but I don’t really understand what that means or how to use it.

Here’s the link to my sketch.
https://create.arduino.cc/editor/yorarider/5392caa0-342f-4679-a7ff-111d550de255

There are quite a few posts regarding how to use code tags so I will let you find that instead of just repeating it here.

So as I said it compiles fine here but what do you have in those other tabs as they may be the clue.

HERE IS YOUR SKTECH

Thank You, That was the problem. I'd attached a jpg that must have gotten corrupted during the upload. I deleted it and now it compiles fine

Thanks for the help. :slight_smile:

Yes big picture files do cause problems and It was witnessed during testing.
Your best option is to re-size them considerably.
I cannot remember the optimum size bit if I do I will post back here.
Would be nice if the editor did an auto re-size but I think that would take time.

Also keep the amount of pictures to a minimum too.

Thanks Again. The JPG was only 33k (circuit diagram), but during the upload the screen froze and something went wrong. I was in the middle of something else at the time and ignored it, but when I got back to it hours later the screen was unfrozen and everything looked ok on the surface, so i forgot about it and moved on with edits. It was later that day that I tried to compile and ran into the problems. To fix the issue I just deleted the tab with the jpg and reloaded it (same file, but I changed the name... don't know if that mattered or not) and all is well.

It would be nice if the compiler provided a clue in the output window as to what the problem is, but I'm just happy to be up and running again.

Also seen that during testing where it seems to wait forever.

Even if you get a few pictures in OK it can still slow down CREATE itself later when compiling etc.
Certainly something to keep an eye on.

33k should not have tripped it that way though as I managed much larger pictures than that but suffered later as mentioned.

Will see if I can awake the issue on Monday when they get back but no promises as they are exceptionally busy.