inverter was included
This commit is contained in:
22
make_tunnel.py
Normal file
22
make_tunnel.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from sshtunnel import SSHTunnelForwarder
|
||||
|
||||
# ---- KONFIG ----
|
||||
SSH_HOST = "192.168.1.146" # Raspberry Pi im 192.168.1.x Netz
|
||||
SSH_PORT = 22
|
||||
SSH_USER = "pi"
|
||||
PASSWORD = 'raspberry' # oder Passwort als String
|
||||
|
||||
|
||||
REMOTE_IP = "10.0.0.10" # Wärmepumpe im 10.0.0.x Netz
|
||||
REMOTE_PORT = 502 # Modbus/TCP Port
|
||||
|
||||
def make_tunnel(port):
|
||||
tunnel = SSHTunnelForwarder(
|
||||
(SSH_HOST, SSH_PORT),
|
||||
ssh_username=SSH_USER,
|
||||
ssh_password=PASSWORD,
|
||||
remote_bind_address=(REMOTE_IP, REMOTE_PORT),
|
||||
local_bind_address=("127.0.0.1", port),
|
||||
)
|
||||
tunnel.start()
|
||||
return tunnel
|
||||
Reference in New Issue
Block a user