Building a PiLocoBuffer

Contents


Introduction

What is a PiLocoBuffer

A PiLocoBuffer is a bridging device between the WIFI throttle wiFRED and a LocoNet capable Command Station. To achieve this a decent Raspberry Pi is used and equipped with an add-on board (so called HAT (Hardware Attached on Top)).

On the hardware side the Raspberry Pi connects via its Ethernet port a WIFI Access Point and via its attached PiLocoBuffer-HAT the LocoNet. A DCC Command Station is needed to drive locos. A connected LCD displays gives status information about sent and recieved LocoNet pakets.

On the software side the Raspbery Pi runs JMRI (especially the WiThrottle server part is needed) to allow any wiFRED to connect. The adapted software LBServer the connects JMRI to the LocoNet interface.

The PiLocoBuffer is a development by FREMO members.


Hardware

Partlist

Everything you need

The parts required are:

Build Hardware

Correction of transistors orientation

As mentioned above the version 1 of the PiLocoBuffer PCB is erraneous and two transistors need to be corrected. Both transistors can be seen here:

Transistors position

Some hints, taken from SMD Components Desoldering tutorial

Desoldering involves using a soldering iron, desoldering braid, or suction tool to remove the solder holding the SMD component in place

  1. Proper tools: Ensure that you have the correct tools for the job, such as a good quality soldering iron, desoldering braid, soldering flux.
  2. Heat management: SMD components are sensitive to heat, and excessive heat can damage them or the PCB. Use a temperature-controlled soldering iron to avoid overheating. Heat only the component that needs to be desoldered, not the entire PCB.
  3. Solder removal: Use desoldering braid or a soldering vacuum to remove the old solder from the pads. Avoid pulling or twisting the component, as this can damage the pads or the component itself.
  4. Cleaning: Once the old solder is removed, clean the pads with a soldering flux remover or isopropyl alcohol to ensure that the new component attaches securely..
  5. Component placement: When placing the new component, ensure that it is oriented correctly, and align the pads with the PCB. Apply solder paste to the pads using an SMT stencil if available, and then use a heat gun to reflow the solder.

Then solder new transistors in place. If SMD transistor BC 817–40 is used, the figure from R??diger B??cker gives a explanation how to solder the SMD transistors to their new position and orientation.

Fix with SMD transistors PCB after transistor correction

If a through hole transistor is used the following picture gives a glance hwo to do this.

Fix with through hole transistors

Nominal build

Starting point

PCB - Starting point

Solder the parts with smallest height first


LEDs

Your PCB should now look like this:

LED

Potentiometers

Then proceed with the two potentiometers:


Switch

Now the switch SW1. The switch has one fabgeflachtlattened side, the PCB shows these flattened side also. The flattene side is at the edge of the PCB.

PCB with LEDs, Potis and Switch

LocoNet socket

Now solder the LocoNet socket (DS1) to PCB.

PCB with LEDs, Potis, Switch and LocoNet socket

Mechanical parts

Mount two of the standoffs using two M2.5 x 8mm Screws. Add a isolating washer to one of them:

Standoffs for LCD
Standoffs for LCD
Standoffs for LCD
Standoffs for LCD

Prepare the pin header for the LCD and solder:

Prepare pin header
Prepare pin header
Solder LCD to pin header
Solder LCD to pin header

Software

Install RaspiOS

Download “Raspberry Pi OS Lite (64-bit)” (Version February 21st 2023):

To install (‘burn’) the “Raspberry Pi OS Lite (64-bit)” onto the micro SD card you can use

Configuration to use:

Be sure that your Raspberry Pi gets access to the internet and that you can access it using ssh.

Plug the sd card in your Raspberry Pi and power it. Give it some time to boot and then query your Router/DHCP server about the IP-Adress assigned to device lbserver.

You may also be able to ask your name server for the ip and name: nslookup lbserver (or someting like nslookup lbserver.fritz.box).

You should also setup your dhcp server to assign always the same ip address (use quasi-static ip).

First login

Open a ssh session and logon:

ssh pi@lbserver.local

On first access you have to accept the ssh fingerprints. Try that internet access is working.

$ ping google.com
PING google.com(fra16s49-...net (2a00:...:200e)) 56 data bytes
64 bytes from fra07s64-...net (2a00:...:200e): icmp_seq=1 ttl=118 time=20.7 ms
...

Update the Linux installation

sudo apt update
sudo apt upgrade

Install JMRI

Follow the instuctions on JMRI.org

First Java11

sudo apt install openjdk-11-jre

Second JMRI

Third PiLocoBuffer software

Download PiLocoBuffer software

curl --fail \
  --location https://sourceforge.net/projects/loconetovertcp/files/PiLocoBuffer/config/PiLocoBufferConfig_0.1.zip \
  --output PiLocoBufferConfig_0.1.zip

Install required packages and PiLocobuffer software

sudo apt install pkg-config avrdude libsystemd-dev
unzip PiLocoBufferConfig_0.1.zip
cd PiLocoBufferConfig_0.1

sudo make FIRMWARE_VER=2023-04-15 LBSERVER_VER=0.14 all

sudo reboot

Configure JMRi/DecoderPro on PiLocoBuffer

Create a new connection with following settings

Connection settings wiThrottle server

That’s all. Have fun.

Notes

Raspberry Pi 3

The software installation described above works without changes on a Raspberry Pi 3. This has been tested on a “Raspberry Pi 3 Model B+”.

Raspberry Pi 2

The Raspberry Pi 2 is no 64 bit system so you will need to install a 32 bit OS ( “Raspberry Pi OS Lite” ):

The rest works a decribed above. This has been tested on a “Raspberry Pi 2 Model B V1.1”.

Using different version of the firmware or LbServer

The makefile allows to specify the versions to download and use. Example:

$ sudo make FIRMWARE_VER=2023-03-05 LBSERVER_VER=0.13 all

As of PiLocoBufferConfig version 0.1 the defaults are the values used in the example above.

If you need a special version not available of the source forge file system. Place the zip in folder PiLocoBufferConfig_0.1. Then make will skip the download an use the existing files. Use variables above. Example:

When you have

run

$ sudo make LBSERVER_VER=trunk all