The project aims to find a way to keep the lightning network nodes running in the event of power outages and internet outages. Internet – How to connect LN nodes to the Internet to keep LN synchronized?

2025/09/1419:23:41 technology 1139

This article is a follow-up to an article I wrote before, discussing different types of lightning network nodes. I will extend the RaspiBlitz Lightning Network node. I won't dive into the many other options and features that RaspiBlitz offers, but it's a unique turning point.

This project started four years ago. I was sitting in my apartment when there was a sudden power outage at noon. The first thing that flashes through normal people’s mind is “Damn it, power outage – I wonder how long it will take, do I need to start looking in the refrigerator for barbecues that might thaw?”

is not me! I immediately thought of, "My Lightning Node!" The long story short, the power outage lasted only a few hours. But at that time I was thinking, what should I do if something like this happens again?

Next appears a project that follows me setting up the RaspiBlitz LN node. The project aims to find a way to keep the lightning network nodes running in the event of power outages and internet outages.

problem that needs to be solved:

  1. power supply - What can I use to keep the LN node running during the next power outage?
  2. Internet - How to connect LN nodes to the Internet to keep LN synchronized?
  3. Mobile – What if there is a fire or emergency, I have to leave and just take away what I can bring?

power

If you read through these problems, you may have already thought about solutions yourself. The first problem is easy to solve - obtaining uninterruptible power supply (UPS) as a backup. Does it make sense? If power is outage, the UPS starts up and keeps the device's power supply running properly. The only follow-up question is, how long will it take for you? There are many UPS on the market that can provide any number of hours of electricity, so at this point it becomes a matter of preference and budget. I chose the power UPS model for about two hours. I had nothing at the time, so it was still new to me and I never thought about it. While not the longest charging time or the most powerful UPS, the UPS I chose only provides backup power to my LN nodes and routers; if I lose the internet, I can still have my router continue to power and end up with a secure shell (SSH ) to my device on the network. The first problem was solved.

Internet

**Note** The following solutions are based on whether you use WiFi settings from the beginning. If you are using an Ethernet cable, you can still add a WiFi network as a backup by following the steps below. Also, if you have your router powered by a UPS, this doesn't always mean you lose the internet in the event of a power outage, as it depends on whether your provider is affected as well. This approach is suitable for a wider range of power outages or emergencies and helps solve the third problem - mobility.

Internet and stay connected

Although everyone is worried about electricity, it is natural, many people forget the second most important part--Internet connection. How do I keep this device connected if there is a power outage? Simple – This is when I started researching; thankfully, because I'm using Raspi 4 with built-in WiFi, you can add a second WiFi network by simply configuring the WiFi file.

This article is a follow-up to an article I wrote before, discussing different types of lightning network nodes. I will extend the RaspiBlitz Lightning Network node. I won't dive into the many other options and features that RaspiBlitz offers, but it's a unique turning point.

This project started four years ago. I was sitting in my apartment when there was a sudden power outage at noon. The first thing that flashes through normal people’s mind is “Damn it, power outage – I wonder how long it will take, do I need to start looking in the refrigerator for barbecues that might thaw?”

is not me! I immediately thought of, "My Lightning Node!" The long story short, the power outage lasted only a few hours. But at that time I was thinking, what should I do if something like this happens again?

Next appears a project that follows me setting up the RaspiBlitz LN node. The project aims to find a way to keep the lightning network nodes running in the event of power outages and internet outages.

problem that needs to be solved:

  1. power supply - What can I use to keep the LN node running during the next power outage?
  2. Internet - How to connect LN nodes to the Internet to keep LN synchronized?
  3. Mobile – What if there is a fire or emergency, I have to leave and just take away what I can bring?

power

If you read through these problems, you may have already thought about solutions yourself. The first problem is easy to solve - obtaining uninterruptible power supply (UPS) as a backup. Does it make sense? If power is outage, the UPS starts up and keeps the device's power supply running properly. The only follow-up question is, how long will it take for you? There are many UPS on the market that can provide any number of hours of electricity, so at this point it becomes a matter of preference and budget. I chose the power UPS model for about two hours. I had nothing at the time, so it was still new to me and I never thought about it. While not the longest charging time or the most powerful UPS, the UPS I chose only provides backup power to my LN nodes and routers; if I lose the internet, I can still have my router continue to power and end up with a secure shell (SSH ) to my device on the network. The first problem was solved.

