Help with Next Steps

.RickLinuxForum

New Member
Joined
Oct 4, 2025
Messages
8
Reaction score
3
Credits
95
10 years ago, someone setup for me a Raspberry Pi programmed to run my sprinkler system. Worked well for 10 years. Then, 2 days ago, the certificate they setup to allow remote login expired... As of now, the person that set it up is not responding to my attempts to contact them.

The only access that I have is using the domain name that was setup via No-IP, which goes right into the sprinkler software (Open Sprinkler), which it won't do because the certificate has expired.

My brief research shows that once a certificate expires, you have to make a new one, it cannot be renewed. And, of course, somehow the server software that is being used needs to know of the new certificate.

I am reasonably proficient with Windows, Command Prompt, etc, but have no knowledge about the Raspberry Pi. Looking for any insight / ideas that to move forward, i.e. how to connect to the Pi to find the certificate reference, get it updated, and running again.

I pulled the memory card, but Windows doesn't recognize the memory card. When I connect to the Raspberry Pi locally (plug in monitor and keyboard), it runs through a bunch of routines, loads a web server, and the asks me to log into the sprinkler software.

Thanks in advance.
 
Last edited:


@.RickLinuxForum

G'day Rick from DownUnder and welcome to linux.org.

I can't help with the Pi side but I have moved your thread to Single Board Computers where Pi questions are asked and answered.

Good luck.

Chris Turner
wizardfromoz
 
When I need to get an SSL Cert, i install
Code:
python3-certbot
and do an
Code:
certbot -d subdomain.domain.tld
 
@.RickLinuxForum whats the version of Open Sprinkler you have installed, which version of the pi do you have, and what distro are you running? maybe we can find documentation....

===============================================

this is what I was able to find thus far. looks like you'll need some info
to complete the process but it doesnt look that horrible:

===============================================
If your OpenSprinkler's built-in, self-signed certificate has expired, you will need to regenerate it using a command-line interface. This is typically done by connecting to the device via SSH. Since the web interface is inaccessible, you will need to access the OpenSprinkler's underlying Linux system

Prerequisites
  • SSH Client: A program to connect to your OpenSprinkler.
    • Windows: PuTTY, MobaXterm
    • macOS and Linux: The built-in terminal has an SSH client.
  • OpenSprinkler's IP Address: The IP address of your device on your local network.
  • OpenSprinkler Login Credentials: The username and password for your device's operating system (not the web app). The default username is often root or pi.
Step 1: Connect to OpenSprinkler via SSH
  1. Open your SSH client.
  2. Enter the command:
    • ssh root@<your_opensprinkler_ip>
  3. Enter your password when prompted. If this is your first time connecting, you may need to accept the device's host key.
Step 2: Navigate to the correct directory

Once connected, you will need to find the old certificate files. These are typically located in the /etc/uhttpd.d/ directory on OpenWrt-based systems, which is the OS used by many OpenSprinkler models.
  1. Change to the SSL directory:
    • cd /etc/ssl
  2. Make a backup of the old certificate files. This is a safety measure in case you need to revert the changes.
    • mv uhttpd.crt uhttpd.crt.bak
    • mv uhttpd.key uhttpd.key.bak

Step 3: Generate a new self-signed certificate

You will use the OpenSSL command to create a new certificate and key.

  1. Run the following command to generate a new key and certificate. This command creates a new 4096-bit RSA key and a self-signed certificate valid for 10 years (3650 days).
    • openssl req -x509 -sha256 -nodes -days 3650 -newkey rsa:4096 -keyout uhttpd.key -out uhttpd.crt
  2. Answer the prompts for generating the certificate.
    • Country Name (2 letter code) [US]:
    • State or Province Name (full name) [Some-State]:
    • Locality Name (eg, city) []:
    • Organization Name (eg, company) []:
    • Organizational Unit Name (eg, section) []:
    • Common Name (e.g. server FQDN or YOUR name) []:
    • Email Address []:
    • For the "Common Name", enter your OpenSprinkler's local IP address or its hostname (e.g., 192.168.1.100 or opensprinkler.local). This will prevent certificate mismatch errors.

