Question: i have python pyserial script to read value from serial port (scale)  

after set the correct baud, etc..  

on putty it returns a value with:

```
0.00 Kg  
0.00 Kg

```

but the value from pyserial `readline()`/`read()` returns a `bytearray` that contains invalid ascii:

```
b'  \xb0\xae\xb0\xb0 kg \r\x8a  '

```

* `\xb0`, `\xae` are equal to 176, 174 in decimal.
* character 0 in decimal should be 48, and 0x30
* character . in decimal should be 46, 0x2E

what is the problem here?

Answer: 
Notice that 176-128=48, and 174-128=46. Therefore, some of the numbers you see are larger than what you expect by 128. This means that the most significant bit (bit 7) is set for some of the characters, which in turn means that some of the communication settings (parity, length, stop bits) are wrong. Try with 7E1:

```
serial.Serial(..., bytesize=serial.SEVENBITS,
    parity=serial.PARITY_EVEN, stopbits=serial.STOPBITS_ONE)

```

I can't be certain these parameters are correct of course; you have to find the correct ones.
> 
> 
> > 
> > 
> > > 
> > > print chr(0xb0-0x80)
> > >  0
> > >  print chr(0xae-0x80)
> > >  .
> > >  etc - I suspect that you data length is set incorrectly, (data bits).
> > > 
> > > 
> > > 
> > 
> > 
> > 
> 
> 
>