Internet

**Note** The following solutions are based on whether you use WiFi settings from the beginning. If you are using an Ethernet cable, you can still add a WiFi network as a backup by following the steps below. Also, if you have your router powered by a UPS, this doesn't always mean you lose the internet in the event of a power outage, as it depends on whether your provider is affected as well. This approach is suitable for a wider range of power outages or emergencies and helps solve the third problem - mobility.

Internet and stay connected

Although everyone is worried about electricity, it is natural, many people forget the second most important part--Internet connection. How do I keep this device connected if there is a power outage? Simple – This is when I started researching; thankfully, because I'm using Raspi 4 with built-in WiFi, you can add a second WiFi network by simply configuring the WiFi file.

How to set up a second network on Raspi:

Go to this page to learn more: Set up WiFi on Raspi

This is the line of code you are looking for:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

**Note** If you are not using WiFi but using RJ45 (Ethernet), your wpa_supplicant.conf This code may not be present at the top of the file; if it is missing, add it:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

Update configuration=1

country=US - **If you are outside the United States, please change your country code**

To enter this code, please exit RaspiBlitz Menu and go to the terminal screen, it should look like this:

Administrator @NODEIPADDRESS:~ $

Input code is as follows:

admin@NODEIPADDRESS:~ $ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

I won't show my configuration, but you will see your settings when opening the file. I got this from the "Set WiFi on Raspi" link above.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

Update configuration=1

Country=US

Network={

SSID="school network SSID"

psk="password school"

id_str="school"

}

Network={

ssid="Home Network SSID"

psk="Password Home Page"

id_str="Home"

}

What you will see in the file is what you have already used WiFi network. What you want to add is a second network. So what is your second network? I mean how many WiFi hotspots can you connect to? Do you know the SSID (Service Set Identifier) ​​and the password to connect them? In my case, I used the hotspot of my phone. Yes, you can use your phone as a hotspot to act as WiFi so that your LN node can be connected. So for the second network on the list, I entered the password provided by my SSID and the phone hotspot feature.

question - but what if I use my phone hotspot? How do I know the IP address to which I connect? Don't worry, I'm ready for you, too. On your phone (I use Android) download an app called Termius which is like an SSH terminal from your phone to your LN device.

**Note**If you have a screen on your RaspiBlitz, the connected IP address will also be displayed, which means you have entered a second WiFi network correctly and your phone and device are communicating.

**Note** If you run your device headless (screenless) like me, then you have to get the IP address from the "Connected Device" information, steps I discussed below

Terminal Application

Steps: Due to security policy, I can't take screenshots to show how to set up the application on your phone, but I can guide you.

  1. Open the application
  2. Click "+" - Create new host
  3. Fill in the information - Alias ​​(connection name)
  4. Host name or IP address: When your node connects to your phone hotspot, you will get this IP address. I'll show you how to get it later.
  5. Make sure the "SSH" box is selected.
  6. Username: For RaspiBlitz users, the username is "admin", but if you change it to a different name, then it is whatever name you call it.
  7. Password: Do not enter your password! If you type it, it will automatically connect, and if someone enters your phone, it is a security vulnerability.Leave it blank when you click the alias and it will ask you to provide the password for the device you want to connect to.
  8. Click the check mark at the top to add a new connection.
  9. When you establish the first SSH connection with the device, it will ask you to accept the fingerprint. Click Yes.

Below is a screenshot of all this:

The project aims to find a way to keep the lightning network nodes running in the event of power outages and internet outages. Internet – How to connect LN nodes to the Internet to keep LN synchronized? - DayDayNews

As you can see, I am using a mobile phone hotspot.

My WiFi network is "Gopoundsand" along with the password provided (psk) I enter as a second WiFi network.

Network={

ssid="Gopoundsand"

psk="Password homepage"

id_str="Home"

}

If you see the connected device (your LN node name), it means you have successfully set up sudo nano /etc/wpa_supplicant/wpa_supplicant.conf, and your device has now passed WiFi connects to your phone and the internet. Congratulations on getting to this point!

