Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry 4 issue #8

Open
SandnerSoft opened this issue Aug 5, 2020 · 7 comments
Open

Raspberry 4 issue #8

SandnerSoft opened this issue Aug 5, 2020 · 7 comments

Comments

@SandnerSoft
Copy link

SandnerSoft commented Aug 5, 2020

Hello,

i changed from Raspberry 3 to the Raspberry 4 2GB.
On Rasp 3 all connections and readings are fine.

On Rasp 4, i have serial timeouts.

  • ttyebus is under /dev
  • ttyAMA0 is hidden in /dev

Log:
Aug 5 11:43:35 Rasp4Ebus kernel: [ 2.666454] ttyebus: loading out-of-tree module taints kernel.
Aug 5 11:43:35 Rasp4Ebus kernel: [ 2.667184] ttyebus: register_device() is called
Aug 5 11:43:35 Rasp4Ebus kernel: [ 2.667245] ttyebus: Found RASPI model 4
Aug 5 11:43:35 Rasp4Ebus kernel: [ 2.667298] ttyebus: registered character device with major number = 241 and minor numbers 0...255
Aug 5 11:43:35 Rasp4Ebus kernel: [ 2.667609] ttyebus: Successfully requested IRQ 34
Aug 5 11:43:35 Rasp4Ebus kernel: [ 2.667653] ttyebus: device created correctly
Aug 5 11:43:44 Rasp4Ebus kernel: [ 16.494422] ttyebus: Open at at major 10 minor 60
Aug 5 11:43:44 Rasp4Ebus kernel: [ 16.494426] ttyebus: Open exit
Aug 5 11:43:44 Rasp4Ebus kernel: [ 16.494752] ttyebus: Poll request
Aug 5 11:43:45 Rasp4Ebus kernel: [ 16.494759] ttyebus: Poll timeout
Aug 5 11:43:45 Rasp4Ebus kernel: [ 16.745015] ttyebus: Poll request
Aug 5 11:43:45 Rasp4Ebus kernel: [ 16.745021] ttyebus: Poll timeout
Aug 5 11:43:45 Rasp4Ebus kernel: [ 16.745063] ttyebus: Poll request
Aug 5 11:43:45 Rasp4Ebus kernel: [ 16.745068] ttyebus: Poll timeout
Aug 5 11:43:45 Rasp4Ebus kernel: [ 16.995327] ttyebus: Poll request
Aug 5 11:43:45 Rasp4Ebus kernel: [ 16.995333] ttyebus: Poll timeout

ls -l /dev/tty:*
crw-rw-rw- 1 root root 10, 60 Aug 5 11:43 /dev/ttyebus
crw------- 1 root root 5, 3 Aug 5 11:43 /dev/ttyprintk
crw-rw---- 1 root dialout 4, 64 Aug 5 11:43 /dev/ttyS0

uname -a:
Linux Rasp4Ebus 5.4.51-v7l+ #1327 SMP Thu Jul 23 11:04:39 BST 2020 armv7l GNU/Linux

any idea?

thanks

@tjach
Copy link

tjach commented Oct 25, 2020

Hi there!

I've been struggling with this problem for a week, but probably found a solution.

  1. Do not use the ttyebus module on Raspberry 4 (uninstall it completely)
  2. Use a standard ttyAM0 device
  3. Inside your /boot/config.txt make sure to have these options:
[all]
dtoverlay=disable-bt
# enable_uart=0

It's probably going to work with bluetooth overlay set to miniUART (as the instruction here in Readme.md), but I do not use bluetooth on my RPi.

  1. Extremely important - set a bigger latency to your ebus (this is my options line from /etc/default/ebus):

EBUSD_OPTS="--scanconfig -d /dev/ttyAMA0 --enablehex --latency=60000"

Hope it helps,

@SandnerSoft
Copy link
Author

@tjach
Hello,

big thanks.
It's works.

@Eraser-1
Copy link

Don't you have then possible timing errors without the ttyebus?

It looks like that on the newer Kernels for Rpi that something has changed.
It was discussed here, and Galileo uploaded then an older version of it.
This helped me to get it running.

https://forum.fhem.de/index.php/topic,84636.msg1080948.html#msg1080948

@tjach
Copy link

tjach commented Oct 27, 2020

Hi @Eraser-1,

It's been working for 3 days now without any problems.

@NimlothPL
Copy link

I can confirm - it works without this driver :)
Thanks for finding it ... I thought that I messed something else and reinstalled system

@scottie1
Copy link

I tried the above, but unfortunately I still observe ebus timing errors. I am running Raspbian with kernel version 5.4.83-v7l+ on Raspberry Pi 4.
With the ttyebus driver uninstalled I ran:
dmesg | grep tty
This reports:
[ 1.194315] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 29, base_baud = 0) is a PL011 rev2

So the ttyAMA0 is connected to IRQ 29. I edited the ttyebusm.c file (V1.8) and changed the IRQ on line 192 from 34 to 29. Then rebuild and install the ttyebus driver.
The ebus now runs perfectly with no errors reported.

@mdk2412
Copy link

mdk2412 commented Mar 10, 2022

With kernel 5.10.103-v7l+ the IRQ has changed to 36. At least on my raspi 4 running buster legacy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants