Getting an "expected } at end of input error" in Remote Start code

Hi all, ive been chipping away at this code cleaning up errors and i feel im close to the end, but this error has me stumped, here is the full error log.

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

C:\Users\mattm\Documents\Arduino\6.5RSv2.1\6.5RSv2.1.ino: In function 'void loop()':

6.5RSv2.1:250:9: error: expected '}' at end of input

} //Repeat program (look for start command)

^

6.5RSv2.1:250:9: error: expected '}' at end of input

6.5RSv2.1:250:9: error: expected '}' at end of input

6.5RSv2.1:250:9: error: expected '}' at end of input

Multiple libraries were found for "WiFi.h"

Used: C:\Users\mattm\Documents\ArduinoData\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi

Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries\WiFi

exit status 1

expected '}' at end of input

Any help or tips in the right direction would be greatly appreciated!

6.5RSv2.1.ino (10.6 KB)

At the very least, you are missing one or more } at the end of the loop() function

Auto Format the code in the IDE and all function definitions, such as this

       //Begin function: Turn on accessory and ignition
        void begin();

and

       void wts();
        {

should be on the left margin

A question for you. Why are you calling the loop() function in your sketch ?

I can't see the code, void wts();but those semicolons worry me

UKHeliBob:
At the very least, you are missing one or more } at the end of the loop() function

Auto Format the code in the IDE and all function definitions, such as this

       //Begin function: Turn on accessory and ignition

void begin();



and


void wts();
       {



should be on the left margin


A question for you. Why are you calling the loop() function in your sketch ?

That makes sense, ill give auto format a try. The loop function is supposed to return the program to the begining in the event the start sequence fails at any point during the program. Am I using the wrong function for this purpose?

TheMemberFormerlyKnownAsAWOL:
I can't see the code,

  void wts();

but those semicolons worry me

Im trying to post the full code but it wont allow it, says max 9000 characters

Whatever the limit, I don't like the look of those semicolons.

When i remove the semi colons it says that "a function definition is not allowed before a { token"

I attached a copy of the ino file if that helps at all

6.5RSv2.1.ino (11.6 KB)

OK, now I'm at a PC now

The C++ dialect used by Arduino doesn't allow you to define a function inside another function.

Hint: If, after using the auto-format tool, your function definitions don't start on the extreme left margin, you've done something wrong.

Also, unlimited recursive calls are not generally A Good ThingTM

That makes sense, would that be possible in the esp32 idf? Or is there some other way to call on functions within a function.

Thanks for that tip too I can see that theres more of an issue than i thought

TheMemberFormerlyKnownAsAWOL:
OK, now I'm at a PC now

The C++ dialect used by Arduino doesn't allow you to define a function inside another function.

Hint: If, after using the auto-format tool, your function definitions don't start on the extreme left margin, you've done something wrong.

Also, unlimited recursive calls are not generally A Good ThingTM

After adding and removing some brackets in places and another few snippets that didnt belong, the code finally compiles! Im not sure if it will work 100% yet, but my issues has been solved for now, thank you for all your help!!!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.