**Note** If you are using Ethernet , make sure your first connection is unplugged, or if you are using WiFi as your primary connection, make sure it is closed. Because when you restart, the device will lock to your primary WiFi network and will not look for your second connection. This will take several minutes to establish the connection on restart.

You can now go from settings to mobile hotspot and view connected devices or swipe down from the notification bar as shown above to view connected devices. Now click Details for the connected device and click Details again. Here you will see the IP address provided to the device from your phone. (Example: 192.168.200.102.) This information will now go to Termius application: Hostname or IP address: When your node connects to the phone hotspot, you will get this IP address.

If you manage to do everything correctly, then you should get to this location in the screenshot:

The project aims to find a way to keep the lightning network nodes running in the event of power outages and internet outages. Internet – How to connect LN nodes to the Internet to keep LN synchronized? - DayDayNews

This is the menu screen of RaspiBlitz, on my Android phone with the Termius app.

If you manage to complete all the steps, you have successfully added a second WiFi network to your sudo nano /etc/wpa_supplicant/wpa_supplicant.conf, managed to get the LN nodes connected to your phone via hotspots and eventually be able to connect to your device via SSH and have your LN nodes resynchronize over the cellular network and access the RaspiBlitz menu as shown in the screenshot above. Congratulations, you will succeed!

