Precisely Speaking
February 04, 2012, 06:43:28 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: So what's news with you?  Tell us about it in "Getting To Know You"!
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Stop RF Gun Wireless disconnects  (Read 1331 times)
Alex Copeland
Professional
***
Posts: 21


Artist's rendering


« on: March 19, 2010, 12:36:01 PM »

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 http://www.manpagez.com/man/1/screen/ (AIX RPMs here: http://www.oss4aix.org/download/RPMS/screen/) 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:

Code:
#!/bin/sh
export TERM=vt100

if screen -ls | grep "No Sockets found" > /dev/null 2>&1
  then
  screen -s /usr/local/bin/prelude.login
  exit 0
else
  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" ]
    do
    echo "Please enter 1 or 2."
    read yn
  done
  if [ "$yn" = "1" ]
    then
    screen -D -R $SCREEN
  fi
  if [ "$yn" = "2" ]
    then
    screen -s /usr/local/bin/prelude.login
  fi
fi

exit 0
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1524



WWW
« Reply #1 on: March 19, 2010, 02:13:14 PM »

Hey, THAT is cool.
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
Alex Copeland
Professional
***
Posts: 21


Artist's rendering


« Reply #2 on: March 19, 2010, 02:30:44 PM »

I've been wanting to roll screen out system wide, but there are few little hinky things about the VT100/VT220 terminal definition in Prelude and the way it works with xterm and Accuterm.  It mostly works, but little things like the down arrow doesn't work.  I haven't had the time to sit down and map out the right keys.

If anyone has done a comprehensive terminal definition in SB+ for xterm and/or Accuterm's VT100 emulation, I'd really like to see it.
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1524



WWW
« Reply #3 on: March 19, 2010, 02:40:49 PM »

Check this: http://www.precisonline.com/forum/index.php/topic,238.0.html

I believe these AccuTerm definitions were created for SB+ by Pete S himself.
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
Alex Copeland
Professional
***
Posts: 21


Artist's rendering


« Reply #4 on: March 19, 2010, 02:46:57 PM »

Thanks, Kevin.  If this works out, say goodbye to dropped sessions.  I will post my results.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!