Stop RF Gun Wireless disconnects


We had a problem with our RF barcode scanners that we use in our warehouse for inventory: every once in a while, they’d lose the connection to the host.  Sometimes when the connection got dropped, they’d be in the middle of picking an order, and the dropped connection left the order in a messy state.

In order to mitigate this problem, we use screen (AIX RPMs here: to abstract the session on the RF device — if the connection drops, the same user can just log back in and resume the screen session.  One caveat — screen is for all intents and purposes a VT100 terminal emulator, so you have to make sure that whatever you’re connecting to (in our case Prelude) is expecting VT100, and the device you’re using is expecting the same.

To automate this, part of the login script for our RF gun users is:

export TERM=vt100

if screen -ls | grep "No Sockets found" > /dev/null 2>&1
  screen -s /usr/local/bin/prelude.login
  exit 0
  SCREEN=`screen -ls | grep -v "screen" | awk '{print $1}'`
  echo "You are already logged on."
  echo "What do you want to do:"
  echo "1 - Resume Previous Session"
  echo "2 - Start a New Session"
  while [ ! "$yn" = "1" ] && [ ! "$yn" = "2" ]
    echo "Please enter 1 or 2."
    read yn
  if [ "$yn" = "1" ]
    screen -D -R $SCREEN
  if [ "$yn" = "2" ]
    screen -s /usr/local/bin/prelude.login

exit 0

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s