question

Paul B avatar image
Paul B asked

When using a CCGX Unit thats connected to the Internet is there a way to find the Main routers IP address

This is NOT a Victron issue in anyway. Just a general information request.

I am just trying to use the CCGX as a way to backdoor information for my office routers IP address.

as the CCGX unit connect at the Office and its alway's connected to the internet

When looking on the VRM under the Device List and then the gateway I can see the office CCGXs local IP address ie 192.168.1.67

However I am wanting to find out what the Office's - Main routers IP address is (assigned by the ISP)

Does anyone know if this is possible on the .

CCGX or venus units or the VRM to do this and if so how can it be achieved. remotely

Reason

The office Router has a dynamic IP assigned by the ISP ( its quite hard here to get a static IP Address)

and from time to time this IP address changes (as expected).

Sometimes I log into the office via Remote Desktop from HOME and if the ISP has reset the IP address, I can no longer log in via remote Desktop, until I find out what the new IP address is,

Hoping that I can find this out the new IP address via the CCGX/Venus Unit somehow


Currently I Have to call the office and ask one of the staff to run whats my IP address and advise me the new IP address number , but if its a weekend or late at night its a drive to the office.

Anyone got a Idea here

THANKS


PS Sorry if this is off topic but if its possible others may also be able to use this as a tool

CCGX Color Control
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

2 Answers
treadlite avatar image
treadlite answered ·

I have looked all over in the UI, and within VRM, I cannot find anything....but if you are a bit tech savvy, you can do this:


From what I am reading you can ssh into a non-rpi CCGX?


If that is so, you could easily setup a cron job to do something that would update the IP in some outside location.


here is an example of a cron job you could run and put it in /etc/cron.hourly or /etc/cron.daily


import urllib

import re

import smtplib

import sys


# Setup our login credentials

from_address = ''

to_address = ''

subject = 'CCGX IP'

username = ''

password = ''


# Setup where we will get our IP address

url = 'http://checkip.dyndns.org'

#print ("Our chosen IP address service is ", url)


# Open up the url, then read the contents, and take away our IP address

request = urllib.urlopen(url).read().decode('utf-8')


# We extract the IP address only

ourIP = re.findall("\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", request)

ourIP = ourIP[0]

print ("Our IP address is: " + ourIP)


def send_email(ourIP):

# Body of the email

body_text = ourIP + ' is our PlayPi IP address'

msg = '\r\n'.join(['To: %s' % to_address, 'From: %s' % from_address, 'Subject: %s' % subject, '', body_text])


# Actually send the email!

server = smtplib.SMTP('smtp.gmail.com:587')

server.starttls() # Our security for transmission of credentials

server.login(username,password)

server.sendmail(from_address, to_address, msg)

server.quit()

print ("Our email has been sent!")


# Open up previous IP address (last_ip.txt) and extract contents

with open('/data/home/root/last_ip.txt', 'rt') as last_ip:

last_ip = last_ip.read() # Read the text file


# Check to see if our IP address has really changed

if last_ip == ourIP:

print("Our IP address has not changed.")


# ucomment out this line next if you want to send email regaurdless

# send_email(ourIP)


else:

print ("We have a new IP address.")

with open('/data/home/root/last_ip.txt', 'wt') as last_ip:

last_ip.write(ourIP)

print ("We have written the new IP address to the text file.")

send_email(ourIP)



2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

JohnC avatar image
JohnC answered ·

Hi Paul. No, I don't believe that's possible from the Victron side, neither via GX nor VRM.

Victron at the VRM end would know of course, but that won't be publicly available.

Maybe your office needs some sort of Dynamic DNS setup?


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.