Month: April 2019

Imposto de Renda 2019 no Linux

Tentei instalar o programa de declaração de imposto de renda no Ubuntu 18.04 e tive alguns problemas:

$ chmod a+x IRPF2019Linux-x86_64v1.5.bin 
$ ./IRPF2019Linux-x86_64v1.5.bin 
/tmp/ijtmp_BAA7A551-D3D8-3B70-2DF2-FF72C5CFA51F/bin/xdg-open: 255: /tmp/ijtmp_BAA7A551-D3D8-3B70-2DF2-FF72C5CFA51F/bin/xdg-open: gnome-open: not found

Então instalei a libgnome2-bin para ver se resolvia o problema:

sudo apt install libgnome2-bin

Ao executar novamente notei que não havia instalado o Java 8 no meu computador, então segui estes passos para instalar:

How to Install JAVA 8 on Ubuntu 18.04/16.04, Linux Mint 19/18

Creio que o IRPF deveria ter uma forma mais inteligente de rodar no Linux, imagine uma pessoa leiga tentando instalar isso? Creio que este é um dos problemas que dificultaram o uso do Linux no Desktop.

Fake chip makes me nervous

I was trying to configure the Microchip/Atmel SAMD21 USART to work at 110BPS to use with an old ABNT CODI protocol.

I noticed that the Silabs CP2102 on Linux doesn’t support such low baudate:

$ sudo stty 110 cs8 -parenb -F /dev/ttyUSB0 
stty: /dev/ttyUSB0: unable to perform all requested operations

“Fortunately” I had a FTDI USB/Serial module that accepts this low baudrate. Then after spending many days trying to figure out why the communication at 110 BPS wasn’t working I decided to use the Logic Analyzer and discovered that the FTDI chip wasn’t generating the 110BPS.

Then I realized there are some FTDI fake chips that don’t work correctly at high speed. Now I can confirm they will not work correct at low speed either. Probably these fake chips use a microcontroller instead of a real IP for USB/Serial and they have loss of precision at low and high baudrates.

Then I decided to use two SAMD21 boards to test the communication, the first board will transmit at 110BPS and the second one will received the data at same baudrate. It worked fine.

Then I found a Prolific PL2303 USB/Serial dongle here and decided to test it. And to my surprise the PL2303 worked fine at 110 BPS and I could test it from computer to the board.

In the computer:

$ sudo stty 110 cs8 -parenb -F /dev/ttyUSB0
$ echo "Hello" > /dev/ttyUSB0

In the SAMD21 board:

nsh> dd if=/dev/ttyS0 of=/dev/console bs=1 count=10                             

This is a good 110BPS waveform:

Note that it wasted 90.752ms to transmit 10 bits, then each bit wasted 9.0752ms to be transmitted. Therefore to transmit 110 Bits it wastes 9.0752 * 110 = 998,272 ms. Nearly 1 second to transmit 110 bits, the error is only 0,17%.

So, never trust on your serial communication if you are using a USB/Serial from China.