Scales Integration

OK, upgraded to 5.3.6 (painlessly may I add :slight_smile: ).
Iā€™ve added the Action, Automation Command and Rule as per the tutorial. Iā€™m thinking I need to get the format right in the properties of the scale.
Hereā€™s what I have so far:
Scales Properties

And this is the message coming back from the scales (after sending the W in PuTTY):
PuTTY

One other thing Iā€™ve noticed is that the ā€˜Testā€™ option doesnā€™t become available where the Scale is added?

1 Like

Tried this as well:

Scales Properties-2

Still not working as expected.

I have a barcode reader/scanner, do you think that might be interferring with the scale data?

From the scale.log:

9/02/2022 12:18 pm
9/02/2022 12:18:17 pm Custom Scale>Finalize Start,COM7
######################### E N D #########################
9/02/2022 12:18 pm
9/02/2022 12:18:18 pm Custom Scale>Finalize End,COM7
######################### E N D #########################
9/02/2022 12:18 pm
9/02/2022 12:18:18 pm Custom Scale>Init Start,COM7
######################### E N D #########################
9/02/2022 12:18 pm
9/02/2022 12:18:18 pm Custom Scale>Init End,COM7
######################### E N D #########################
9/02/2022 12:18 pm
9/02/2022 12:18:40 pm Custom Scale>Data:W,COM7
######################### E N D #########################
9/02/2022 12:18 pm
9/02/2022 12:18:40 pm Custom Scale>Data:W,COM7
######################### E N D #########################

Will the scale.log show data returned from the scale?

Iā€™ve tried ##.### to match the returned data in putty but still no joy with SambaPOS.

Still canā€™t get this to work. One thing Iā€™ve noticed is that each time I press the ā€˜scaleā€™ button (the one I created to send data to the scale) there are 7 entries in the scale.log, doesnā€™t seem right to me.

So Iā€™ve installes a Serial Port Monitor and this is what I get (for a weight of 125g)

30 30 2E 31 32 35 0D 00.125.

82 30 30 2E B1 B2 35 8D ā€š00.Ā±Ā²5Ā

The top is through PuTTy after sending the upper case W, the bottom is what happens through SambaPOS. Could this be an installed language mismatch?

If I check the ā€˜Override Windows Regional Settingsā€™ checkbox

Language

I get this (which is the correct weight) but it has a leading comma.

82 30 30 2E 30 39 30 8D ā€š00.090

Still nothing comes up in the keyboard input box.

Will checking the ā€˜Override Windows Regional Settingsā€™ checkbox have any detrimental effects?

Iā€™ve tried heaps of combinations of RegEx but canā€™t get anything to work.
Any suggestions would be appreciated.

if the decimal is always present, [0-9]+\.[0-9]+ should get you the last part after the comma

image

https://regexr.com/ is my go-to playground

Tried that but still nothing. I did notice in Scale.log that the date format is US though:

Today in the 7th of May

5/7/2022 12:46 PM
5/7/2022 12:46:31 PM Custom Scale>Data:W,COM1
######################### E N D #########################
5/7/2022 12:46 PM
5/7/2022 12:46:39 PM Custom Scale>Data:W,COM1
######################### E N D #########################

Which POS scale device are you using? What version of SambaPOS are you using?

I see in putty just the decimal gets passed. For the other strings with more characters, where are those coming from? Putty? In POS?

Maybe I can mock something on my end, attach a debugger and see whatā€™s going on inside, but I need good test data.

Is this look like the scale youā€™re using:

image

That looks like it.

Iā€™m on 5.3.6

Cheers.

Looks like I found the right docs. Let me comb through them and see whatā€™s going on under the hood. Iā€™ll be in touch.

Awesome, thanks for your help :+1:

Hereā€™s a test utility I whipped up that will log the responses from the scale. Any responses from the scale will show in the right-hand text box.

Select the COM port to which the scale is connected.

I have set the other options to the defaults as specified in the manufacturerā€™s documentation so they shouldnā€™t need to be changed.

When you click ā€œStartā€, a timer will be enabled at a 1s interval. When the timer ticks, the init string will be sent to the specified COM port. Once a response is received, the timer will restart. This will keep going until ā€œStopā€ is clicked.

Firstly, Iā€™d like you to select the ā€œEmulate POSā€ option. This will create a connection that mirrors how SambaPOS does it.

Click ā€œStartā€, weigh a couple of things then click ā€œStopā€. In the executing folder, rename log.txt to log_pos.txt before continuing and set aside to send me.

Then deselect ā€œEmulate POSā€, click start and weigh some more things then click ā€œStopā€.

Zip log.txt and log_pos.txt and send to me. Iā€™ll have a look at the responses and go from there.

Binary is found in the bin directory. Source code is included.

TestingPosScale.zip (33.7 KB)

2 Likes

Wow!!! That is awesome, cheers.

Itā€™s 7pm here so Iā€™ll try it after work tomorrow and report back.

Sorry for the delay.

When I click Emulate POS I get a Port is already open error:
Port Open

Nothing else is running, if I close the app then run PuTTy I can access to port fine.
If I uncheck Emulate POS nothing happens. I tried typing a W, then I tries using PuTTy and got access denied error. How do I send the W in this mode?