-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Read timeouts while reading (not sending) #91
Comments
your issue is different and might be related to using the GPIO. Please check this wiki entry: |
I've already seen that page. It doesn't have much useful info on it, unfortunately. Interestingly, I'm using the same boiler as the original author (an EcoFit Pure). It's not clear to me what could be causing this. I believe the latency issue is just on sending, but even if it's on reading that will surely just make the whole signal delayed - it won't affect the timing of individual bits and bytes. |
@russss as the original author of that wiki page, can you add any further info here? (Also, do you have a CSV file for an EcoFit Pure and/or a VR33?) |
try adding the --latency parameter as described on that page. |
Here's one without the
|
Here's one with
|
as you can see in the snippet: |
I'm stuggling to understand how the RPi GPIO/UART can be this bad? If it was this fundamentally broken, surely people would be up in arms about it and it would have been fixed? I'm using it successfully on another project at 115,200 baud with no noticeable issues. Is it possible my error is down to trimming? |
This looks relevant, but doesn't provide any kind of solution: https://www.raspberrypi.org/forums/viewtopic.php?t=170945&p=1095466 I wonder how @russss is getting his to work with no issues! Also, the fact that it seems to be kernel based but this article suggests it's a hardware thing. Perhaps the kernel can re-configure the hardware but doesn't expose that to anything in user-land. |
Also... I've built from source which means I have the "low latency" fix. This is confirmed to fix sending issues, so I suppose it's possible it only fixes sending issues and not receiving issues. |
I can't give you answers to those questions as I'm not using the GPIO based serial port and it is clearly not recommended to be used for eBUS communication. As said, go get yourself a decent converter for about 5 EUR and you're fine. |
That's fair enough. I've got one on order so I'll see how it goes when it arrives. I was trying to avoid having yet another PCB and more wires in the box. Out of interest, what's the benefit of enforcing such rigorous timing constraints on the receiving side? I understand what the spec says, and the sending side should totally respect that, but what's gained by making the receiving side so strict? |
This is curious and unfortunately I have no answers for it. My experience (using the Pi Zero W, which I understand should be broadly identical hardware-wise to the Pi3) has shown that the latency is a fairly constant 15-18ms when transmitting, so the variance of 1.5 seconds is odd. I confirmed this with a logic analyzer - if you can get hold of one it would be interesting to see a dump of the bus which would show whether the delay occurs on sending or receiving (the periodic SYN bytes make this quite easy to determine). Regarding the CSV file, the ecoFIT Pure gets detected as one of the existing supported boilers (I think it was My long-term goal is to spin some new PCBs which include a small microcontroller which can (optionally) handle the bus access in firmware to completely remove the effect of userspace (and stupid UARTs) on bus timings. |
Thanks for the feedback @russss. I'm doing no sending at all at the moment, so this is pure receive-side spikes. |
(And thanks for the info on the boiler.) |
I'd be interested in helping with that. Would be nice not to need the trim pot too. Perhaps using a voltage divider and an analogue input? Or using that to sense the high and low voltages and self-trim or something like that. |
The trim pot really shouldn't be necessary as the voltage levels are clearly defined by the spec. It just makes it fiddlier than it needs to be. The board I'm testing with uses an op-amp comparator with fixed trim resistors, and that seems to work fine. |
@codeaholics the idea is to be spec conformant. feel free to increase the values as you need :-) there was already a PCB suggestion for having no poti any more in the fhem forum back some time ago |
@john30 Unfortunately, I'm still getting timeouts even with an RS232 to USB converter. I'm going to try process priorities now to see if this is a kernel pause thing. |
Is the converter FTDI based or something different? |
FT232RL. I'm getting one error approximately every 10-15 seconds. Otherwise, everything seems to be working well. I can now send without any problems too (I had a failed component on the board), so I suspect this is something to do with kernel scheduling. However, playing with priorities didn't improve things. |
is it still the signal loss issue or something else? |
Just read timeouts. So it does look like the USB/RS232 adapter has improved things and removed at least one source of trouble.
Interestingly, it always seems to be the same message that causes the problem:
Device 0x7F is a Vaillant VR33 OpenTherm to eBus adapter:
If my understanding of the message format is right, the VR33 is attempting to send a message to device 0x15, but that device isn't present. Is that right? |
well then there is no slave that is willing to answer the query. as the message is at debug level, this isn't really an error, it's just normal behaviour when a master sends a message to a slave that either does not exist or is not willing to answer that message. |
I agree. I have to wonder what device 0x15 is and why the VR33 is trying to talk to it when it's not present! But it's not doing any harm. Thank you for your help. |
0x15 is usually the main user interface and/or controller that is expected to be present |
I recently created a pull request (raspberrypi/linux#5794) to Raspberry Linux Kernel with a fix that solves problems originating from the response latencies. The PL011 UART chip indeed has FIFO queues which introduce latencies the eBUS obviously doesn't like, but thankfully it also allows to control whether these queues should be enabled or not (it's a matter of a single bit in one of the configuration registers). The current implementation of the driver always assumes that FIFOs should be enabled whenever they are present, at the same time not allowing to turn this feature off when it isn't appropriate.
From my observations it seemed that the problem was with RX queues. When I was sending data through UART, the output from a logic analyzer shown that data frames were flowing out of TX pin one after another with no delays in-between. But when I did "write and read and write", then I got a big (~13 ms) delay before the second write made its way on the wires. When I disabled FIFOs, the delay dropped to 30 microseconds, so it falls into eBUS's expectations just fine. I'm now successfully running ebusd on Raspberry Pi Zero W for almost a whole week, and it works perfectly (I already tied it with my home automation). Between eBUS and Raspberry I have a custom made hat which I based on official schematics from the eBUS specification, just level convertions. |
Ah, that's good news! I'll see if I have time to spin a new design for the Pi Zero hat. I unplugged mine quite a few years ago when I switched to the vSMART thermostat and I hadn't got round to trying it again... |
Hello. I'm building this eBus converter and trying to connect it to ebusd: https://wiki.fhem.de/wiki/EBUS
I've trimmed it as best I can with my bench equipment, and measured the voltages, etc. and everything is looking pretty good, except I keep getting read timeouts just while listening to the bus - not trying to send. I've read #79 about latency, and I don't think that's the issue.
I've connected the board directly to the GPIO/UART of a RPi 3. (I've tested that the board works OK with 3.3v on the low-voltage side, and it seems to be just fine). I'm running Debian Jessie (I guess Raspbian) with this kernel:
Linux ebus 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux
. This kernel is known to have the latency issue, I believe.I've built the daemon myself from git rev 7a569e2 which includes the source code fix for setting the low-latency flag on the serial port.
Here is a snippet of my output with
--logareas=bus --loglevel=debug --lograwdata
:The text was updated successfully, but these errors were encountered: