Page 1 of 2

Serial Console giving scrambled output like "IKL\0xe9\0xd4!/%\0xa39!%" - SOLVED

Posted: Sun May 12, 2019 11:17 am
by geigerNoob
Hey Folks,

I think I need a little push into the right direction. I am missing something.

I have tried with

Code: Select all

screen /dev/ttyUSB0 9600
as well as with cutecom and minicom on linux, but everytime I just get this somewhat scrambled output. (Data bits: 8, Stop bits: 1, HW/SW handshake: off, Parity: None)

Example:

Code: Select all

IKL\0xe9\0xd4!/%\0xa39!%\0xbfq5-15\0x1b\0xbfy!\0x15#\0x175\0x1b\0xbf\0x9d\0xa3\0x9f\0x9f\0xe5\0xeb/\0x17\0x17\0x1f\0x8b\0xa1\0xa1%-1/\0x17
!/%\0xa39!%\0xa115-15\0x1b\0xe5\0xeb\0x00^\0x95u\0xfb\0xfb\0xa7\0xbfy_e\0xa7\0xbf\0x9f\0xa7\0xbf\0x15Y\0x13\0xa1/\0x1b\0xa7\0xbf\0x9f\0xa3\0x9f\0x9f\0xa7\0xbfYgaQ\0xe5\0xeb\0x00^\0x95u\0xfb\0xfb\0xa7\0xbfy_e\0xa7\0xbf\0x9f\0xa7\0xbf\0x15Y\0x13\0xa1/\0x1b\0xa7\0xbf\0x9f\0xa3\0x9f\0x9f\0xa7\0xbfYgaQ\0xe5\0xeb\0x00^\0x95u\0xfb\0xfb\0xa7\0xbfy_e\0xa7\0xbf\0x9f\0xa7\0xbf\0x15Y\0x13\0xa1/\0x1b\0xa7\0xbf\0x9f\0xa3\0x9f\0x9f\0xa7\0xbfYgaQ\0xe5\0xeb\0x00^\0x95u\0xfb\0xeb\0xa7\0xbfy_e\0xa7\0xbf\0x9d\0xa7\0xbf\0x15Y\0x13\0xa1/\0x1b\0xa7\0xbf\0x9f\0xa3\0x9f\0x9f\0xa7\0xbfYgaQ\0xe5\0xeb\0x00
The above output appears when the Geiger-Board is switched on.

It looks to me like there is something wrong with the encoding/decoding, but at the moment I just have this one computer (Ubuntu) available for testing. But since I get regular (around every sec) another "line" of this I guess the connection is setup correctly.

Can anyone give me a hint what I am doing wrong?

Re: Serial Console giving scrambled output like "IKL\0xe9\0xd4!/%\0xa39!%"

Posted: Mon May 13, 2019 9:16 am
by geigerNoob
Soo,... just in case someone else happens to see something similar.

Somehow it seems to be related to the two (!!) different TTL serial2USB adapters I was using. (For one I am quite sure it is a 3.3V adapter, the other I have no documentation [China cheapo crap].)
Anyway, today I tried the same two adapters with macOS (also using screen) and windows (using putty), but again just some weird output.

So, in desperation I took an Arduino Uno R3 and used that as a serial adapter (on macOS and Linux, both with screen using the command from above [portname in /dev/ differs obviously])... and tadda!

Example output received via screen:

Code: Select all

CPS, 1, CPM, 20, uSv/hr, 0.11, SLOW
CPS, 0, CPM, 20, uSv/hr, 0.11, SLOW
CPS, 0, CPM, 20, uSv/hr, 0.11, SLOW
CPS, 1, CPM, 21, uSv/hr, 0.11, SLOW
CPS, 0, CPM, 20, uSv/hr, 0.11, SLOW
CPS, 1, CPM, 21, uSv/hr, 0.11, SLOW
CPS, 0, CPM, 21, uSv/hr, 0.11, SLOW
CPS, 0, CPM, 20, uSv/hr, 0.11, SLOW
Maybe that is helpful to someone else too...

