billhsu / jUART

Cross platform browser plugin for serial port communication from JavaScript
202 stars 76 forks source link

Data Received is truncated #10

Closed maazhmd closed 10 years ago

maazhmd commented 10 years ago

Hi, I am reading data from a weighbridge. The data read is truncated. The data received is of the form

)8 43020 00 )8 43020 00 )8 43020 00

but I receive only )8 430 in javascript.

I have checked the port setting and I am setting them right.

Regards

billhsu commented 10 years ago

Hi maazhmd, Can you explain a bit more about it? I'm not sure what is ")8 43020 00"

Bill

On Mon, Sep 8, 2014 at 6:48 PM, maazhmd notifications@github.com wrote:

Hi, I am reading data from a weighbridge. The data read is truncated. The data received is of the form

)8 43020 00 )8 43020 00 )8 43020 00

but I receive only )8 430 in javascript.

I have checked the port setting and I am setting them right.

Regards

Reply to this email directly or view it on GitHub https://github.com/billhsu/jUART/issues/10.

maazhmd commented 10 years ago

Hi,

I have recorded the input coming from the weignbridge using putty. the received data is of the form

)8 54930 00 )8 54930 00 )0 54930 00 )0 54930 00

There is a STX character before the ) which is lost in the sample above due to formatting.

But when I read this data using the plugin, I get only the first eight characters. In the receive function the value of size param is 8 and when I do a bytes.length also I get 8. And thus the read string is )0 549 with the following characters truncated.

billhsu commented 10 years ago

Hi,

Isn't 05493000 8 bytes? What's the hex sequence you are expecting? (no formating it please.. ) I tested the plugin with much longer receiving data length, it should work fine.

Sent from Sony XPERIA On Sep 8, 2014 9:07 PM, "maazhmd" notifications@github.com wrote:

Hi,

I have recorded the input coming from the weignbridge using putty. the received data is of the form

)8 54930 00 )8 54930 00 )0 54930 00 )0 54930 00

There is a STX character before the ) which is lost in the sample above due to formatting.

But when I read this data using the plugin, I get only the first eight characters. In the receive function the value of size param is 8 and when I do a bytes.length also I get 8. And thus the read string is )0 549 with the following characters truncated.

Reply to this email directly or view it on GitHub https://github.com/billhsu/jUART/issues/10#issuecomment-54814234.

maazhmd commented 10 years ago

Hi Shipeng Xu,

After two days of trying various options, I am just baffled.

I have tested on two machines.

Windows 7 32bit -> I get the complete 16 bytes. Windows 7 64bit -> I get only 8 bytes of the 16 byte string.

I tried with a simulation on virtualbox, Windows 7 64 bit. Here I got the complete 16 bytes and longer also.

I then thought maybe there was a port setting that I am missing and tried to use a software simulated port (as all settings are in my control then for that port). I used com0com to create a virtual port pair and redirect the real comport to this and tried reading from the virtual port. But that didn't work aswell. I started receiving shorter strings of 2 to 4 bytes.

In all the tests once a while I do get the complete string. But thats just about 1 in 100 reads.

Any ideas on how I can approach on trouble shooting this?

billhsu commented 10 years ago

It sounds like a bug in jUART.. Can you share me with your code snippet? I will try working on it during weekends.

Meanwhile you may compile the source code and try.. Maybe it will work if you compile the binary on your own machine.

Bill

Sent from Sony XPERIA On Sep 10, 2014 9:56 PM, "maazhmd" notifications@github.com wrote:

Hi Shipeng Xu,

After two days of trying various options, I am just baffled.

I have tested on two machines.

Windows 7 32bit -> I get the complete 16 bytes. Windows 7 64bit -> I get only 8 bytes of the 16 byte string.

I tried with a simulation on virtualbox, Windows 7 64 bit. Here I got the complete 16 bytes and longer also.

I then thought maybe there was a port setting that I am missing and tried to use a software simulated port (as all settings are in my control then for that port). I used com0com to create a virtual port pair and redirect the real comport to this and tried reading from the virtual port. But that didn't work aswell. I started receiving shorter strings of 2 to 4 bytes.

In all the tests once a while I do get the complete string. But thats just about 1 in 100 reads.

Any ideas on how I can approach on trouble shooting this?

Reply to this email directly or view it on GitHub https://github.com/billhsu/jUART/issues/10#issuecomment-55117131.

maazhmd commented 10 years ago

Hi

I tried compiling on Windows 7 64 bit visual studio 2008 firebreath-1.7

I got the error Error fatal error LNK1000: Internal error during IncrBuildImage jUART jUART

I am trying to analyse if I have gone wrong anywhere.

Also when I use git to clone the directory I get an access error. I am using the command git clone git@github.com:billhsu/jUART.git. So I copied the zip file I downloaded into the folder.

Regards Maaz

maazhmd commented 10 years ago

Not sure what exactly resolved the error.

I had earlier copied the dll to an independent directory under user profile and registered it. Refer earlier issue thread.

Later installed mozilla and registered the dll as a plugin from there. It works. the original dll no recompile required.

Regards