These are chat archives for CORE-POS/IS4C

28th
Jul 2016
danry25
@danry25
Jul 28 2016 08:22
Lemme try that patch @gohanman, nothing is written to the debug_fannie.log when the error occurs in QuickLookups in Fannie. On another note, I'm trying to get this NCR 7878 to work, I've set it up to emulate Magellan protocol, and if I directly attach to the serial port it dumps the barcodes to the terminal, but no luck with sudo mono pos.exe -v
Andy Theuninck
@gohanman
Jul 28 2016 10:42
I'm not sure what to add to the QuickLookups situation other than it indicates something in your environment is different than every production and test environment I have access to which doesn't isolate much about what the problem might be. Does dumps the barcodes to the terminal mean you're running cat /dev/ttyS0 or tail -f /dev/ttyS0 or similar? What's the actual output?
Finn
@thefinn93
Jul 28 2016 16:17
hey Andy, im helping debug this with Dan, it does dump barcodes when we tail/cat the TTY
Andy Theuninck
@gohanman
Jul 28 2016 16:27
I was more curious about the exact formatting. All my Magellan scales have multiple protocol output options, so I'm not sure NCR's "emulate Magellan" lines up with the one I'm expecting
Finn
@thefinn93
Jul 28 2016 16:28
oh hang on
0807869810142208078698101422
Andy Theuninck
@gohanman
Jul 28 2016 16:31
Hmm. My scales would kick that out as "S08A078698101422" follow by a carriage return. The driver is expecting both the prefix as a message type identifier and the carriage return as a separator between messages
Finn
@thefinn93
Jul 28 2016 16:31
hrm
i wonder how hard it would be to add support for this
or get this the scale to output what you're expecting
Andy Theuninck
@gohanman
Jul 28 2016 16:34
I think it mostly depends what kind of documentation you have on the protocol. The intention is that the driver process can hook in different modules as needed, so a SPH_NCR_Scale module could be swapped in for SPH_Magellan_Scale. It'd just have to parse the serial data and then call parent.MsgSend to pass values into the browser
Finn
@thefinn93
Jul 28 2016 16:35
ok
Finn
@thefinn93
Jul 28 2016 16:53
BTW is there any need to run the driver as root?
it seems like it just needs read maybe write access to /dev/ttyS0, read/write/create access to the ss-output/ directory and permission to bind to port 9450
right?
Andy Theuninck
@gohanman
Jul 28 2016 16:54
yep, that'd do it
Finn
@thefinn93
Jul 28 2016 16:55
okay, well we added the www-data user to the dialout group for something else (i think write access to /dev/usb/lp0), so it already had access to /dev/ttyS0, so im just gonna run it as www-data
Andy Theuninck
@gohanman
Jul 28 2016 16:55
Makes sense to me
Finn
@thefinn93
Jul 28 2016 16:59
ok cool
oh right one other place i varied from the wiki page: the sysvinit script (that goes in /etc/init.d/posdriver) looked questionable to me so i build a systemd service for it
is there anything other than start and stop?
like, i know sysvinit services can take random arguments
Andy Theuninck
@gohanman
Jul 28 2016 17:01
Not really, no. That sounds like the right approach to me. The sysvinit scripts usually aren't that portable because debian-ish and redhat-ish expect different commands/scripts to be available
Finn
@thefinn93
Jul 28 2016 17:01
yeah
[Unit]
Description=POS Driver
Wants=network.target
After=network.target

[Service]
ExecStart=/usr/bin/mono /var/www/IS4C/pos/is4c-nf/scale-drivers/drivers/NewMagellan/pos.exe -v
WorkingDirectory=/var/www/IS4C/pos/is4c-nf/scale-drivers/drivers/NewMagellan
User=www-data
Restart=always

[Install]
WantedBy=multi-user.target
this is what we've got
Andy Theuninck
@gohanman
Jul 28 2016 17:03
Nifty. Does systemd cope with the fact the driver's really a windows app and doesn't know how to double-fork and background itself properly?
Finn
@thefinn93
Jul 28 2016 17:04
yes
the default service type is simple, which expects it won't for at all
Andy Theuninck
@gohanman
Jul 28 2016 17:05
Does it pipe stdout/stderr into syslog or someplace else w/o an explicit log configuration?
Finn
@thefinn93
Jul 28 2016 17:05
yes
well, it puts it in the systemd journal
which debian writes to the syslog
but you can also do journalctl -f -u posdriver to just see it's output
Andy Theuninck
@gohanman
Jul 28 2016 17:06
Cool
Finn
@thefinn93
Jul 28 2016 17:09
BTW what's up with this
This message was deleted
$ git status
HEAD detached at 2.2.3-2016.07.20
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   fannie/install/LaneConfigPages/ini.php
makes it so ansible doesn't want to pull when i tell it to change versions
shouldn't that be in .gitignore?
Andy Theuninck
@gohanman
Jul 28 2016 17:10
Lemme check
No, that's gotta be included. What's the local modification?
Finn
@thefinn93
Jul 28 2016 17:14
it's got the DB password and stuff
diff --git a/fannie/install/LaneConfigPages/ini.php b/fannie/install/LaneConfigPages/ini.php
index 02bc0a4..91e57d9 100644
--- a/fannie/install/LaneConfigPages/ini.php
+++ b/fannie/install/LaneConfigPages/ini.php
@@ -25,15 +25,16 @@ class FakeLaneSession

 $CORE_LOCAL = new FakeLaneSession();

