-
Notifications
You must be signed in to change notification settings - Fork 110
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
Termination and bias resistors #9
Comments
Put a 120 Ohm resistor between D+ and D-. Put a 680 Ohm (pull-up) resistor between 5v and D+. Put a 680 Ohm (pull-down) resistor between Ground and D-. |
Does it matter if you connect the resistors on the Pi end or the TWC end? And should you first try without or always do this? I have a USB-RS485-WE-1800-BT. |
Daisy chain if you have more than two devices (eg. 2+ TWCs) and terminate at both ends of the wire. I didn't add resistors at first and my RS485 adapters died after 1-3 weeks of operation. |
At the moment I'm using a different RS 232/RS485 and a USB to the RS
242(!). I didn't put the termination on it, just two wire. But you're
right. I should check to make sure it isn't wild! Some adapters, like the
Grid connect ones (gridconnect.com) have jumpers/configuration to do that.
I was thinking of running the serial over a remote TCP connection because I
can run the software elsewhere for testing purposes. Right now I do have
the raspberry pi running the USB to serial and the python script together
with the lightweight https server. But it isn't publicly accessible!
Was also going to throw the OpenEVSE into the mix!!!
Simon
…On Mon, Sep 2, 2019, 8:47 PM rhernaus ***@***.***> wrote:
Daisy chain if you have more than two devices (eg. 2+ TWCs) and terminate
and both ends of the wire.
Some RS485 adapters already have a termination resistor build in. And some
even have the pull-up/down resistors build in.
Check this first before adding resistors.
I didn't add resistors at first and my RS485 adapters died after 1-3 weeks
of operation.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACYGU7ARW6REKMPUN7NVWSLQHW63JANCNFSM4IQJ3OUQ>
.
|
I didn't terminate mine, one Pi, two TWCs. I did however need to ground the Pi side of the USB-RS485 cable before communication was smooth on the 2nd TWC. Logical, since Pi normally has no ground connection through the power supply. I might add resistors later. The USB-RS485 has two wires that have the 120Ohm built in that I could connect to the D+/D- for this. On the TWC I could add it ont he D+/D- out port of the last TWC (currently that connection is open). Cable length is probably 25m (CAT6 no shield) Pi-TWC1 and another 7 (SFTP CAT6) from TWC1-TWC2. |
How could you kill it by not adding the 120Ohm? I mean, it would read more noise/not see a clear signal, but it's not like it would overcurrent and blow things up, or will it? |
It's possible to damage parts with unterminated lines because reflections cause voltage spikes (overshoot). This is more likely on long wires, and also depends on how sensitive the devices are. I can't say without putting a scope at the TWC terminals whether that's happening, or how long it will be before said spikes actually cause a failure--it could be weeks, years, or it could be never if the device has robust protection diodes. I'll check mine for overshoot when I get it installed, I was testing without terminations this weekend. |
Hi
And after a while more this;: Then 4 red blinks on WC... Then after a while (30s to a minute) comms is OK again and so it continues.
Tested with and without 120Ohm termination i both ends (D- and D+ IN-terminals in WC). Same problem. When charging the charging is interrupted and starts again when comms is OK and so it continues. Any tips... |
This is debug level 11 startup until connection is lost.. TWC Manager starting as fake Master with id 7777 and sign 77 |
Connect the GRN terminal to ground/earth on the Pi side. Was an issue for me on my 2 TWC network. The Pi has no real ground or earth by itself from a USB power adapter.
Kind regards,
Keenondots
Laurens
van Alphen
FOUNDER & CTO
+31 88 82 82 100
+31 650674546
…________________________________
From: twoway <[email protected]>
Sent: Saturday, November 2, 2019 7:59:18 AM
To: cdragon/TWCManager <[email protected]>
Cc: Laurens van Alphen (Keenondots) <[email protected]>; Comment <[email protected]>
Subject: Re: [cdragon/TWCManager] Termination and bias resistors (#9)
This is debug level 11 startup until connection is lost..
TWC Manager starting as fake Master with id 7777 and sign 77
07:53:28: Send master linkready1
Tx@07:53:28: C0 FC E1 77 77 77 00 00 00 00 00 00 00 00 46 C0
Rx@07:53:28: () FD E2 18 39 52 0C 80 00 00 00 00 00 00 00 00 11 FF
07:53:28: ERROR: Ignoring message of unexpected length 17: FD E2 18 39 52 0C 80 00 00 00 00 00 00 00 00 11 FF
07:53:28: Send master linkready1
Tx@07:53:28: C0 FC E1 77 77 77 00 00 00 00 00 00 00 00 46 C0
07:53:28: Send master linkready1
Tx@07:53:28: C0 FC E1 77 77 77 00 00 00 00 00 00 00 00 46 C0
07:53:28: Send master linkready1
Tx@07:53:28: C0 FC E1 77 77 77 00 00 00 00 00 00 00 00 46 C0
07:53:28: Send master linkready1
Tx@07:53:28: C0 FC E1 77 77 77 00 00 00 00 00 00 00 00 46 C0
07:53:29: Send master linkready2
Tx@07:53:29: C0 FB E2 77 77 77 00 00 00 00 00 00 00 00 47 C0
07:53:29: Send master linkready2
Tx@07:53:29: C0 FB E2 77 77 77 00 00 00 00 00 00 00 00 47 C0
07:53:29: Send master linkready2
Tx@07:53:29: C0 FB E2 77 77 77 00 00 00 00 00 00 00 00 47 C0
07:53:29: Send master linkready2
Tx@07:53:29: C0 FB E2 77 77 77 00 00 00 00 00 00 00 00 47 C0
07:53:29: Send master linkready2
Tx@07:53:29: C0 FB E2 77 77 77 00 00 00 00 00 00 00 00 47 C0
Rx@07:53:37: () FD E2 18 39 52 0C 80 00 00 00 00 00 00 00 00 11
07:53:37: 32.00 amp slave TWC 1839 is ready to link. Sign: 52
07:53:37: Set slave TWC 1839 protocolVersion to 2, minAmpsTWCSupports to 6.
Tx@07:53:37: C0 FB E0 77 77 18 39 00 00 00 00 00 00 00 00 00 1F C0
Tx@07:53:38: C0 FB E0 77 77 18 39 00 00 00 00 00 00 00 00 00 1F C0
Tx@07:53:39: C0 FB E0 77 77 18 39 00 00 00 00 00 00 00 00 00 1F C0
Rx@07:53:39: () FD E0 18 39 77 77 00 00 00 00 00 00 00 00 00 1F
desiredAmpsOffered reduced from 6 to 6 with 1 cars charging.
Don't start charging yet because: self.lastAmpsOffered 0.0 == 0 and time - self.timeLastAmpsOfferedChanged 11 < 60
set_last_amps_offered(TWCID=18 39, desiredAmpsOffered=0.0)
07:53:39: SHB 1839: 00 00.00/00.00A 0000 0000 M: 09 00.00/00.00A 0000 0000
Ignoring byte FC between messages.
Rx@07:53:39: (FC) FD E0 18 39 77 77 00 00 00 00 00 00 00 00 00 1F
desiredAmpsOffered reduced from 6 to 6 with 1 cars charging.
Don't start charging yet because: self.lastAmpsOffered 0.0 == 0 and time - self.timeLastAmpsOfferedChanged 11 < 60
set_last_amps_offered(TWCID=18 39, desiredAmpsOffered=0.0)
07:53:39: SHB 1839: 00 00.00/00.00A 0000 0000 M: 09 00.00/00.00A 0000 0000
Ignoring byte FC between messages.
Tx@07:53:40: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:41: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:42: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:43: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Ignoring byte 00 between messages.
Ignoring byte 00 between messages.
Ignoring byte 1F between messages.
Tx@07:53:44: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:45: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:46: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:47: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:48: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Rx@07:53:49: (FC 00 00 1F) FD E0 18 39 77 77 00 00 00 00 00 00 00 00 00 1F
desiredAmpsOffered reduced from 6 to 6 with 1 cars charging.
Don't start charging yet because: self.lastAmpsOffered 0.0 == 0 and time - self.timeLastAmpsOfferedChanged 20 < 60
set_last_amps_offered(TWCID=18 39, desiredAmpsOffered=0.0)
07:53:49: SHB 1839: 00 00.00/00.00A 0000 0000 M: 09 00.00/00.00A 0000 0000
Ignoring byte FC between messages.
Tx@07:53:49: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:50: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:51: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:52: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:53: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:54: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:55: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:56: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Rx@07:53:57: (FC) FD E0 18 39 77 77 00 00 00 00 00 00 00 00 00 1F
desiredAmpsOffered reduced from 6 to 6 with 1 cars charging.
Don't start charging yet because: self.lastAmpsOffered 0.0 == 0 and time - self.timeLastAmpsOfferedChanged 28 < 60
set_last_amps_offered(TWCID=18 39, desiredAmpsOffered=0.0)
07:53:57: SHB 1839: 00 00.00/00.00A 0000 0000 M: 09 00.00/00.00A 0000 0000
Ignoring byte FC between messages.
Rx@07:53:57: (FC) FD E0 18 39 77 77 00 00 00 00 00 00 00 00 00 1F
desiredAmpsOffered reduced from 6 to 6 with 1 cars charging.
Don't start charging yet because: self.lastAmpsOffered 0.0 == 0 and time - self.timeLastAmpsOfferedChanged 28 < 60
set_last_amps_offered(TWCID=18 39, desiredAmpsOffered=0.0)
07:53:57: SHB 1839: 00 00.00/00.00A 0000 0000 M: 09 00.00/00.00A 0000 0000
Ignoring byte FC between messages.
Tx@07:53:57: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:53:58: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Ignoring byte 77 between messages.
Ignoring byte 77 between messages.
Tx@07:53:59: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Ignoring byte 1F between messages.
07:54:02: Msg timeout (FC 77 77 1F) C0 FC
Tx@07:54:02: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:03: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:04: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:05: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:06: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Ignoring byte 77 between messages.
Ignoring byte 00 between messages.
Ignoring byte 00 between messages.
Ignoring byte 00 between messages.
Traceback (most recent call last):
File "TWC/TWCManager.py", line 2857, in
if(msgLen == 0 and data[0] != 0xc0):
IndexError: index out of range
Tx@07:54:11: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:12: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:13: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:14: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:15: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:16: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:17: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
07:54:20: Msg timeout (77 00 00 00) C0
Tx@07:54:20: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:21: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
Tx@07:54:22: C0 FB E0 77 77 18 39 09 00 00 00 00 00 00 00 00 28 C0
07:54:24: Msg timeout () C0 FD E0
07:54:24: WARNING: We haven't heard from slave 1839 for over 26 seconds. Stop sending them heartbeat messages.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#9>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAOZ6OGELX3HVBVEY5CYNNTQRUQMNANCNFSM4IQJ3OUQ>.
|
Problem solved. |
Hello, good job for the code!
In your code, you specify:
To prevent most noise between messages, add a 120ohm "termination" resistor in parallel to the D+ and D- lines. Also add a 680ohm "bias" resistor between the D+ line and +5V and a second 680ohm "bias" resistor between the D- line and # ground.
But the way I see the installation between the Rapbberry Pi and the TWC, we only need two wires from the RS485; the D+ and the D-.
What do I do with the RS485 5V and Ground wires ? Do I just simply cut them or they have to be connected somewhere in the TWC?
If I only keep the D+ and the D-, do I need the 120ohm "termination" resistor in parallel to the D+ and D- lines?
Thanks for your precisions.
Best regards,
The text was updated successfully, but these errors were encountered: