Web application scanner not working on MC2180

Hello there,

In the last few weeks i have developed a web-app for the Motorola SB1 (Smartbadge).

A few days ago we bought a new scanner the MC2180. The adverts said all applications (including web) should be compatible across all platforms.

But when i try to use the MC2180 scanner in my web-app it dousn't work. I am using the following JS to enable and use the scanner (Working on the SB1).

<META HTTP-Equiv="scanner" Content="enabled">

<META HTTP-Equiv="scanner" Content="AutoEnter:Enabled">

<META HTTP-Equiv="scanner" Content="Start">

<META HTTP-Equiv="scanner" Content="DecodeEvent:url('javascript:decodeEvent(%s, %s, %s);')">

    function detected(a, b, c) {
//console.log(a, b, c);
}
function decodeEvent(a, b, c) {
document.getElementById('terms').value = a; // Vult de waarde uit de scanner in het texfield
document.getElementById('searchform').submit(); // Post de gescande waarde
scanner.stop();
}

Can anyone help me? I would really appreciate any help, on getting the MC2180 working with my web-app.

Kind regards,

Pelle Braam

Pietro Francesc...
Hi Pelle,there're two version

Hi Pelle,

there're two version of our MC2180 and one of these version uses Windows Embedded 6.0 Professional and Internet Explorer.

Are you sure that you're using the RhoElements browser to navigate to your webpage?

Ciao

~Pietro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pelle Braam
Thank for the response,Yes I

Thank for the response,

Yes I am sure I am using the RhoElements browser.

I don't have the Internert Explorer option, only RhoElements Basic Browser and RhoElements 2 Runtime.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pietro Francesc...
Ok, good.You wrote that it

Ok, good.

You wrote that it doesn't works on MC2180. Can you explain what is the issue?

Is the Barcode reader turned active?

Is it reading a Barcode, acknowledging it with a beep?

And I've a note about the DecodeEvent function.

Usually it expect to pass 6 parameters, if you just need the data, you can use a JSON object:

<META HTTP-Equiv="scanner" Content="DecodeEvent:url('javascript:decodeEvent(%json);')">

And the use the JSON object in your function:

function decodeEvent(jsObject) {

  document.getElementById('terms').value = jsObject.data; // Vult de waarde uit de scanner in het texfield

  document.getElementById('searchform').submit(); // Post de gescande waarde

  scanner.stop();

}

Ciao

~Pietro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pelle Braam
Oke, The barcode reader is

Oke,

The barcode reader is active, the scanner is beeping. The problem is, that the input field is not getting filled with the scanned data.

I tried the code you posted on both the MC2180 and the SB1.

The SB1 is working fine and showing the scanned code, where as the MC2180 scans, beeps and does nothing.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pietro Francesc...
Do you have DataWedge enabled

Do you have DataWedge enabled on the MC2180?

it may interfere with RhoElements on the device.

You can find information on where's DataWedge and how to disable it on MC2180 user manual:

https://portal.motorolasolutions.com/Support/US-EN/Resolution?solutionId=90463&productDetailGUID=67e6e3883f840410VgnVCM1…

Here's a direct link to the English version, take a look at page 3-5.

Best regards

~Pietro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pelle Braam
Thanks for the fast response

Thanks for the fast response,

No DataWedge is not enabled.

Regards

Pelle

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pelle Braam
Anyone suggestions on what

Anyone suggestions on what else i could try?

Would really appreciate some input!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robert Galvin
Pelle,I would suggest for

Pelle,

I would suggest for verifying the device is working that you setup Enterprise Browser 1.3 and use the remote web inspector. This will definitely be very helpful in debugging JavaScript. It is not clear to be that the decodeEvent is getting fired, or that it is being fired but the rest of the JS does not run. Although EB does not technically support 2180, I think the CAB file will still install (be sure to use Webkit version so that the remote debug works).

Rob

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pelle Braam
Thanks for the response Rob,I

Thanks for the response Rob,

I was reading trough the above post and noticed Pietro saying disable DataWedge.

When I checked DataWedge it was indeed disabled. I just tried to use my app with DataWedge enabled, and now it works!

Well almost, i do have to to select te input field myself, but the scanner fills the field now.

Any suggestions on why the scanner is not picking the input field automatically?(It is working on the SB1)

Thanks in advance,

Pelle

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pietro Francesc...
Hi Pelle,it's DataWedge

Hi Pelle,

it's DataWedge reading the barcode, not RhoElements API.

DataWedge sends the data as keyboard entry, this is why you need to have selected the input field.

One question, how are you loading your JavaScript files? through a web server or using a file:// URI?

in the second case may be an issue of the browser disabling JavaScript for security.

There's anything in RhoElements logs (under /Programs/RhoElements)?

Ciao

~Pietro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pelle Braam
Hi Pietro,I am importing the

Hi Pietro,

I am importing the JS file from my webserver. I cannot find the suggested log file?

I think i can fix some auto focus on the fields, but in that case i will have to make separate code for the SB1 and the MC2180...

So would be nice if the JS I am using would detect the scanner on the MC2180.

Thanks in advance

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Robert Galvin
It sounds like either:The

It sounds like either:

  • The version of Rho has an issue with the scanner Meta Tags
  • The way you have it setup is not correct
  • There is a JS error preventing the call to the JS function handler

I would suggest that you try Enterprise Browser  1.3 and the remote web inspection like I mentioned.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pelle Braam
Hi Rob,I have tried to

Hi Rob,

I have tried to install EB.

I have configured the config.xml file. Only problem,  when i click the EB link in the programs menu, its not starting.

Right now i made a quick fix, setting a auto focus on the input fields, but I would like to have a better js solution.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi,I think Rob's suggestions

Hi,

I think Rob's suggestions have merit here.  From the code above you haven't surrounded your %s with quotes, without quotes the browser potentially interprets them incorrectly as arrays though I know this doesn't explain why it worked fine on SB1:

From the Scanner help documentation example:

<Meta http-equiv="scanner" content="DecodeEvent:url('Javascript:doScan('%s');')">

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pelle Braam
Hi Darryn,I have tried your

Hi Darryn,

I have tried your code, but unfortunately it's not working. Luckily I have solved the problem already, with a dirty shortcut .

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments