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) Visual Studio ESP8266 IDE 1.6.5_Time.h library error! (Read 25379 times)
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Jan 22nd, 2016 at 4:18pm
Print Post  
Visual Studio january 2nd rel.- Ide 1.6.5 - ESP8266 ver. staging 2.0.0 - ( this is the combination of items!)

A Time Library Example (DS1307RTC library) will compile and run on NodeMCU 1.0 board with Arduino 1.6.5 IDE but will compile but not run (boot rst error)
with Visual Micro.

I doubt this may be due to an existing time.h library that is part of the ESP8266 core! The error has been  overcome with a trick (including TimeLib.h rather than Time.h) that may not work with VisulMicro builder.
TimeLib.h is part of another library Time from M.Margolis ver 1.4 that work well with ESP8266. Here the source:
Code (C++)
Select All
/*
  time.h - low level time and date functions
*/

/*
  July 3 2011 - fixed elapsedSecsThisWeek macro (thanks Vincent Valdy for this)
              - fixed  daysToTime_t macro (thanks maniacbug)
*/    


#ifndef _Time_h
#ifdef __cplusplus
#define _Time_h

#include <inttypes.h>
#ifndef __AVR__
#include <sys/types.h> // for __time_t_defined, but avr libc lacks sys/types.h
#endif


#if !defined(__time_t_defined) // avoid conflict with newlib or other posix libc
typedef unsigned long time_t;
#endif


