Setting up a ‘Lightning Chair’ — Part 1

Toxonaut
Coinmonks
4 min readFeb 10, 2019

--

In this two-part series of articles, I will describe how to set up a device which can display a Bitcoin lightning payment request QR code and upon payment turn on the power to a connected device. I will hook up the controller to a massage chair, which could then be used e.g. in a public place or an Airbnb.

Prerequisites

  • Bitcoin full node (bitcoin-qt or bitcoind)
  • Lnd node

For an example setup see my previous tutorial here.

Used Material (for this part of the tutorial)

  • Raspberry Pi 3B+(around $40)
  • 3.5" LCD screen like e.g. this ($17)

Setting up the Raspberry Pi

Connect the LCD screen to the Raspberry according to the instruction manual of the screen and then boot the Raspberry Pi with the OS that came with the screen.

From the menu bar open a shell and then type:

Go to Network Options. Set SSID to the WIFI network, then set Password to the WIFI password.

Next, go to Interfacing options. Then select “VNC”, to enable VNC

Reboot the raspberry with:

Next, we need to install RealVNC Viewer on the computer you want to access the Pi from. Download RealVNC Viewer here and open the .exe file. It’s a portable application, so you don’t need to install it:

If you know the IP address of your Pi, enter it into the address bar at the top of the window. If you don’t know it, you can find it with Advanced IP Scanner.

Now press Enter and you’ll be prompted for the Pi’s username and password. Enter pi and raspberry (if you haven’t changed the default credentials).

If this is the first time connecting to the Pi with RealVNC, you’ll get a security warning. Just press Continue to get past it:

The Raspbian Desktop will open up in a VNC Viewer window with a very low resolution:

Open a Terminal window and enter the following commands:

Your command line should now be prefixed with

Next enter the following commands to install missing packages (this may take a while):

The last command opens the autostart file in the nano text editor. Add the following line at the bottom:

The autostart file’s contents should look like this:

Press Control+O and press enter. Then press Control+X.

Enter the following text:

Press Control+O and press enter. Then press Control+X.

Then enter:

Next, download the Python control code control.py from Github. Transfer it to the folder /home/pi/MyPython/

Copy the admin.macaroon and tls.cert file from your PC to the raspberry into the folder ~/MyPython/lnd

Copy a picture of your liking in jpg format saying “paid” or similar to this location ~/MyPython/. The name should be paid.jpg.

You can then reboot the Raspberry. If everything was installed correctly the screen should show a QR code after a while.

Part 2 of the tutorial will show how to package up the raspberry in a custom case and how to install the connected electronics.

Get Best Software Deals Directly In Your Inbox

--

--

Toxonaut
Coinmonks

Hobby researcher of upcoming tech in Bitcoin and DeFi. Follow me on Twitter @cryptobasel