Step 4: Restart the web server

After creating the new certificate and key, restart the OpenSprinkler's web server to load the new files.
  1. Run the following command:
    • /etc/init.d/uhttpd restart

Step 5: Log in to OpenSprinkler

You should now be able to access the OpenSprinkler web interface.
  1. Clear your browser's cache or use a private/incognito window to prevent it from using the old, cached certificate information.
  2. Navigate to your OpenSprinkler's IP address in your web browser. You may see a temporary security warning because the certificate is self-signed and not issued by a trusted authority.
  3. Bypass the security warning and proceed. You can now log in with your normal OpenSprinkler username and password.
===============================================
with versioning info I may be able to find more relevant data.
 
Last edited:
Thanks for the replies.

If I connect locally, after it finishes booting and loading, it gives me the signin prompt and needs a password.

I loaded the card into a reader and booted to Linux Mint via Ventoy. I can see all the file folders, and did a search for certificate, and found it. It seems to be in multiple folders.

It appears that to make a new certificate, I need to request it from the server software, which appears to be nginx. I made a certificate after loading the card, but I think it didn't let me populate the common name fields. If that field is not needed I can make the certificate from another PC and simply move it. Right?

To answer specific questions:

I have no idea what version of OpenSprinkler I have, but it is 10 years old. Works fine.