// This ugly hack allows us to define C++ overloaded functions, when included
// from within an extern "C", as newlib's sys/stat.h does.  Actually it is
// intended to include "time.h" from the C library (on ARM, but AVR does not
// have that file at all).  On Mac and Windows, the compiler will find this
// "Time.h" instead of the C library "time.h", so we may cause other weird
// and unpredictable effects by conflicting with the C library header "time.h",
// but at least this hack lets us define C++ functions as intended.  Hopefully
// nothing too terrible will result from overriding the C library header?!
extern "C++" {
typedef enum {timeNotSet, timeNeedsSync, timeSet
}  timeStatus_t ;

typedef enum {
    dowInvalid, dowSunday, dowMonday, dowTuesday, dowWednesday, dowThursday, dowFriday, dowSaturday
} timeDayOfWeek_t;

typedef enum {
    tmSecond, tmMinute, tmHour, tmWday, tmDay,tmMonth, tmYear, tmNbrFields
} tmByteFields;	   

typedef struct  {
  uint8_t Second;
  uint8_t Minute;
  uint8_t Hour;
  uint8_t Wday;   // day of week, sunday is day 1
  uint8_t Day;
  uint8_t Month;
  uint8_t Year;   // offset from 1970;
} 	tmElements_t, TimeElements, *tmElementsPtr_t;

//convenience macros to convert to and from tm years
#define  tmYearToCalendar(Y) ((Y) + 1970)  // full four digit year
#define  CalendarYrToTm(Y)   ((Y) - 1970)
#define  tmYearToY2k(Y)      ((Y) - 30)    // offset is from 2000
#define  y2kYearToTm(Y)      ((Y) + 30)   

typedef time_t(*getExternalTime)();
//typedef void  (*setExternalTime)(const time_t); // not used in this version


*/
/* Useful Constants */
#define SECS_PER_MIN  (60UL)
#define SECS_PER_HOUR (3600UL)
#define SECS_PER_DAY  (SECS_PER_HOUR * 24UL)
#define DAYS_PER_WEEK (7UL)
#define SECS_PER_WEEK (SECS_PER_DAY * DAYS_PER_WEEK)
#define SECS_PER_YEAR (SECS_PER_WEEK * 52UL)
#define SECS_YR_2000  (946684800UL) // the time at the start of y2k

/* Useful Macros for getting elapsed time */
#define numberOfSeconds(_time_) (_time_ % SECS_PER_MIN) 
#define numberOfMinutes(_time_) ((_time_ / SECS_PER_MIN) % SECS_PER_MIN)
#define numberOfHours(_time_) (( _time_% SECS_PER_DAY) / SECS_PER_HOUR)
#define dayOfWeek(_time_)  ((( _time_ / SECS_PER_DAY + 4)  % DAYS_PER_WEEK)+1) // 1 = Sunday
#define elapsedDays(_time_) ( _time_ / SECS_PER_DAY)  // this is number of days since Jan 1 1970
#define elapsedSecsToday(_time_)  (_time_ % SECS_PER_DAY)   // the number of seconds since last midnight
// The following macros are used in calculating alarms and assume the clock is set to a date later than Jan 1 1971
// Always set the correct time before settting alarms
#define previousMidnight(_time_) (( _time_ / SECS_PER_DAY) * SECS_PER_DAY)  // time at the start of the given day
#define nextMidnight(_time_) ( previousMidnight(_time_)  + SECS_PER_DAY )   // time at the end of the given day
#define elapsedSecsThisWeek(_time_)  (elapsedSecsToday(_time_) +  ((dayOfWeek(_time_)-1) * SECS_PER_DAY) )   // note that week starts on day 1
#define previousSunday(_time_)  (_time_ - elapsedSecsThisWeek(_time_))      // time at the start of the week for the given time
#define nextSunday(_time_) ( previousSunday(_time_)+SECS_PER_WEEK)          // time at the end of the week for the given time


/* Useful Macros for converting elapsed time to a time_t */
#define minutesToTime_t ((M)) ( (M) * SECS_PER_MIN) 
#define hoursToTime_t   ((H)) ( (H) * SECS_PER_HOUR) 
#define daysToTime_t    ((D)) ( (D) * SECS_PER_DAY) // fixed on Jul 22 2011
#define weeksToTime_t   ((W)) ( (W) * SECS_PER_WEEK)   


/*  time and date functions   */
int     hour();            // the hour now
int     hour(time_t t);    // the hour for the given time
int     hourFormat12();    // the hour now in 12 hour format
int     hourFormat12(time_t t); // the hour for the given time in 12 hour format
uint8_t isAM();            // returns true if time now is AM
uint8_t isAM(time_t t);    // returns true the given time is AM
uint8_t isPM();            // returns true if time now is PM
uint8_t isPM(time_t t);    // returns true the given time is PM
int     minute();          // the minute now
int     minute(time_t t);  // the minute for the given time
int     second();          // the second now
int     second(time_t t);  // the second for the given time
int     day();             // the day now
int     day(time_t t);     // the day for the given time
int     weekday();         // the weekday now (Sunday is day 1)
int     weekday(time_t t); // the weekday for the given time
int     month();           // the month now  (Jan is month 1)
int     month(time_t t);   // the month for the given time
int     year();            // the full four digit year: (2009, 2010 etc)
int     year(time_t t);    // the year for the given time

time_t now();              // return the current time as seconds since Jan 1 1970
void    setTime(time_t t);
void    setTime(int hr,int min,int sec,int day, int month, int yr);
void    adjustTime(long adjustment);

/* date strings */
#define dt_MAX_STRING_LEN 9 // length of longest date string (excluding terminating null)
char* monthStr(uint8_t month);
char* dayStr(uint8_t day);
char* monthShortStr(uint8_t month);
char* dayShortStr(uint8_t day);

/* time sync functions	*/
timeStatus_t timeStatus(); // indicates if time has been set and recently synchronized
void    setSyncProvider( getExternalTime getTimeFunction); // identify the external time provider
void    setSyncInterval(time_t interval); // set the number of seconds between re-sync

/* low level functions to convert to and from system time                     */
void breakTime(time_t time, tmElements_t &tm);  // break time_t into elements
time_t makeTime(tmElements_t &tm);  // convert time elements into time_t

} // extern "C++"
#endif // __cplusplus
#endif /* _Time_h */

 


I attach verbose out from IDE and from VM.

I am using a may be old Ide and not the last VM rel. but it is very difficult to keep everything updated  with  the best mixture of releases.
For example 1.6.5 is the best IDE for ESP8266 but the library inclusion is much worst the the one of the last IDE 1.6.6+. I may try to use IDE 1.6.7, last ESP8266 core and last VM release but I think this may lead me to new incompatibilities! 
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #1 - Jan 22nd, 2016 at 4:58pm
Print Post  
Hi,

First off please use the latest visual micro but untick the "Visual Micro>Deep Search Includes" menu item.

Deep search is what was released in Arduino 1.6.6 but can be disabled in Visual Micro via the menu

It doesn't matter which version of the arduino ide you use

Thanks
« Last Edit: Jan 22nd, 2016 at 10:22pm by Tim@Visual Micro »  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #2 - Jan 23rd, 2016 at 9:54am
Print Post  
Installed new release....... sorry no changes!