-$CORE_LOCAL->set('laneno', 0);
+$CORE_LOCAL->set('laneno',99, True);
 include(dirname(__FILE__) . '/../../config.php');
-$CORE_LOCAL->set('localhost', $FANNIE_SERVER);
-$CORE_LOCAL->set('DBMS', strtolower(str_replace('_','',$FANNIE_SERVER_DBMS)));
-$CORE_LOCAL->set('localUser', $FANNIE_SERVER_USER);
-$CORE_LOCAL->set('localPass', $FANNIE_SERVER_PW);
-$CORE_LOCAL->set('pDatabase', $FANNIE_OP_DB);
-$CORE_LOCAL->set('tDatabase', $FANNIE_TRANS_DB);
+$CORE_LOCAL->set('localhost','127.0.0.1', True);
+$CORE_LOCAL->set('DBMS','MYSQLI', True);
+$CORE_LOCAL->set('localUser','IS4C', True);
+$CORE_LOCAL->set('localPass','highly_secure_password', True);
+$CORE_LOCAL->set('pDatabase','opdata', True);
+$CORE_LOCAL->set('tDatabase','translog', True);

 ini_set('error_log', dirname(__FILE__) . '/../../logs/php-errors.log');

-}
+}$CORE_LOCAL->set('store_id',1, True);
+?>
\ No newline at end of file
at some point i'd like to have this information automatically provided by Ansible, but I haven't been able to work out the best way to do that yet
Andy Theuninck
@gohanman
Jul 28 2016 17:17
Strange. The file's not supposed to contain any real configuration on the server side. The interface is just meant to edit the parameters table (which can be synced out to the lanes). Lane number zero is supposed to suppress writing/changing any settings that live in ini.php rather than in the database.
Finn
@thefinn93
Jul 28 2016 17:18
hrm... welll that's what im seeing right now. i'll play with it more and see if i can determine the cause
gtg for now though, thanks for your help
danry25
@danry25
Jul 28 2016 19:04
Hmm, in regards to scales it should be giving a carriage return but it isn't, I reprogramed it to match the datalogic spec on page 102 of this manual: https://atgsupportcentral.motorolasolutions.com/content/emb/docs/manuals/17263307a.pdf
I know unmodified it does a carriage return
I'd try a MP6200 if they weren't all fused to the Walmart flash
guess I'll play with it some more
Finn
@thefinn93
Jul 28 2016 20:24
@danry25 how about the stuff on page 104?
danry25
@danry25
Jul 28 2016 20:37
I had something composed, but gitter disposed of the paragraph I had written on how to use the NCR config tool
Andy Theuninck
@gohanman
Jul 28 2016 20:46
The spec doesn't match the actual output that Datalogic scale produce, or at least every Magellan branded scale model I've worked with - e.g., UPC-A scans are prefixed with "S08A". I've never seen a formal protocol specification of what they're supposed to do, I've just observed what bytes they send down the wire
danry25
@danry25
Jul 28 2016 20:47
So the S I believe is a system prefix, and the A is the Barcode type identifier
Andy Theuninck
@gohanman
Jul 28 2016 20:48
Which not only differs from the spec but also doesn't explain what the "08" is. It's certainly not the length of the UPC-A value that follows that prefix
danry25
@danry25
Jul 28 2016 20:48
no
its a system prefix iirc
Idk, Ian would know more about this than me
Andy Theuninck
@gohanman
Jul 28 2016 20:51
I know a lot of the scales have a dual cable mode with barcode scans over one serial connection and weight data over a second serial connection as well as a single cable mode with both types of data on the same wire. I've always used the latter. There may be additional message type identifier bytes in that mode
danry25
@danry25
Jul 28 2016 20:53
eh
Yeah
I've seen it with Honeywell MS2320's, but I just convert them to single cable
Btw, avoid Honeywell's scale/scanners, their scale unit loves to die for no reason. We're down to 3 left in service at this point, from 15, just waiting for the last 3 to croak
Asa
@asapdx
Jul 28 2016 23:34
I'm trying to run a command from inside a parser, how do I do that?
I'm trying to run TL and then CA from a single command that I'm defining.