connection failure prompt:

  1. Make sure the SSID and password in the sudo nano /etc/wpa_supplicant/wpa_supplicant.conf file are correct. Ctrl+x Exit, if the information is correct, "y" saves the file. Or if you enter an error, enter "n".
  2. When restarting the LN node, connect to your phone hotspot and give it a few minutes to establish the connection. So don't worry about what you're doing wrong - if it takes more than five minutes, it may be worth troubleshooting.
  3. If you are using Ethernet, make sure your first connection is unplugged, or if you are using WiFi as your primary connection, make sure it is closed. Because when you restart, the device will lock to your primary WiFi network and will not look for your second connection.
  4. On SSH through the terminal, make sure your hotspot IP address is correct. and add this information to the new host connection. (Side note: On some devices like me, I get a new IP address every time I close and turn on the hotspot, so I have to "edit connection alias" in the application with the new IP address and SSH will reconnect.

Mobility

We are finally here to the last step.What if there is a major emergency, fire or just a vacation and you can only take away what you can take away? Can you bring your Lightning Network node? what will you do? If you're using a medium-sized UPS, you can take it away at any time as it provides hours to keep your device running until you get a more stable setup. For example, your UPS is big and bulky, and it is not feasible to carry around. I also considered this issue and decided to use a 28800mAH solar backup charger, which can basically be used to charge your phone. Why is this convenient? Because it is small in size, light in weight and versatile in use. The device can also be used to wall-mounted charging the device using (usb-c connector). But more importantly,

Tip:

  1. You can't wall-charge the backup charger when trying to power the LN device; it doesn't kill the Pi, it just stops its work. I unplugged the power, waited for a while, and then restarted.
  2. You cannot use two USB ports at the same time to connect to the Raspi USB port. That will blow up your board: So yes, I killed my board. Thankfully, it's just a circuit board, which costs just $35 for replacement.

In short, I learned through trial and error. Hope you can smile, but hope it helps others avoid unnecessary stress.

This is the final result (photo taken in the state park of the Rocky Mountains):

The project aims to find a way to keep the lightning network nodes running in the event of power outages and internet outages. Internet – How to connect LN nodes to the Internet to keep LN synchronized? - DayDayNews

Conclusion

This can be your weekend project. If you are already running a node and feel a little #reckless, this is a fun way to expand your application and skills. Even if you don't do exactly this way, I hope this inspires you to come up with a more creative way to solve the problem I'm having.

Leave it blank when you click the alias and it will ask you to provide the password for the device you want to connect to.
  • Click the check mark at the top to add a new connection.
  • When you establish the first SSH connection with the device, it will ask you to accept the fingerprint. Click Yes.
  • Below is a screenshot of all this:

    The project aims to find a way to keep the lightning network nodes running in the event of power outages and internet outages. Internet – How to connect LN nodes to the Internet to keep LN synchronized? - DayDayNews

    As you can see, I am using a mobile phone hotspot.

    My WiFi network is "Gopoundsand" along with the password provided (psk) I enter as a second WiFi network.

    Network={

    ssid="Gopoundsand"

    psk="Password homepage"

    id_str="Home"

    }

    If you see the connected device (your LN node name), it means you have successfully set up sudo nano /etc/wpa_supplicant/wpa_supplicant.conf, and your device has now passed WiFi connects to your phone and the internet. Congratulations on getting to this point!

    **Note** If you are using Ethernet , make sure your first connection is unplugged, or if you are using WiFi as your primary connection, make sure it is closed. Because when you restart, the device will lock to your primary WiFi network and will not look for your second connection. This will take several minutes to establish the connection on restart.

    You can now go from settings to mobile hotspot and view connected devices or swipe down from the notification bar as shown above to view connected devices. Now click Details for the connected device and click Details again. Here you will see the IP address provided to the device from your phone. (Example: 192.168.200.102.) This information will now go to Termius application: Hostname or IP address: When your node connects to the phone hotspot, you will get this IP address.

    If you manage to do everything correctly, then you should get to this location in the screenshot:

    The project aims to find a way to keep the lightning network nodes running in the event of power outages and internet outages. Internet – How to connect LN nodes to the Internet to keep LN synchronized? - DayDayNews

    This is the menu screen of RaspiBlitz, on my Android phone with the Termius app.

    If you manage to complete all the steps, you have successfully added a second WiFi network to your sudo nano /etc/wpa_supplicant/wpa_supplicant.conf, managed to get the LN nodes connected to your phone via hotspots and eventually be able to connect to your device via SSH and have your LN nodes resynchronize over the cellular network and access the RaspiBlitz menu as shown in the screenshot above. Congratulations, you will succeed!

    connection failure prompt:

    1. Make sure the SSID and password in the sudo nano /etc/wpa_supplicant/wpa_supplicant.conf file are correct. Ctrl+x Exit, if the information is correct, "y" saves the file. Or if you enter an error, enter "n".
    2. When restarting the LN node, connect to your phone hotspot and give it a few minutes to establish the connection. So don't worry about what you're doing wrong - if it takes more than five minutes, it may be worth troubleshooting.
    3. If you are using Ethernet, make sure your first connection is unplugged, or if you are using WiFi as your primary connection, make sure it is closed. Because when you restart, the device will lock to your primary WiFi network and will not look for your second connection.
    4. On SSH through the terminal, make sure your hotspot IP address is correct. and add this information to the new host connection. (Side note: On some devices like me, I get a new IP address every time I close and turn on the hotspot, so I have to "edit connection alias" in the application with the new IP address and SSH will reconnect.

    Mobility

    We are finally here to the last step.What if there is a major emergency, fire or just a vacation and you can only take away what you can take away? Can you bring your Lightning Network node? what will you do? If you're using a medium-sized UPS, you can take it away at any time as it provides hours to keep your device running until you get a more stable setup. For example, your UPS is big and bulky, and it is not feasible to carry around. I also considered this issue and decided to use a 28800mAH solar backup charger, which can basically be used to charge your phone. Why is this convenient? Because it is small in size, light in weight and versatile in use. The device can also be used to wall-mounted charging the device using (usb-c connector). But more importantly,

    Tip:

    1. You can't wall-charge the backup charger when trying to power the LN device; it doesn't kill the Pi, it just stops its work. I unplugged the power, waited for a while, and then restarted.
    2. You cannot use two USB ports at the same time to connect to the Raspi USB port. That will blow up your board: So yes, I killed my board. Thankfully, it's just a circuit board, which costs just $35 for replacement.

    In short, I learned through trial and error. Hope you can smile, but hope it helps others avoid unnecessary stress.

    This is the final result (photo taken in the state park of the Rocky Mountains):

    The project aims to find a way to keep the lightning network nodes running in the event of power outages and internet outages. Internet – How to connect LN nodes to the Internet to keep LN synchronized? - DayDayNews

    Conclusion

    This can be your weekend project. If you are already running a node and feel a little #reckless, this is a fun way to expand your application and skills. Even if you don't do exactly this way, I hope this inspires you to come up with a more creative way to solve the problem I'm having.

    technology Category Latest News