Attached new verbose output.

Look at the comments on Time.h included in my first post ...... 

// This ugly hack allows us to define C++ overloaded functions, when included
// from within an extern "C", as newlib's sys/stat.h does.  Actually it is
// intended to include "time.h" from the C library (on ARM, but AVR does not
// have that file at all).  On Mac and Windows, the compiler will find this
// "Time.h" instead of the C library "time.h", so we may cause other weird
// and unpredictable effects by conflicting with the C library header "time.h",
// but at least this hack lets us define C++ functions as intended.  Hopefully
// nothing too terrible will result from overriding the C library header?!

Couldn.t that be the reason !?

Thanks! Paolo
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #3 - Jan 23rd, 2016 at 1:42pm
Print Post  
Hi,

1)

In the arduino ide please switch on file>preference>verbose then build. Please compare the time.h locations in the verbose outputs from each Ide and let me know where they are being resolved from. This will allow me to understand what is needed.

2)
Maybe useful to tell you that Visual Micro has additional flexibility when it comes to including libraries. This allows you to specify the exact library name that you want to use in the #include. for example

#include "LibA\Time.h"

In the above example LibA is the name of the sketchbook\library folder that you want to use.

Does this help?
  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #4 - Jan 23rd, 2016 at 5:54pm
Print Post  
In both cases IDE 1.6.5 and VMicro the two library:

c2\cores\esp8266\time.c

"d:\users\pbecc\onedrive\Arduino\libraries\Time\Time.cpp"

are compiled and linked!

It is not easy to understand clearly out from vrebose output if there is any difference......

It is probably a duplicate definition of types with VM one type if defined with Ide another one!!
A cannot avoid include of the core "time.c" library and of the types defined there.
And commenting out #include Time.h the example will not compile : there are missing definitions!


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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #5 - Jan 23rd, 2016 at 6:24pm
Print Post  
Please post or email your project code to info[at]visualmicro.com

Also post links to download any libraries your project is using

Thanks
  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #6 - Jan 23rd, 2016 at 10:05pm
Print Post  
I am running the example ReadTest.ino of this library:

http://www.pjrc.com/teensy/td_libs_DS1307RTC.html ;

You should also download Time library from the same site.

The example run on IDE 1.6.5 with a NodeMCU 1.0 board and give error with VM.

You should get the error also without the RTC hardware!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #7 - Jan 24th, 2016 at 5:19pm
Print Post  
I've had a good look at this and can see the problem that would be caused by the new 1.6.6 library resolution system and the Time library.

There are two issues which some further work will prevent.

For now it would be useful if you could try a change that forces the core to build in its own temp folder.

This is a link to the new release (right click and "Save As").

Visual Micro for Visual Studio 1601.25

I tried the example with "Visual Micro>Deep Search Includes" switched OFF. It compiles OK the question is does it run okay.

Alternative for current release

I also found in the current release changing the .ino #include from Time.h to TimeLib.h builds okay but again I haven't tested if the program then runs correctly.

change from

Code
Select All
#include <Wire.h>
#include <Time.h>
#include <DS1307RTC.h>
 




change to

Code
Select All
#include <Wire.h>
#include <TimeLib.h>
#include <DS1307RTC.h>
 





Tip: not forgetting that in Visual Micro you can optionally specify library names:-

Code
Select All
#include <Wire.h>
#include <Time\TimeLib.h>
#include <DS1307RTC\DS1307RTC.h>
 



« Last Edit: Jan 25th, 2016 at 1:39am by Tim@Visual Micro »  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #8 - Jan 25th, 2016 at 5:19pm
Print Post  
Sad 
Hi,

Yes I have already modified all the includes from Time.h to TimeLib.h, but this DO NOT solve the execution problem!

I spent all day try to modify type names to avoid duplication but I get always the same error ....unavoidable!
I am thinking to give up!
Undecided
Can you get me some clue on the reasons and the mods I could do to the DS1307RTC files?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #9 - Jan 25th, 2016 at 5:28pm
Print Post  
Sorry I don't understand. I have provided a link to a ne build above where I have not changed any includes and the example compiles fine.

Did you install it?

And did you switch off "Visual Micro>Deep Search Includes"?
  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #10 - Jan 25th, 2016 at 5:44pm
Print Post  
Sorry but the Installation Link don't work!

