ISS Alert- should this work?

Edited, again for spelling. Sigh!

Yup – that’s about all you need to do. There’s no learning about libraries other than:

  • How to write one;
  • How to use one.

That’s it. You can delve into the source code if you wish, but that way, many rabbit holes lie. You could be down there for days!

Well, the whole Arduino concept was originally to get students building stuff quickly to get a handle on what they were learning. It sort of grew from that - in a manner very similar to the Raspberry Pi’s original design. It too was because kids were doing tech courses at University and couldn’t program a computer. IT learning back then was using Microsoft Office. Eben Upton was at Oxford University and dismayed at the standard of abilities of prospective students.

See my brief description of pinMode() further back. Lots of stuff happening below the quilt covers to stop you doing something daft and smoking the board. But it saves you having to read the data sheet to determine that you must:

  • Write a 1 bit to the pin position in the appropriate DDR register to make a pin an OUTPUT;
  • Write a 0 bit to the pin position in the appropriate DDR register, AND write a 0 bit to the pin position in the appropriate PORT register to make a pin an INPUT;
  • Write a 0 bit to the pin position in the appropriate DDR register, AND write a 1 bit to the pin position in the appropriate PORT register to make a pin an INPUT_PULLUP;

That’s all there is to it, but what is easier pinMode(3, INPUT_PULLUP) or:

// Make D3 an INPUT Pin.
DDRD &= ~(1 << DDD3);
// Turn on PULLUP resistor.
PORTD |= (1 << PORTD3);

I know which one I prefer, but I know which one is by far the more efficient.

By the way, in both the Arduino IDE and PlatformIO, all the core files for the appropriate platform are compiled into a library (usually core.a is it’s name) and then linked with your code. Only the modules you have used are linked into your final firmware file ready for uploading.

They don’t, well they do but …

When you or someone write a library for the Arduino, for example, it is written in a particular way. An examples directory/folder, if supplied, will cause the examples for that library to be installed when you add the library. The layout is:


It is possible to have other folders in there as well, my libraries have a docs folder – to describe how to install and use the library and a bit about the examples. There will usually be screen shots for the breadboard setup and so on. Those additional folders are ignored by the Arduino IDE.

The good news is, PlatformIO can use Arduino libraries in this format. Most useful indeed. And the code in use should also be the same if you are using the framework = arduino option in platformio.ini.

Because you don’t need to download them. using lib_deps does that for you. However, if your internet is flaky, then having a download is helpful.

I’m developing a bunch of libraries for Arduino and PlatformIO. I have a layout like this:

       ... as above.
       ... as above.

Each library folder is as described above. In my platformio.ini I have something like this:

; Where to find my various PlatformIO libraries. This is a
; relative path from the project directory to the directory
; named "PlatformIO_Libraries" under which, each library is
; to be found in it's own sub-directory.
; In each subdirectory is the source and header files. There's
; no need for "lib_deps" in this case.
lib_extra_dirs = ../../../../PlatformIO_Libraries/

So, I don’t have to code a bit, test a bit, publish the library – which may not be complete – to and/or GitHub then mess about changing versions, adding and removing bugs and features, and so on, then having to republish everywhere. I do what I want locally, and when I’m finished I’ll publish.

In my code I just have the appropriate headers:

#include "AVR_wdt.h"

Then use the code:

#include "AVR_wdt.h"

// LED pin for the WDT to flash.
#define WDT_LED 7

void wdtInterrupt() {
    digitalWrite(WDT_LED, !digitalRead(WDT_LED));

void setup() {
    // Initialise Serial.

    // Do the pins. Pin 7 is for the WDT interrupt.
    pinMode(WDT_LED, OUTPUT);

    // Enable the WDT to fire every second.
    AVRwdt.begin(AVR_wdt::WDT_TIMEOUT_1S, wdtInterrupt, false);

    // Inform the user as to what will happen.
    Serial.print("WDT will reset: ");
    Serial.println((AVRwdt.willReset()) ? "YES" : "NO");

    Serial.print("WDT will interrupt: ");
    Serial.println((AVRwdt.willInterrupt()) ? "YES" : "NO");

void loop() {
    // Flash the builtin LED every 5 seconds.
    digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));

Job done. The built in LED is flashed every 5 seconds in the loop() and the LED on D7 is flashed every second by the watchdog.

Long story (too long!) short, I have lots of libraries in a safe place, and I can use them for my AVR code in PlatformIO and/or the Arduino IDE without having to lib_deps them all - just do the above with the very top level folder and either it’s full path or a relative one. All the libraries in that folder and sub-folders will be able to be used as required.

So, you can still use your USB and/or Downloads folder for your libraries with a little organisation of the folder structure.

Me too! I love to know how things work. I have two mottos in life:

  • Don’t think, find out!
  • How the f*ck does that work!

Well, it’s called “junk” DNA, but nobody knows, yet, if it really is junk. I love the fact that an onion has more DNA than a human. Makes perfect sense to me. Onions are complex creatures. :grin:

I’m tempted, but what I need isn’t printable! :rofl: :rofl: :rofl:


1 Like

This program is awesome. I put this down for a few months and rebuilt the 3-D model for OLED, made it taller. The program was running. I was about to wire up a finished product, but then I blasted the WeMos Mini with 12V intended for a laser (I got a cool cutting laser, going to try to design a cutting tool.).

Now it won’t build. It says the last two items in secrets.h, the geolocation, aren’t kosher. I was surprised to learn PIO is kosher:

Compiling .pio\build\esp12e\lib239\ESP8266WiFi\ESP8266WiFi.cpp.o
In file included from src\main.cpp:30:0:
.pio\libdeps\esp12e\ISS-Notifier\include/secrets.h:20:1: error: 'TimeChangeRule' does not name a type
 TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600};    // UTC + 10 hours      
.pio\libdeps\esp12e\ISS-Notifier\include/secrets.h:21:1: error: 'Timezone' does not 
name a type
 Timezone myTz(aEST);
*** [.pio\build\esp12e\src\main.cpp.o] Error 1

I’m finally ready to give this as a gift, but now it doesn’t work.
1- What changed???

Off hand, it looks like you might have lasered off a header file? Whatever header defines a TimeChangeRule and/or a Timezone looks to be missing from your #include statements.

I had a quick Google for TimeChangeRle esp8266 and got this hit GitHub - JChristensen/Timezone: Arduino library to facilitate time zone conversions and automatic daylight saving (summer) time adjustments. which looks like it could be what you are using.

Have you got #include Timezone.h in your code? (With the Uppercase T.)


I don’t have those includes, but I never had them.
There is a file, secrets.h, and that’s where those two items live.
This is it:

/*** Your WiFi Credentials ***/
const char *ssid = "... ";
const char *password = "....";

/*** Your coordinates ***/
const float latitude = 37.25;
const float longitude = -121.9;
const float altitude = 260.00;

No wait…
And now there is no build function. And now this:
Error: Multiple requests to rebuild the project “Dashboard_Receiver_ESPNow_DOIT” index have been received! Automatic index rebuilding process has been terminated for 10 minutes. at A.value (c:\Users\joema.vscode\extensions\platformio.platformio-ide-2.3.1\node_modules\platformio-node-helpers\dist\index.js:1:935337) at A.value (c:\Users\joema.vscode\extensions\platformio.platformio-ide-2.3.1\node_modules\platformio-node-helpers\dist\index.js:1:938227) at A.value (c:\Users\joema.vscode\extensions\platformio.platformio-ide-2.3.1\node_modules\platformio-node-helpers\dist\index.js:1:940063) at c:\Users\joema.vscode\extensions\platformio.platformio-ide-2.3.1\node_modules\platformio-node-hel…

I can’t find either of the error words. They’re not in the script, they’re not in secrets.h.

Is that your complete secrets.h by any chance? The first error in your post is this:

In file included from src\main.cpp:30:0:
.pio\libdeps\esp12e\ISS-Notifier\include/secrets.h:20:1: error: 'TimeChangeRule' does not name a type
 TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600};    // UTC + 10 hours      

It’s complaining about the first character on line 20 and something called TimeChangeRule.

The second error is this, and also is found in secrets.h:

.pio\libdeps\esp12e\ISS-Notifier\include/secrets.h:21:1: error: 'Timezone' does not 
name a type
 Timezone myTz(aEST);

This time it doesn’t like something called Timezone at the start of line 21.

I see none of these in the code you posted above for the file secrets.h.


There was discussion in here

So I’d request that the ISS-Notifier project is not used a library. This does have unintended side-effects like these. Refer

and GitHub - pfeerick/ISS-Notifier: Neopixel notifier for when the ISS goes overhead

Looking at Peter’s code, where this project came from, line 31 in main.cpp is this:

#include "Timezone.h"

Check your main.cpp file. That line is just above the inclusion of secrets.h.

See ISS-Notifier/main.cpp at master · pfeerick/ISS-Notifier · GitHub.


1 Like

Thank you. I don’t understand how I could have deleted those.
I guess it’s operator error.

1 Like

No worries,we got there!


DOes anybody know how I got secrets.h to work?
It’s in the include folder.
I had to edit it for a different location.
Now it isn’t being seen.
It’s saved in PIO as a C++ .h document.

How does that get included correctly again???

Hi Joe,

header files go into either:

  • The src folder; or
  • The include folder; or
  • The lib/library_name if it’s a header for the “library_name” library.

Secrets.h should be located in the include directory, if you are using Peter’s code. (@pfeerick).

Mine is in that location and works fine.



Thank you. I was right.
I put a new secrets.h in the include folder, and it won’t load.

I’ll confirm again, but this is what happened:
I edited secrets.h for a different location and uploaded the program.
The program ran with the same location. It didn’t change the secrets data.
I deleted the pio folder, and build failed.
The file is in there.

When I try to build, secrets.h isn’t found.

But it’s there. I even re-saved it, copied from pfeerick, saved in PIO as a C++ .h document.

I’ll give it another shot today.

I had a strange hardware issue. The 2812 is associated with four fried WeMos 8266. I have two working ISS trackers, out of a six-pack of 8266.

If you still have trouble, show a screenshot of the folder structure… might be able to see what’s going on from that. Try to build it, and the screenshot will have the error message on it also.

If the location didn’t change, was the upload successful? As if that failed, it naturally won’t change.

I closed everything but this and the documents folder. secrets.h is in fact sitting in the secrets folder in /include. It looks exactly like the old one, with different numbers.

I copied your text from Github, pasted into a new PIO file, and saved as a .h C++ file.

This is the error:
Compiling .pio\build\esp12e\lib239\ESP8266WiFi\ESP8266WiFiGratuitous.cpp.o
src\main.cpp:34:21: fatal error: secrets.h: No such file or directory

  • Looking for secrets.h dependency? Check our library registry!
  • CLI > platformio lib search “header:secrets.h”
  • Web > PlatformIO Registry

#include “secrets.h”
compilation terminated.
*** [.pio\build\esp12e\src\main.cpp.o] Error 1

The file:

/*** Your WiFi Credentials ***/
const char *ssid = " ";
const char *password = " ";

/*** Your coordinates ***/
const float latitude = 39.92;
const float longitude = -75.55;
const float altitude = 260.00;

/*** Your timezone ***/
// How to set:
TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600};    // UTC + 10 hours
Timezone myTz(aEST);

I was hoping to see something more like this…

As from your screenshot, I can’t see where that secrets.h is in relation to the rest of the project. Or if secrets.h is the real file extension… if you copied the text from the github page, and used notepad to save it, it probably has the wrong file extension, and is actually secrets.h.txt, not secrets.h. Which you would be able to see in the VSCode file brower, and rename from there.

To avoid issues like that, download the raw file from github, as that will download the file to your computer as is, with the proper file name.

secrets.h is inside the secrets folder inside include? Really?

If the path is include\secrets\secrets.h the you need #include secrets\secrets.h.

And you have changed the structure of the project directory but not made appropriate changes to the code.



1 Like

I hate that Windows defaults to hiding file extensions. That way many people have ben scammed/virussed/affected. People can cope with file extensions, Microsoft!

It’s the first thing I turn off when forced to use Windows.

(End rant!)


1 Like

Urgh! Good catch! :laughing:

Same. Or use xplorer2 instead of “windows exploder”. :grin:

1 Like

Again, I used PIO and saved it as a C++ h file.
The tree: