DS3231 Real Time Clock. How to set the alarm

This is in combination with the Raspberry Pi Pico. Use the chip to keep time while the Pico is in deep sleep or powered off. I need to trigger a thyristor, wake up the Pico, make & store a measurement then power off again.

The timer chip is the core of a number of products from a variety of makers. However, when it comes to setting an alarm, there is remarkably little information for the average user. Here is the function; here are the 8 variables. No meaningful examples or explanation. Fortunately, there are enough software versions that I was able to look at the source code and figure out what settings are needed to get the alarm to work.

This code is from https://RandomNerdTutorials.com/raspberry-pi-pico-ds3231-rtc-micropython/
Alarm times (year, month, day, weekday, hour, minute, second, millisecond)
alarm_time = urtc.datetime_tuple(2025, 04, 09, None, 21, 12, 00, 0)
Sets the alarm time for Apr 9, 2025 at 9:12PM.

However if you want to set the alarm to trigger every second, this is what you need.
alarm_time = urtc.datetime_tuple(None, None, None, None, None, None, None, 0
This outputs an alarm every time the millisecond counter reaches zero. That is every second.
To trigger every minute, set the seconds to 0 and milliseconds to None.

Couple of notes on hardware/software

The Waveshare chip needs to have a jumper installed to get the signal to the output pin. However, the physical layout and tiny size make it very difficult to actually solder anything into place. I haven’t managed to do it yet. Gave up and switched to the DS3231 AT24C32 module.

There are drivers from an assortment of vendors based on the Hinch github repository. They use the same name for driver file but the driver is specific to the board. That can cause a lot of confusion when you run the software and it errors out. I had to put remarks in the header of all files as to source and which chip it runs on.

If you change the driver, unplug the Pico and allow it to clear. Prior drivers can leave settings that cause the new driver to fail.

Allowing Windows client VPN connection to an Edge router thru a router/modem firewall

The provider modem can be a problem if the network you want to connect to is behind another router downstream. Some have the option to set a passthru for VPN but not all. You can configure the modem as a bridge which disables the modem as a network controller. This may work for some cases but needs careful planning if you have an existing network using the default modem governed network.

I’ve found both Verizon and Comcast business modem/routers have a DMZ option which exposes one internal machine to the public network and this works to put the router on the external network interface. However, the T-mobile 5G home connection will not connect in this configuration even though Verizon home Fios and many others work just fine.

The best option I’ve found is to forward ports 500 and 4500 to the internal Edge X router. I found these using Wireshark. I’m sure they are documented somewhere. Port 500 is initially used when connecting to the Edgerouter thru the firewall but shifts to port 4500 after initial contact. Forwarding eliminates the killer conflict between T-Mobil and Comcast modems when using the Comcast option to expose an internal machine.