It tell me the fine is not VSIX valid file......What's wrong?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #11 - Jan 25th, 2016 at 5:47pm
Print Post  
Did you read the text above that says "Right click and Save As"??

That should work okay.
  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #12 - Jan 25th, 2016 at 5:54pm
Print Post  
Yes 

It download and save a file 

Visual.Micro.Arduino.Studio_beta.vsix

but this is not an installation file|
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #13 - Jan 25th, 2016 at 7:13pm
Print Post  
Sorry the web site is playing up. I have published it to the gallery so you can update via "tools>extensions and updates" or via downloads page.

Just for future info:- With "Deep search includes" OFF - #includes are discovered only from the .ino source.  Therefore the .ino source contains the only references that would have needed to change. This is how everything worked pre Arduino 1.6.6
  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #14 - Jan 25th, 2016 at 8:28pm
Print Post  
I have installed the version 1601.25.0 dated today not the beta that is for atmel studio and is old.

With the new version and deep search off it compile but I still have the error when the execution start. Sad
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #15 - Jan 25th, 2016 at 8:35pm
Print Post  
Okay thanks for the update. I see the order of includes in the compiler statement should have the core includes last. I will update the 1.6.5 and 1.6.6 systems over the next few days so that it will work correctly with both.
  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #16 - Jan 25th, 2016 at 8:45pm
Print Post  
OK thanks......look forward to next release!

I will let you know if it works OK! Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #17 - Jan 25th, 2016 at 8:46pm
Print Post  
Appreciated
  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #18 - Jan 31st, 2016 at 1:47pm
Print Post  
I have installed last update but unfortunately the  DS1307RTC example compile but not run!
I have set Deepsearch off and give folder names in the includes......This time hang after uploading  Sad.......no good!
 
This is the output from build and assembly:
Compiling 'ReadTest' for 'NodeMCU 1.0 (ESP-12E Module)'
Build folder: emcuv2
Summary: Header=1 Prototypes=4 Imports=3
Additional Defines: 
Architecture Tools: cc\1.20.0-26-gb404fb9-2/bin/
Sketchbook: file:\\\d:\users\pbecc\onedrive\Arduino
Sketch Include Paths
Include Path 'D:\Users\pbecc\OneDrive\Arduino\libraries\DS1307RTC-master\examples\ReadTest'
Core Include Paths
Include Path rc2\cores\esp8266'
Include Path rc2\variants\nodemcu'
Library Include Paths (3)
Include Path 'd:\users\pbecc\onedrive\Arduino\libraries\DS1307RTC-master'
Include Path 'd:\users\pbecc\onedrive\Arduino\libraries\Time'
Include Path rc2\libraries\Wire'
Build Core Paths: c2\cores\esp8266
Using library DS1307RTC-master version 1.4 in folder d:\users\pbecc\onedrive\Arduino\libraries\DS1307RTC-master
Using previously compiled file: S1307RTC-master\DS1307RTC.cpp.o
Using library Time version 1.5 in folder d:\users\pbecc\onedrive\Arduino\libraries\Time
Using previously compiled file: ime\DateStrings.cpp.o
Using previously compiled file: ime\Time.cpp.o
Using library Wire version 1.0 in folder c2\libraries\Wire
Using previously compiled file: ire\Wire.cpp.o
Using previously compiled file: eadTest.cpp.o
gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc" -g -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static 0-rc2/tools/sdk/lib" 0-rc2/tools/sdk/ld" "-Teagle.flash.4m.ld" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy -o ReadTest.ino.elf" -Wl,--start-group DS1307RTC-master\DS1307RTC.cpp.o" Time\DateStrings.cpp.o" Time\Time.cpp.o" Wire\Wire.cpp.o" ReadTest.cpp.o" core.a" -lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig -lwps -lcrypto -laxtls -Wl,--end-group 2"
tool.exe" -eo rc2/bootloaders/eboot/eboot.elf" -bo ReadTest.ino.bin" -bm dio -bf 40 -bz 4M -bs .text -bp 4096 -ec -eo ReadTest.ino.elf" -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec
Binary sketch size: 206.508 bytes (used 20% of a 1.044.464 byte maximum) (2,27 secs)
Minimum Memory Usage: 33554 bytes (41% of a 81920 byte maximum)
 
Uploading to I/O board using 'COM4'
Uploader started for board NodeMCU 1.0 (ESP-12E Module)
Upload method will be: bootloader
Uploading via Bootloader 
ool.exe -vv -cd nodemcu -cb 115200 -cp "COM4" -ca 0x00000 -cf eadTest.ino.bin
esptool v0.4.6 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
     setting board to nodemcu
     setting baudrate from 115200 to 115200
     setting port from COM1 to COM4
     setting address from 0x00000000 to 0x00000000
     espcomm_upload_file
     stat eadTest.ino.bin success
     setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
     flush start
     setting serial port timeouts to 1 ms
     setting serial port timeouts to 1000 ms
     flush complete
     espcomm_send_command: sending command header
     espcomm_send_command: sending command payload
     read 0, requested 1
trying to connect
     flush start
     setting serial port timeouts to 1 ms
     setting serial port timeouts to 1000 ms
     flush complete
     espcomm_send_command: sending command header
     espcomm_send_command: sending command payload
     espcomm_send_command: receiving 2 bytes of data
     espcomm_send_command: receiving 2 bytes of data
     espcomm_send_command: receiving 2 bytes of data
     espcomm_send_command: receiving 2 bytes of data
     espcomm_send_command: receiving 2 bytes of data
     espcomm_send_command: receiving 2 bytes of data
     espcomm_send_command: receiving 2 bytes of data
     espcomm_send_command: receiving 2 bytes of data
     espcomm_open
Uploading 210656 bytes from eadTest.ino.bin to flash at 0x00000000
     erasing flash
     size: 0336e0 address: 000000
     first_sector_index: 0
     total_sector_count: 52
     head_sector_count: 16
     adjusted_sector_count: 36
     adjusted_size: 024000
     espcomm_send_command: sending command header
     espcomm_send_command: sending command payload
     setting serial port timeouts to 10000 ms
     setting serial port timeouts to 1000 ms
     espcomm_send_command: receiving 2 bytes of data
     writing flash
Done uploading
..............................................
starting app without reboot
     espcomm_send_command: sending command header
     espcomm_send_command: sending command payload
     espcomm_send_command: receiving 2 bytes of data
closing bootloader
     flush start
     setting serial port timeouts to 1 ms
     setting serial port timeouts to 1000 ms
     flush complete
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #19 - Jan 31st, 2016 at 2:03pm
Print Post  
Hi thanks for update,

The upload hasn't changed and the upload is imply an esp8266 .exe command which should match what we see in the arduino ide > verbose. 

Only the order or -I includes for the compiler has changed and that will not affect upload.

I will do some testing with esp8266 but this issue might simply be the windows usb driver has an issue. Did you try unplugging and reconnecting the board? Different pc usb port or pc restart.

Is arduino uploading okay?
  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #20 - Jan 31st, 2016 at 4:53pm
Print Post  
Thanks for your fast replay!
If I upload other sketches, not using that library DS1307RTC , I don't have any problem both with Visual Micro and with Arduino IDE!
This should means that the USB interface and the drivers are OK!
This issue is strictly related to that library and to the platform ESP8266.
   The ESP8266 core github site advise to use another Real Time Clock library to avoid conflicts with core/time.c !
       But using 1.6.5 IDE I don't have any conflict and RTC1307RTC  is a much widely used and complete library.
  
Back to top
 
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #21 - Jan 31st, 2016 at 6:29pm
Print Post  
I have found the code inside the library that generate the problem  Smiley:

The DS1307RTC.cpp at the end contain the statement:

DS1307RTC RTC = DS1307RTC(); // create an instance for the user

If I delete the statement from library code and I put it as a normal declaration at the beginning of the .ino file it run like a charm!!

But don't ask me why!?

Why this can be done in IDE 1.6.5 and not with VisualMicro???
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #22 - Jan 31st, 2016 at 6:32pm
Print Post  
Useful thanks. I will look at the difference between arduino and visual micro.

Are you using a standard DS130RTC example? Which one?
  
Back to top
IP Logged
 
paolo48
Junior Member
**
Offline


Posts: 69
Joined: Dec 22nd, 2015
Re: Visual Studio ESP8266 IDE 1.6.5_Time.h library error!
Reply #23 - Jan 31st, 2016 at 6:45pm
Print Post  
I used ReadTest.ino : moved declaration from .cpp to .ino!!

It works and it is an easy fix!! Smiley

To have an instance declaration inside the library is unusual....
but.... 

Let me know if you find the reason of those problems!

Anyhow I can move ahead! Wink
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 
Send TopicPrint