I believe that much of the OpenSprinkler info assumes you are using their hardware, which I am not. The software runs on the Raspberry Pi, I go to a domain name which is setup with No-IP (and I have to log in every 30 days to keep it active, which I do). The domain points to the server (which maintains the IP address via some software that was installed that somehow tells No-P what the address is. That also works fine.

The only issue that I seem to have is that the certificate expired, and I have to create a new one (also it was SHA1 which apparently is obsolete). In the certificate info, it has the domain name in the identity and common name fields, so just running the OpenSSL command from the computer doesn't fill in the domain name and I assume that matters.

So I need to figure put how to escape the login after the bootup, sign into the server software, then create the certificate with the domain name in it. Or, I am wrong...

To me, the real question is whether the software says "match the certificate on this computer to the one on the requestor's", in which case all I need to do is make the new certificate and figure out what to put on my PC/phone. Or, is there specific code with the certificate info in the code?

I know none of the passwords... But, since I can access the folders via reading the card on another PC, maybe I can delete the password info, making the software think I don’t have one and treat me as a new user and need to set one.

I assume I can find version info in the file folders if I knew where to look.

Edit - I believe that the sole purpose of the certificate was to give us the ability to access the sprinklers anywhere, via domain name. Very useful. However, if there was a way to give us just local access via IP (which I know), and block internet access, that would be useful for the next month, after which the sprinklers are unused until May, and I would have plenty of time to fix the remote component. Don't know if that makes it easier.
 
Last edited:
ok thanks for the info. ran a couple of queries and I think I have a potential solution. the caveat here is that I dont have a raspberry pi to test this with so no idea how accurate this is (I have a nanopi but it doesnt run the official pi OS)

===========================================
If you are unable to log in directly to the Raspberry Pi, you need to modify the files on the SD card from another computer. This allows you to force the system to boot directly into a shell, bypass the login screen, and recover your access.

Step 1: Edit the cmdline.txt file
  1. Shut down your Raspberry Pi and remove the microSD card.
  2. Insert the microSD card into your computer's card reader.
  3. Navigate to the boot partition on the card.
  4. Open the file named cmdline.txt using a text editor like Notepad++ (Windows) or TextEdit (macOS).
  5. Append init=/bin/sh to the end of the file on the same line, with a space before it - ie: console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 ... init=/bin/sh
  6. Save and close the file.
Step 2: Boot into single-user mode
  1. Safely eject the microSD card from your computer.
  2. Insert the card back into your Raspberry Pi and power it on.
  3. The system will boot into single-user mode, providing a root shell prompt (#) without asking for a password.
Step 3: Remount the filesystem as read-write - the root filesystem will be mounted as read-only in single-user mode, so you must remount it as read-write to make changes.

At the prompt, run the following command:
mount -o remount,rw /

Step 4: Fix the login issue - depending on your specific problem, use one of the following methods:

Method A: Change your password
If you have forgotten your password, this is the easiest solution. Run the passwd command, replacing pi with your username if it's different:
passwd pi
Create & confirm a new password.

Method B: Enable autologin
If you want to bypass the login process entirely and boot directly to the command line, use raspi-config.
  1. Launch the configuration tool:
    raspi-config
  • Navigate to System Options > Boot / Auto Login.
  • Select Console Autologin to boot to the command line without a password.
  • Exit the utility, and reboot when prompted.
Method C: Fix a graphical login loop
If you are stuck in an endless graphical login loop, the issue is often related to file permissions.

1. Run the following command to correct permissions for your home directory:
Code:
sudo chown -R pi:pi /home/pi
(Replace pi with your username if necessary).

You can also try backing up and removing the .Xauthority file, which stores session credentials:
mv /home/pi/.Xauthority /home/pi/.Xauthority.backup


Step 5: Undo the changes and reboot
After fixing the issue, you must revert the cmdline.txt file to its original state.
  1. Before rebooting, unmount and remount the filesystem as read-only for safety:
    mount -o remount,ro /
  • Run the reboot command:
    reboot
  • Remove the microSD card as it restarts.
  • Insert the card back into your computer and edit cmdline.txt to remove the init=/bin/sh text you added earlier.
  • Save the file, and re-insert the card into your Pi.
Your Raspberry Pi should now boot normally with the changes you made.
===========================================
===========================================
===========================================
ok, after that, now redo the certificate

Generate a new SSL certificate and configure NGINX

If your old SHA1 certificate has expired, you will need to replace it. A modern, secure alternative is to use a new self-signed certificate with a stronger SHA-256 hash.

Step 1: Generate a new SHA-256 self-signed certificate

Create a directory for your SSL certificates:
sudo mkdir /etc/nginx/ssl
cd /etc/nginx/ssl

Create a configuration file for the certificate request.
This is needed for modern browsers that require a Subject Alternative Name (SAN):
sudo nano opensprinkler.cnf

Paste the following content into the file and save:
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no

[req_distinguished_name]
C = [CountryCode]
ST = [State]
L = [City]
O = OpenSprinkler
OU = Home Automation
CN = opensprinkler.local

[v3_req]
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = opensprinkler.local
DNS.2 = localhost
IP.1 = 127.0.0.1

Generate the private key and the new self-signed certificate using the configuration file:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt -config /etc/nginx/ssl/opensprinkler.cnf


Step 2: Configure NGINX as a reverse proxy

Open the NGINX default site configuration file:
sudo nano /etc/nginx/sites-available/default

Replace the default server block with the following, adjusting the IP address and port, if necessary:
nginx
server {
listen 80;
server_name opensprinkler.local;

return 301 https://$host$request_uri;

}

server {
listen 443 ssl;
server_name opensprinkler.local;

ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;

location / {
proxy_pass http://192.168.1.10:8080
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

Save the file and exit the editor.


Test the NGINX configuration for syntax errors:
sudo nginx -t

Reload NGINX to apply the changes:
sudo systemctl reload nginx

You can now access your OpenSprinkler web UI securely at https://opensprinkler.local. Your browser will warn you that the certificate is self-signed and not trusted, but you can proceed past the warning.
===========================================

had to edit this a bit the formatting was really odd and some of the commands were showing emoji so I used the codeblock format once as well. hopefully that works for you. if not I suspect you'll need someone else who has a similar setup, or you may need to scrap the entire config & set up a new install of piOS with a brand new config.
 
Last edited:
This might be of interest for renewing expired self-signed certs - it is from 2011


As far as I know a self-signed certificate can be trusted only through direct trust, i.e. what Web browsers like Firefox show as the "allow exception" process. Next time you produce a self-signed certificate, make it long-lived. Certificates expire mostly in order to make revocation work (certificate expiry prevents CRL from growing indefinitely). For a self-signed certificate, there is no revocation, so you can make the certificate valid for 20 years or 50 years or whatever

Here is another

 
ok thanks for the info. ran a couple of queries and I think I have a potential solution. the caveat here is that I dont have a raspberry pi to test this with so no idea how accurate this is (I have a nanopi but it doesnt run the official pi OS)

===========================================
If you are unable to log in directly to the Raspberry Pi, you need to modify the files on the SD card from another computer. This allows you to force the system to boot directly into a shell, bypass the login screen, and recover your access.

Step 1: Edit the cmdline.txt file
  1. Shut down your Raspberry Pi and remove the microSD card.
  2. Insert the microSD card into your computer's card reader.
  3. Navigate to the boot partition on the card.
  4. Open the file named cmdline.txt using a text editor like Notepad++ (Windows) or TextEdit (macOS).
  5. Append init=/bin/sh to the end of the file on the same line, with a space before it - ie: console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 ... init=/bin/sh
  6. Save and close the file.
Step 2: Boot into single-user mode
  1. Safely eject the microSD card from your computer.
  2. Insert the card back into your Raspberry Pi and power it on.
  3. The system will boot into single-user mode, providing a root shell prompt (#) without asking for a password.
Step 3: Remount the filesystem as read-write - the root filesystem will be mounted as read-only in single-user mode, so you must remount it as read-write to make changes.

At the prompt, run the following command:
mount -o remount,rw /

Step 4: Fix the login issue - depending on your specific problem, use one of the following methods:

Method A: Change your password
If you have forgotten your password, this is the easiest solution. Run the passwd command, replacing pi with your username if it's different:
passwd pi
Create & confirm a new password.

Method B: Enable autologin
If you want to bypass the login process entirely and boot directly to the command line, use raspi-config.
  1. Launch the configuration tool:
    raspi-config
  • Navigate to System Options > Boot / Auto Login.
  • Select Console Autologin to boot to the command line without a password.
  • Exit the utility, and reboot when prompted.
Method C: Fix a graphical login loop
If you are stuck in an endless graphical login loop, the issue is often related to file permissions.

1. Run the following command to correct permissions for your home directory:
Code:
sudo chown -R pi:pi /home/pi
(Replace pi with your username if necessary).

You can also try backing up and removing the .Xauthority file, which stores session credentials:
mv /home/pi/.Xauthority /home/pi/.Xauthority.backup


Step 5: Undo the changes and reboot
After fixing the issue, you must revert the cmdline.txt file to its original state.
  1. Before rebooting, unmount and remount the filesystem as read-only for safety:
    mount -o remount,ro /
  • Run the reboot command:
    reboot
  • Remove the microSD card as it restarts.
  • Insert the card back into your computer and edit cmdline.txt to remove the init=/bin/sh text you added earlier.
  • Save the file, and re-insert the card into your Pi.
Your Raspberry Pi should now boot normally with the changes you made.
===========================================
===========================================
===========================================
ok, after that, now redo the certificate

Generate a new SSL certificate and configure NGINX

If your old SHA1 certificate has expired, you will need to replace it. A modern, secure alternative is to use a new self-signed certificate with a stronger SHA-256 hash.

Step 1: Generate a new SHA-256 self-signed certificate

Create a directory for your SSL certificates:
sudo mkdir /etc/nginx/ssl
cd /etc/nginx/ssl

Create a configuration file for the certificate request.
This is needed for modern browsers that require a Subject Alternative Name (SAN):
sudo nano opensprinkler.cnf

Paste the following content into the file and save:
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no

[req_distinguished_name]
C = [CountryCode]
ST = [State]
L = [City]
O = OpenSprinkler
OU = Home Automation
CN = opensprinkler.local

[v3_req]
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = opensprinkler.local
DNS.2 = localhost
IP.1 = 127.0.0.1

Generate the private key and the new self-signed certificate using the configuration file:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt -config /etc/nginx/ssl/opensprinkler.cnf


Step 2: Configure NGINX as a reverse proxy

Open the NGINX default site configuration file:
sudo nano /etc/nginx/sites-available/default

Replace the default server block with the following, adjusting the IP address and port, if necessary:
nginx
server {
listen 80;
server_name opensprinkler.local;

return 301 https://$host$request_uri;

}

server {
listen 443 ssl;
server_name opensprinkler.local;

ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;

location / {
proxy_pass http://192.168.1.10:8080
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

Save the file and exit the editor.


Test the NGINX configuration for syntax errors:
sudo nginx -t

Reload NGINX to apply the changes:
sudo systemctl reload nginx

You can now access your OpenSprinkler web UI securely at https://opensprinkler.local. Your browser will warn you that the certificate is self-signed and not trusted, but you can proceed past the warning.
===========================================

had to edit this a bit the formatting was really odd and some of the commands were showing emoji so I used the codeblock format once as well. hopefully that works for you. if not I suspect you'll need someone else who has a similar setup, or you may need to scrap the entire config & set up a new install of piOS with a brand new config.

I got to the making the certificate, and it errors out. I am attaching a picture of the message, versus typing it here. I have no way to jump between Windows 11 and Linux and cut and paste.

Note I tried days at 365, 3,650, and 7,300 and all got the same error.

I will say there were points where the only way I got through them was my old DOS knowledge...
 
For some reason, my message is await moderator approval.

I have no way to jump between Windows 11 and Linux to cut and paste. I tried 365 days, also 3650 and 7300 and all got the same error.

Started to make the certificate, then errors out after writing new private key.

problems making Certificate Request
3069306064:error:0D07A097:asn1 encoding routines:ASN1_nbstring_ncopy:string too long:a_mbstr.c:154:maxsize=2
 
This might be of interest for renewing expired self-signed certs - it is from 2011


As far as I know a self-signed certificate can be trusted only through direct trust, i.e. what Web browsers like Firefox show as the "allow exception" process. Next time you produce a self-signed certificate, make it long-lived. Certificates expire mostly in order to make revocation work (certificate expiry prevents CRL from growing indefinitely). For a self-signed certificate, there is no revocation, so you can make the certificate valid for 20 years or 50 years or whatever

Here is another


I never produce certificates, I didn't set this up, it was done for me. It was setup with 10 years, in hindsight it should have been 50. Of course it was also an obsolete security certificate format, so there's that...
 
For some reason, my message is await moderator approval.
That will be because you are new, and have included a url (link) in your reply.
It is a safeguard measure against those who post spam.
It is not intended personally....every new member is subject to it.

I think after you have posted more than 8 times ...it goes away
 
So I decided to play, and took out the alt names stuff and put in the CN the actual domain name, since I know that, as well as the other fields. I then reran the command and it worked, created the certificate and the key.

In the sites-available file, I can see the locations for:

ssl_certificate
ssl_certificate_key
ssl_client_certificate

So I can simply # the lines out, and retype them with the new locations and file names, right?

So I just made the certificate, nginx.crt, and the key, nginx.key. We didn't make a client certificate though?

Then I need to figure out which file I need to somehow get from the linux system SD card to my computer, since Windows won't read the card. I know I need one of the files installed on the client computer to get to the server.

Getting close, I think?
 
Quick update. Reached the person who did it. Their first step was to have me reset the date on the device to the past. That means the certificate is no longer expired, and access is granted...

They are going to change the certificate to SHA-256 since we don't know when/if the Raspberry Pi will redo the date again to current.

Thanks all.
 


Follow Linux.org

Members online


Top