Tips and Tricks

Using the binaries from the installation packages with a STANDARD board

The binaries in the installation packages were compiled for the FULLSPEC board. The "--connect_type/-C" option allows s2p to be used with a STANDARD board. Alternatively, this can be configured in /etc/s2p.conf:

connect_type=STANDARD

The tools for initiator mode naturally always require a FULLSPEC board.

Managing SCSI2Pi with the PiSCSI web UI

SCSI2Pi is compatible with the PiSCSI web UI, which you can install before or after installing SCSI2Pi. Unfortunately, especially the old web UI does not work with unknown device types, even though this would not be a technical problem. Therefore, you can hide the SCSI-to-USB bridge from the web UI. To do this, launch s2p with -w SCSG or add this setting to /etc/s2p.conf:

without_types=SCSG

This setting also affects the SCSI Control app, so that you cannot create a SCSI-to-USB bridge anymore.

Device Files (Block Devices) as Image Files

s2p can use block devices such as /dev/sda or /dev/sr0 instead of regular files. They are automatically assigned the device types SCHD or SCCD.

>s2p -i 0 /dev/sda -i 1 /dev/sr0

This makes it particularly easy to exchange data with other devices using USB storage media.

BlueSCSI/ZuluSCSI compatibility mode

s2p supports the BlueSCSI/ZuluSCSI naming convention for image files. This convention defines how to encode the SCSI ID, LUN and sector size in a filename.

>s2p -B HD02_1024_vendor:product:revision.hds

The command above creates a SCSI hard drive with SCSI ID 0, LUN 2 and 1024 bytes per sector. The product data for the INQUIRY command are "vendor:product:revision". Setting the product data with the filename is an extension of SCSI2Pi, which is not supported by BlueSCSI/ZuluSCSI.

Logging

s2p uses the spdlog library for logging. You can define the logging format on the command line or in /etc/s2p.conf, e.g. in order to add the usually not needed timestamps:

>s2p -l "[%Y-%m-%d %H:%M:%S.%e] %n [%^%l%$] %v" ...

Or as a permanent setting in /etc/s2p.conf:

log_pattern=[%Y-%m-%d %H:%M:%S.%e] %n [%^%l%$] %v

The spdlog documentation explains all available settings.

s2p also supports logging data packets. With --log-limit you to can specify how many bytes of data are logged per command.

Caching

s2p supports various caching modes. Which mode provides the best throughput depends on the Pi model and the available memory. Thus the proof of the pudding is in the eating. The following table lists the available settings. Note that these may change in upcoming SCSI2Pi releases. You select the caching mode for each device separately, with the command line option "--caching-mode" or the property "caching_mode", e.g in /etc/s2p.conf.

Mode Remark
piscsi This is the default setting. It is a simple cache, which can only deal with complete sectors. Thus this cache only partially supports the SCSI commands READ/WRITE LONG.
linux This cache uses the Linux filesystem cache and needs the least memory. Like the following modes it fully supports the SCSI commands READ/WRITE LONG.
linux-optimized Like linux, but reads/writes several sectors at once and requires more memory.
write-through Like linux, but writes back the image file data immediately.

Networking

When using the DaynaPort emulation, based on the information in the PiSCSI wiki, there is no need to manually set up a bridge. On launch, s2p automatically creates a bridge for physical interfaces ("eth*"), if needed, and automatically removes it when terminating. The bridge creation can be switched off if needed:

>s2p -i 6 -t scdp bridge=false

With a Pi that has both an ethernet and a Wi-Fi interface, s2p uses the ethernet interface for the DaynaPort emulation. wlan0 is used instead of eth0 when launching s2p with the interface option, optionally with an IP address and/or a netmask:

>s2p -i 6 -t scdp interface=wlan0[:inet=a.b.c.d/m]

As an alternative, e.g. in /etc/s2p.conf, you can configure the interface and the netmask with a property:

device.6:0.params=inet=10.10.20.1/24:interface=wlan0

Atari users who use the STiNG driver for the DaynaPort should use the latest version 0.81 (from 2024) of this driver.