PS: if you want to know how an Arduino can be used as serial adapter...you basically just pull Reset to GND to bypass the muC and then connect to the RX/TX pins. In fact it is actually sufficient to connect TXD (Pin5) on the GeigerBoard the TX (Pin1) on the Arduino. (Seems strange, I was expecting the RX (Pin0) on the Arduino to be the receiver, but in my case I had to use Pin1.

PPS: One more hint... I also tried it with an RaspberryPi B+ using the RX on GPIO15 on the GPIO header. That does also work.

Pinouts can be found here:
https://www.teachmemicro.com/arduino-us ... converter/
https://myscope.net/geigerzaehler/

Re: Serial Console giving scrambled output like "IKL\0xe9\0xd4!/%\0xa39!%"

Posted: Mon May 13, 2019 10:57 am
by mightyohm
Sorry I couldn’t reply sooner. Glad you got it working. Any idea why your other usb serial adapters aren’t working?

Re: Serial Console giving scrambled output like "IKL\0xe9\0xd4!/%\0xa39!%"

Posted: Mon May 13, 2019 12:50 pm
by geigerNoob
Hi Jeff,

nope, no idea yet. It was in fact pure desperation that I tried it with the Arduino. (These little things saved my ass a few times already.)
Perhaps the driver of the serial2USB adapter I used isn't performing as expected... I don't know.

However, since I am currently working on a Qt software which should run on the RaspberryPi to fetch, log and plot the data I can live with this now. (As mentioned the GPIO serial interface on the Pi seemed to work too...)

Anyway, thanks for your reply anyway. - If I figure out more details I will share them here.

Re: Serial Console giving scrambled output like "IKL\0xe9\0xd4!/%\0xa39!%" - SOLVED

Posted: Wed May 05, 2021 12:21 pm
by luchenbe
I have exactly the same problem with both a Windows 10 computer with a USB-serial adapter and with a very old Windows 98 portable PC with hyperterminal on a hardware serial port. Both serial connection work flawlessly with other applications. Whatever I do, I get on both exactly the same unreadable output from the geiger counter. There must be some error in the firmware of the geiger counter. Is there an update of that firmware and if so, how can it be uploaded to the attiny controller?

Re: Serial Console giving scrambled output like "IKL\0xe9\0xd4!/%\0xa39!%" - SOLVED

Posted: Wed May 05, 2021 6:49 pm
by mightyohm
What USB-serial adapter are you using? Is it compatible with 3V serial levels? Many of them are, but that could be a source of problems.

Re: Serial Console giving scrambled output like "IKL\0xe9\0xd4!/%\0xa39!%" - SOLVED

Posted: Thu May 06, 2021 11:44 am
by luchenbe
It's a HAMA 00053325V2 but that's not the cause as I have exactly the same problem with an old Win98 laptop with a real serial port. I have also an old WinXP PC in my workshop on which I can test this tomorrow, but I don't think it will work either. In the mean time I checked the ceramic resonator based clock of the counter and it's close to 8 MHz, but I see quite a bit of jitter on it. I do not see this jitter on the serial output signal on pin 5 of the serial header. The serial signal there seems normal with levels between about 0.4V and 3 V and smallest puls width about 0.1 ms which seems consistent with a bitrate of 9600 bps. As you can see in the pictures the output is unreadable but almost every telegrams is identical and only when there was a puls detected there is one character different in the about 33 bytes long telegram.

Re: Serial Console giving scrambled output like "IKL\0xe9\0xd4!/%\0xa39!%" - SOLVED

Posted: Fri May 07, 2021 3:27 am
by luchenbe
I tested it again on an old Windows XP PC with a real serial port and it's exactly the same again. I then used the USB-serial adapter on that same PC and it gave exactly the same output... It has to be some problem with the serial output of the ATtiny.

Re: Serial Console giving scrambled output like "IKL\0xe9\0xd4!/%\0xa39!%" - SOLVED

Posted: Fri May 07, 2021 9:26 am
by mightyohm
The kit will not work with an ordinary RS-232 serial port! The voltage levels are wrong.

You need a USB-serial adapter that works with 3V voltage levels. Some but not all of them do.
I use the FTDI USB-serial cable but the Adafruit FTDI friend also works well (set it for 3V!)

If you flashed the firmware yourself (didn't buy a kit) then make sure you flashed the fuse bytes, as that's another common issue.

Re: Serial Console giving scrambled output like "IKL\0xe9\0xd4!/%\0xa39!%" - SOLVED

Posted: Tue May 11, 2021 3:47 am
by luchenbe
I build the complete kit from Elektor. Are there any updates in the firmware since then? Can a newer software version be flashed to the microcontroller?

About the serial interface problem: in the mean time I interfaced the Geiger counter to my portable PC via an Arduino Mega2560 and that works fine. What wonders me when using my RS232-USB adapter is that it receives consistent data of every time exactly the same length and only a few bytes change in intervals where the tube has been triggered. That makes me think it is really detecting the voltage levels correctly...