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

Support forum for the mightyohm.com Geiger Counter.
http://mightyohm.com/geiger
geigerNoob
Posts: 3
Joined: Sun May 12, 2019 11:04 am

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

Post 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?
Last edited by geigerNoob on Tue May 14, 2019 1:12 am, edited 3 times in total.

geigerNoob
Posts: 3
Joined: Sun May 12, 2019 11:04 am

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

Post 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/
Last edited by geigerNoob on Mon May 13, 2019 12:57 pm, edited 2 times in total.

User avatar
mightyohm
Site Admin
Posts: 1028
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

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

Post by mightyohm »

Sorry I couldn’t reply sooner. Glad you got it working. Any idea why your other usb serial adapters aren’t working?

geigerNoob
Posts: 3
Joined: Sun May 12, 2019 11:04 am

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

Post 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.

luchenbe
Posts: 4
Joined: Wed May 05, 2021 12:12 pm

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

Post 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?
Attachments
IMG_20210505_215832.jpg
IMG_20210505_215933.jpg
IMG_20210505_215809.jpg

User avatar
mightyohm
Site Admin
Posts: 1028
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

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

Post 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.

luchenbe
Posts: 4
Joined: Wed May 05, 2021 12:12 pm

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

Post 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.

luchenbe
Posts: 4
Joined: Wed May 05, 2021 12:12 pm

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

Post 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.

User avatar
mightyohm
Site Admin
Posts: 1028
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

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

Post 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.

luchenbe
Posts: 4
Joined: Wed May 05, 2021 12:12 pm

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

Post 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...

Post Reply