serial port - Ruby serialport randomly misses bytes -


someone using serialport library noticed or it's me? found (very) few people in same situation got no solution.

here example of ruby serialport:

ff d8 ff e0 00 4a 46 49 46 00 01 02 03 04 05 06 07 08 09 0a ff db 00 43 00 10 0c 0c 0e 0c 0a 10 0e 0e 0e 12 12 10 14 18 28 1a 18 16 16 18 32 24 26 1e 28 3a 34 3e 3c 3a 34 38 38 40 48 5c 4e 40 44 58 46 38 38 50 6e 52 58 60 62 68 68 68 3e 4e 72 7a 70 64 78 5c 66 68 64 ff db 00 43 01 12 12 12 16 16 16 30 1a 1a 30 64 42 38 42 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 36 00

here example of gtkterm, @ same time!

ff d8 ff e0 00 11 4a 46 49 46 00 01 02 03 04 05 06 07 08 09 0a ff db 00 43 00 10 0c 0c 0e 0c 0a 10 0e 0e 0e 12 12 10 14 18 28 1a 18 16 16 18 32 24 26 1e 28 3a 34 3e 3c 3a 34 38 38 40 48 5c 4e 40 44 58 46 38 38 50 6e 52 58 60 62 68 68 68 3e 4e 72 7a 70 64 78 5c 66 68 64 ff db 00 43 01 12 12 12 16 16 16 30 1a 1a 30 64 42 38 42 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 36 00

i'm using ftdi breakout , device uart interface. seems random :( it's serialport-1.0.4 installed "sudo gem install serialport".

thanks!

not sure if stumbled upon in researches, article mentions modification serialport.c fixes bug: ruby, ruby-serialport , missing bytes

here's text link in case ever goes down:

so did make work ruby-serialport? made small change serialport.c file:

--- ruby-serialport-0.6/serialport.c    2003-02-13 20:55:48.000000000 +0100 +++ ruby-serialport-0.6-new/serialport.c        2006-11-22 17:04:37.000000000 +0100 @@ -608,7 +608,7 @@ static value sp_create(class, _port)    break;    } -  fd = open(port, o_rdwr | o_noctty | o_ndelay); +  fd = open(port, o_rdwr | o_noctty | o_ndelay | o_nonblock);    if (fd == -1)    rb_sys_fail(port);    if (!isatty(fd)) { 

Comments