Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



sketch too big erro...
 
Share:
Notifications
Clear all

[Solved] sketch too big error attempting to verify/compile project

69 Posts
2 Users
0 Reactions
24.2 K Views
 tvr4
(@tvr4)
Estimable Member
Joined: 5 years ago
Posts: 122
Topic starter  
Posted by: @hans

.....

So the original code is the same as (in your previous post - you'll see the code below is much easier to read):

....

You are so right, it is MUCH easier to read and understand.  The shorthand code from the example I started with was really confusing.

I have changed the code so it is more standard.  I will test the date change later tonight.  This was in case I want to run my RC cars at midnight the data logger will work properly.

 


   
ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 5 years ago
Posts: 122
Topic starter  

For some reason the sketch still displays the time before a successful GPS time is displayed through the GPS_Timezone_Adjust function. 


   
ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 5 years ago
Posts: 122
Topic starter  

Part of the problem is that I misunderstood the while loop testing ss.available

I thought this was to wait until the number of satellites was greater than 0, i.e. successful acquiition.

I did some looking at the TinyGPS++ library page and ss. available returns the number of bytes available to read from the GPS module

If the while loop tests for ss,available ==1 then is proceeds to the time adjust and displays the data & time.
If I use any value other than this it never displays and data


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2822
 

Keeping the code clean and organized is definitely helpful when debugging.
The preferred formatting is totally up to you of course, and ... the formatting and comments do not impact the compiled the result.
It just makes it much easier to read ... 
This is why I tend to avoid using shorthand code.

I didn't know what ss.available would do either haha.
I figured it meant available sats, like you did 😋 

One thing I was wondering about; do you need to apply the timezone adjustment each time?
Or does the GPS module have some sorts of internal realtime clock that needs to be adjusted only once?

Technically, the Arduino doesn't seem to have a "real" internal clock. Just a counter that counts from the second you turn on an Arduino (if I recall correctly).

p.s. Not having memorized every detail, but did you see this article?
It seems to set the internal Arduino clock (?) each time a new time/date becomes available and adjusts it to the relevant timezone.

p.s. Using "ss.available ==1" is maybe too strict. You many want to try "ss.available>0" instead - just in case there is more than one byte of data available.


   
ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 5 years ago
Posts: 122
Topic starter  

Wow I did not come across that article.  Looks like they wrote it for me. THANKS!

I did try "ss.available>0" but it never ran the time adjust.  It just displayed "waiting for sats" and that was it

Good question about running the time adjust.  I don't know if it needs to be run every time.
The tutorial where I found the time adjust function had it that way so I just left it alone

Now that the time adjust problem seems to be fixed, I need to look at the display issue


   
ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 5 years ago
Posts: 122
Topic starter  

I changed the code slightly so that it only displays the date and time if there is a successful satellite acquisition.

It should display "waiting for sats" until a successful GPS signal is received, then and only then, it should start displaying the time.

This code did not work as expected. It does display "waiting for sats" until the number of satellites is greater than 0,
i.e. successful acquisition.

However, it still displays the generic time and date, 1-1-1970 and 12:00:00 AM, for a while until the time adjust kicks in
and displays local time and date.

 

Code is below
------------------

GPS_Timezone_Adjust(); // Call Time Adjust Function

//only print date and time if successful satellite acquisition
if (gps.satellites.value() > 0){
ClockDisplay(); //Call function to display Date and Clock
}
else{
tft.setCursor(5,8);
tft.print(" Waiting for Sats");
}


   
ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 5 years ago
Posts: 122
Topic starter  

I removed the above code since it was not working.  It tool much longer to display the time and it started displaying the time before a successful time signal was received.

However, I learned quite a bit yesterday

1) Fixed screen flicker by removing fill-display ( per your suggestion)

2) The TFT edge displayed garbage instead of fill color (in this case black)
I thought the display was defective.  It also reversed some colors

3) Fixed it by changing the initR(INIT_GREENTAB) to initR(INITR_BLACK LABEL)
After some research I discovered that the label on the display may not indicate
the correct initialization even when it is an original Adafruit module.

I still need to work on the time display and waiting for sats issus
Current code is attached

 


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2822
 

Awesome! We're making good progress! 👍 

As for the display garbage: I recall something like that from the display I used several years ago.
The "commands" to initialize the slightly different models seem to be quite different as well (low level code, nothing to worry about, you already caught it with a different init value).

