(Solved) GSM controller errors modifying original code

Hi i have been trying for several days to modify this great controller code i found here https://www.instructables.com/id/Arduino-Based-GSMSMS-Remote-Control-Unit/ i have several projects that i'd like a gsm controller with remotely changeable functions for ranging from a multi zone heating extension controller to a basic gate lock controller which i'm starting with now.

i was able to write my own simple codes using AT commands however i spent several days trying to get my head around how to pull settable variables such as output channels and timer variables or delays from received SMS messages, so to try and make things easier for myself i found the instructable linked above which works fine as it is however i would like to change several things about it such as i don't need 4 inputs and outputs for this project i also wanted to remove things such as the pulse timers to reduce the code size and allow me to monitor a battery voltage and temperature etc.

so i went to work in my usual way of pulling out all the functions i don't want one at a time then checking the code still runs but no matter which function i remove i always get not declared errors on every function in this code unless i use it as the original code, i've now spent almost a week trying to modify and replicate this code as it has a lot of functions i really like but it seems however i change it i cant compile.

i cant post the original code as its very long but its in the instructable link at the beginning but im trying to slim down a basic edit enough to post where i tried to pull two of the input and output channels out from 4 to 2 before i try to add anything of my own in so you can see how it fails but i only have to take one function out for it to error even though i check the function doesn't have variables used in other ones, any help in where i'm going wrong would be very much appreciated if i can get this code to post under 9000 characters i will try to send it as an attachment hopefully it works.

2ch_in_out_gsm_module.ino (55.8 KB)

I think that attached OK, so here's the working original controller code as an attachment also.

Thanks

Premade_gsm_relay_controller.ino (69.2 KB)

OK I can help you here but what errors are you getting ?

Forgot to ask what version of the IDE are you using and what board are you targeting

Hi thanks, i'm using 1.8.9 and i want this code to run on a 328p both uno and pro mini.

I can get the original code working in IDE and physically on the arduinos fine but it uses a lot of memory that i will need later and i don't need 4 input and output channels i would also like to add my own functions later.
For now though i'm just simply trying to remove all functions of channels 3 and 4 both input and output but whatever small or big part of the code i remove i get all the voids saying they are not declared in this scope when i try to verify again.

Hmm Ok so before i take your money, start with the original code and make small changes, recompile if it compiles OK then SAVE it, then make some more repeat this up to the point you break it.

Cheers Pete.

That is the way i always modify code i remove a small bit at a time and keep verifying then after i have completed that i start to add my own code in but i find with this particular code once i remove more than a few things related to channel 3 and 4 then the code no longer verifies and returns that all functions are not declared within this scope anymore but i don't understand why.

Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\Sam\Desktop\2ch_in_out_gsm_module\2ch_in_out_gsm_module.ino: In function 'void setup()':

2ch_in_out_gsm_module:140:16: error: 'ReadSettings' was not declared in this scope

ReadSettings();

^

2ch_in_out_gsm_module:144:11: error: 'InitGSM' was not declared in this scope

InitGSM();

^

C:\Users\Sam\Desktop\2ch_in_out_gsm_module\2ch_in_out_gsm_module.ino: In function 'void loop()':

2ch_in_out_gsm_module:176:14: error: 'WaitOK' was not declared in this scope

WaitOK();

^

2ch_in_out_gsm_module:197:25: error: 'Received' was not declared in this scope

if (Received(F("RING")) ) GetCall();

^

2ch_in_out_gsm_module:197:37: error: 'GetCall' was not declared in this scope

if (Received(F("RING")) ) GetCall();

^

2ch_in_out_gsm_module:201:26: error: 'Received' was not declared in this scope

if (Received(F("CUSD:")) ) GetUSSD();

^

2ch_in_out_gsm_module:201:38: error: 'GetUSSD' was not declared in this scope

if (Received(F("CUSD:")) ) GetUSSD();

^

2ch_in_out_gsm_module:205:25: error: 'Received' was not declared in this scope

if (Received(F("CMT:")) ) GetSMS();

^

2ch_in_out_gsm_module:205:36: error: 'GetSMS' was not declared in this scope

if (Received(F("CMT:")) ) GetSMS();

^

2ch_in_out_gsm_module:213:20: error: 'ScanOutputTimers' was not declared in this scope

ScanOutputTimers();

^
etc.

I'm sure i'm missing something simple but its been frustrating me for days as i like the way this code works and i think it gives me the best chance at adding more code to it during my experiments with GSM control.

It has been solved with one simple } :-[ , i feel pretty silly but im glad its fixed now.