The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

New Barcode Server and Client Application


  • Subject: New Barcode Server and Client Application
  • From: Tony Tofts
  • Date: Sun, 23 Nov 2003 14:42:00 +0000

Hi all,

xPL is pleased to announce the availability of it's community barcode
database server and client applications.

A web server for storing/maintaining barcodes and a 128 character
description has been set up at <a href="http://barcodes.xplhal.com";>http://barcodes.xplhal.com</a>
and
<a href="http://barcodes.xplhal.co.uk";>http://barcodes.xplhal.co.uk</a>

A vb6 xPL client application is available for download from
<a href="http://www.xplhal.com/xpl/xPL_Barcode.zip";>http://www.xplhal.com/xpl/xPL_Barcode.zip</a>
It requires a serial barcode device (currently tested with the devices
available from Laser)

A Linux client is under development for the same scanners

A second vb6 xPL Client is available for download from
<a href="http://www.xplproject.org.uk/files/xplbarcatlite.zip";>http://www.xplproject.org.uk/files/xplbarcatlite.zip</a>
It uses the low cost CueCat Scanner, currently available through ebay.

Obviously the usefulness of the database is dependent on how much data it
contains (currently just under 300 barcodes) so those using the system are
encouraged to contribute barcodes if your setup allows it.

If anyone already has a list of barcodes that they would like to contribute
I can arrange to upload them on-bulk into the database if you e-mail them
to
me off list.

The ability to add to the database via the client, and list/edit your
entries on the website, requires you obtain a username/password by
e-mailing
the xPL team at <a
href="/group/ukha_xpl/post?postID=RfjMA5vkrpzgE5k2Hx_3EAxZwHoQf4xXn-Z9FYGnotMi_xYMZJcVeOAhDHw1k3ySpl-rjwE5qXiuJQ">barcodes@x...</a>

Anyone may query the database (e.g.
<a href="http://barcodes.xplhal.com/?5000166054317";>http://barcodes.xplhal.com/?5000166054317</a>)
and it will return either the
product description or FAILED

The client application, which requires an internet connection be available
of course, can query the database for a scanned barcode and then sends an
xPL message containing the barcode and product description.

The client can be configured to prompt the user for a description if the
barcode is not found in the database, and then post it to the site for
everyone to benefit from.

Normally the xPL message contains
Barcode=<barcode>
[product=<description>] if available

Additionally the client can be configured to recognise certain barcodes as
commands. These are not looked up or broadcast but switch the client into a
command mode, whereby each subsequent scan (until the client is restarted
or
another command barcode is scanned) will add a command=<command> to
each xPL
message.

For testing purposes I setup 2 commands, shopping &amp; rubbish, and
this
allowed me to create a simple xPLHal script (see end of this message,
requires latest xql application) to update a 'shopping' xql table. From
this
a shopping list could be easily created. If using separate scanners for
shopping/rubbish there is no need to use a command=, since each scanner
could have it's own script. Other commands might be cd/video/dvd to allow
databases of these to be held.

The config items for the vb6 serial client are:
COMMANDS= 16 commands
BARCODES= 16 barcodes for above commands
SERVER= default is barcodes.xplhal.com
USERNAME= request from xPL team, required to add/edit database
PASSWORD= as above
INTERACTIVE= Y/N - should app prompt for description if unknown in database
COMPORT=1
BAUD=19200
DATABITS=8
PARITY=N
STOPBITS=1
FLOWCONTROL=N
RTSENABLE=N
DTRENABLE=N

The settings for the comport will need to match the configuration of the
barcode scanner, please refer to available documentation (in the case of
the
laser supplied scanners you can scan serial settings from the
documentation)

Regards
Tony
on behalf of the xPL Team


Sample xPLHal script
--------------------
sub tonyt_barcode_kitchen_Trigger(msg)
' process command
bccmd=ucase(xpl.getparam(msg,"COMMAND",true))
select case bccmd
case "SHOPPING","RUBBISH"
barcode=xpl.getparam(msg,"BARCODE",true)
description=xpl.getparam(msg,"PRODUCT",true)
if description="" then description="UNKNOWN"
if barcode<>"" then
' add to database if not there
mysql="COMMAND=ADD" &amp; chr(10)
mysql=mysql &amp; "SQL=SELECT * FROM [SHOPPING]" &amp;
chr(10)
mysql=mysql &amp; "BARCODE=" &amp; barcode &amp;
chr(10)
mysql=mysql &amp; "DESCRIPTION=" &amp; description
&amp; chr(10)
mysql=mysql &amp; "QUANTITY=0" &amp; chr(10)
call
xpl.sendmsg("xpl-cmnd","tonyt-xql.master","db.xql",mysql)
' increment quantity
mysql="COMMAND=ADJUST" &amp; chr(10)
mysql=mysql &amp; "SQL=SELECT * FROM [SHOPPING] WHERE
[BARCODE]='" &amp; barcode &amp; "'" &amp;
chr(10)
if bccmd="SHOPPING" then
mysql=mysql &amp; "QUANTITY=1" &amp; chr(10)
else
mysql=mysql &amp; "QUANTITY=-1" &amp; chr(10)
end if
call
xpl.sendmsg("xpl-cmnd","tonyt-xql.master","db.xql",mysql)
end if
end select
end sub

The 'shopping' table has the following fields
BARCODE - text 16
DESCRIPTION - text 128
QUANTITY - number






xPL Main Index | xPL Thread Index | xPL Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.