So what's left? 😋 


   
ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 5 years ago
Posts: 122
Topic starter  

True.  Progress and learning.  Can't beat it.

I need to figure out how to stop it from displaying the time until it receives a successful GPS signal.

The posted code displays the pre-init date and time 1-1-1970 and 12:00:00 for a while until it starts displaying the correct time


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2822
 

I was just looking closer at your code;

You could do this for the "ClockDisplay();" function:

if the year < 2000 then display "Time:  --:--:-- --", so the code change from

if(hourFormat12() < 10){
tft.print("0");
}
tft.print(hourFormat12());
tft.print(":");

if(minute() < 10){
tft.print("0");
}
tft.print(minute());
tft.print(":");

if(second() < 10){
tft.print("0");
}
tft.print(second());


//print AM or PM
if (isAM()) {
tft.println(" AM ");
} else {
tft.println(" PM ");
}

to

if(year<2000) {

  tft.print("--:--:-- --");

}

else

{

  if(hourFormat12() < 10){ 
    tft.print("0");
  }
  tft.print(hourFormat12());
  tft.print(":");

  if(minute() < 10){
    tft.print("0");
  }
  tft.print(minute()); 
  tft.print(":");

  if(second() < 10){
    tft.print("0"); 
  }
  tft.print(second());

  //print AM or PM
  if (isAM()) {
    tft.println(" AM ");
  } else {
    tft.println(" PM ");
  }

}

You may want to do that for the raw GPS date/time as well (if(gps.date.year()<2000) { ... } else { the current code } ) .

Of course, if you don't want anything to be displayed, you could do this - simply leave the ClockDisplay function if the GPS year is less than 2000. Which is the same as the GPS has not yet received proper data - not enough sats acquired.

void ClockDisplay(){
if(gps.date.year()<2000) { return; } // leave this function if no GPS date has been acquired
  //Serial.println("ClockDisplay");
  //tft.print(".");
  //tft.fillScreen(ST7735_BLACK);
  //tft.setCursor(4, 7);
  tft.setCursor(5, 8);

  ... // etc.

   
ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 5 years ago
Posts: 122
Topic starter  

@hansGreat ideas.  I really like the idea of some type of feedback --:--:-- until there is a successful signal

I will take a look at this right away.  THANKS


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2822
 

You're welcome 🙂  


   
ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 5 years ago
Posts: 122
Topic starter  

I may have found the problem.  Now what I am getting more familiar with the code, I noticed that there was a call to the ClockDisplay inside the AdjustTime function. 

I had added a second call to the ClockDisplay function to the mail loop. So all the tinkering I was doing was not effecting the clock display that really mattered. 

I am going to test this further


   
ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 5 years ago
Posts: 122
Topic starter  

Are you familiar with these ESP32 development boards?
https://heltec.org/project/wifi-lora-32/

I bought one since it looks very promising for many projects.  It has a builtin OLED display, WiFi and bluetooth.
Plus it has a high clock speed and lots of memory.

Unfortunately there is confusing documentation and the seller I bought it from is not very helpful.

I want to know if I can connect a GPS module and SD card module to this ESP32 Development board

This way I can make a very small data logger with only a few parts and minimal wiring


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2822
 

I'm not familiar with that particular board (nice case though!), I assume it is a generic ESP32 (successor of the ESP8266) with a relatively generic OLED display?

I've been tinkering with an ESP8266 the past few weeks, and have to say that I love them. Fast, more memory, cheap, wifi build in. Nice!
Getting started was super easy as well. (see my article)

Since both GPS and SD card use digital pins, I'm confident they will work with the ESP32.
I guess selecting the right pins can be the confusing part - but all in all it does look very similar to the ESP8266.
This Stackoverflow post may be helpful.

With the ESP8266 I found it to have more digital pins, but fewer analog pins (not an issue for my projects, and I understand the ESP32 is better equipped than the ESP8266).

Personally, I'd go for one of the MakerFocus models (Amazon.com, I couldn't find it at Amazon.de, but I did find this alternative that looks exactly the same, and an ESP8266 alternative), but I'm biased haha.
My ESP8266 is from MakerFocus and I'm very pleased with it.

Funny, while looking at the ESP32 from Amazon.de, I did find this link that may be helpful (also Heltec).
I'll copy the content of that document in the next reply (to keep things a little less chaotic).

 


   
ReplyQuote
Page 4 / 5
Share: