Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Portenta Async Web Server compile issues (Read 3783 times)
rs 77tmp
Junior Member
**
Offline


Posts: 22
Joined: Apr 20th, 2022
Portenta Async Web Server compile issues
May 30th, 2022 at 11:59pm
Print Post  
I have a 3 source file project (and 2 headers). It compiles OK in Arduino IDE 1.8, but I get error messages in VisualMicro.

The errors mention a variable that is declared void, however on the output display, it is showing the text from the base file.

Another word it is complaining about a non-existent error in .ino file B, but is showing text from .ino file A in the output

I am using the library

#include <Portenta_H7_AsyncWebServer.h>

and I declare the function

void handleRoot(AsyncWebServerRequest *request);

this is what gives the error


sample error below

Compiling 'EnviroWatch' for 'Arduino Portenta H7 (M7 core)                                                                                          (envie_m7)'
 
EnviroWatch.ino: 50:17: error: variable or field 'handleRoot' declared void
   rtos*: ThisThread::sleep_for(osWaitForever)
   ^~~~~~~~~~~~~~~~~~~~~
 
EnviroWatch.ino: 50:17: error: 'AsyncWebServerRequest' was not declared in this scope
 
EnviroWatch.ino: 50:40: error: 'request' was not declared in this scope
   rtos*: ThisThread::sleep_for(osWaitForever)
   ^~~~~~
EnviroWatch.ino:50: note  suggested alternative  equeue
   rtos*: ThisThread::sleep_for(osWaitForever)
   ^~~~~~
   equeue
« Last Edit: Aug 30th, 2022 at 11:23pm by rs 77tmp »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Portents Async Web Server compile issues
Reply #1 - May 31st, 2022 at 11:17am
Print Post  
Thanks for the report.

To ensure we are using the correct library versions, and board package versions, please enable the options shown at the top of the page, and attach the full build output.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Portents Async Web Server compile issues
Reply #2 - Jun 2nd, 2022 at 8:04pm
Print Post  
Thanks for the output. Please switch on both "compile verbose" and "show build properties" then send again.

Thanks
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Portents Async Web Server compile issues
Reply #3 - Jun 3rd, 2022 at 9:07pm
Print Post  
Thanks for sending the output again. 

Please switch off debugging and also set optimization to default.

If that fails please send the output again.

  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Portents Async Web Server compile issues
Reply #4 - Jun 5th, 2022 at 4:47pm
Print Post  
Thanks for the output. Please zip and email this file
Code
Select All
C:\Users\[your name]\AppData\Local\Temp\VMBuilds\EnviroWatch\envie_m7\Debug\EnviroWatch.cpp
 


Thanks
« Last Edit: Jun 5th, 2022 at 4:48pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
rs 77tmp
Junior Member
**
Offline


Posts: 22
Joined: Apr 20th, 2022
Re: Portents Async Web Server compile issues
Reply #5 - Jun 6th, 2022 at 12:03am
Print Post  
There is none - it is a ,ino file - I will send that instead
  
Back to top
 
IP Logged
 
rs 77tmp
Junior Member
**
Offline


Posts: 22
Joined: Apr 20th, 2022
Re: Portents Async Web Server compile issues
Reply #6 - Jun 6th, 2022 at 12:04am
Print Post  
Missed that it was in the Appdata directory - will send that - sorry
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Portents Async Web Server compile issues
Reply #7 - Jun 6th, 2022 at 12:40pm
Print Post  
Move the code below to the same location as the other #includes such as #include <Wire.h>

Code
Select All
#if !( defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) )
#error For Portenta_H7 only
#endif

#define _PORTENTA_H7_AWS_LOGLEVEL_     1

#define USE_ETHERNET_PORTENTA_H7        true

#include <Portenta_Ethernet.h>
#include <Ethernet.h>
#warning Using Portenta_Ethernet lib for Portenta_H7.

#include <Portenta_H7_AsyncWebServer.h>
#include <string>  



The automatic prototype generation is having a problem working out where to add the prototypes because there are #includes and then code and then more #includes. In that case the prototypes are placed after the 1st valid code which is before the #include <Portenta_H7_AsyncWebServer.h> . That is a problem.

  
Back to top
WWW  
IP Logged
 
rs 77tmp
Junior Member
**
Offline


Posts: 22
Joined: Apr 20th, 2022
Re: Portents Async Web Server compile issues
Reply #8 - Jun 6th, 2022 at 9:45pm
Print Post  
The code above is in the file EthernetInterface.ino

The wire.h etc includes are in the file Envirowatch.ino

I cannot move them completely - but could create a separate .h file and lump them together. Some are not required in some files however.

What would be the best avenue?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Portents Async Web Server compile issues
Reply #9 - Jun 6th, 2022 at 10:10pm
Print Post  
Thanks

You can avoid the issue by adding your own prototypes after the relevent includes and before the methods and user types are used.

You probably only have to add the prototypes that are causing an issue which I think is just the first three. However these are the ones from the "combined .ino." .cpp that you sent. Visual Micro won't add them if you have done so already. The prototypes should be exactly the same as the funtion sugnature followed by a semi-colon ;

void handleRoot(AsyncWebServerRequest *request);
void handleNotFound(AsyncWebServerRequest *request);
void drawGraph(AsyncWebServerRequest *request);
void EthernetThread();
void InitializeSensors();
void Read_TMP117Sensor();
void Read_SHTC3Sensor();
void Read_SGP40Sensor();
void Read_FS3000Sensor();
void Read_OZONESensor();
void DoSumAndHourCalc();

« Last Edit: Jun 6th, 2022 at 10:11pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
rs 77tmp
Junior Member
**
Offline


Posts: 22
Joined: Apr 20th, 2022
Re: Portents Async Web Server compile issues
Reply #10 - Jun 6th, 2022 at 11:43pm
Print Post  
Things are jumbled together.

The code abovem never appears in Envirowatch.ino

Some of the definitions are in EthernetInterface.ino (the first 3), and the rest are in SensorArray.ino

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Portents Async Web Server compile issues
Reply #11 - Jun 7th, 2022 at 7:06am
Print Post  
You can neatly put each prototypes wherever you want. Put them in the right files or in the project name.in
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Portents Async Web Server compile issues
Reply #12 - Jun 7th, 2022 at 7:06am
Print Post  
You can neatly put each prototype wherever you want. Put them in the right files or in the project name.ino
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint