Giter VIP home page Giter VIP logo

Comments (8)

johanmeijer avatar johanmeijer commented on July 30, 2024 1

I think if you stop the Perl proxy probably no data is sent to the Growatt server(a proxy receives, processes and sends) that is a main difference with the sniffer. If ipforwarding is working correct the inverter data is always sent to the growatt server. Grott only "sniffers" the network for Growatt records but does not do anything with it. If grott not runs the data is still being sent to Growatt Server.

For the output you post above I think you also used the trace option (-t) and that shows all network trafic (can be a lot). And yes it will also trafic for port 5279 if it is there.

Using only -v (--verbose) gives only information if Growatt records are processed you will see something like this.

image
image

There might be more settings needed for IP (port) forwading to work. A good description is given here:
https://www.revsys.com/writings/quicktips/nat.html

You have to enable ipforwarding in the kernel (not sure if that is necessary for Ubuntu):
echo 1 > /proc/sys/net/ipv4/ip_forward

And to make sure that IP forwarding works after reboot You will need to edit /etc/sysctl.conf and change the line that says net.ipv4.ip_forward = 0 to net.ipv4.ip_forward = 1

To cleanup IP forwarding I used:
sudo iptables -t nat -X
iptables -t nat -F
sudo iptables -X
sudo iptables -F

Other ways of cleaning and setting up IP forwarding for Ubuntu are described here:
https://upcloud.com/community/tutorials/configure-iptables-ubuntu/

The output of the display commands if IP forwading is active:

sudo iptables -t nat -L
image

sudo iptables -nvxL
image

I hope you can at least go back to the old settings before activating IP forwarding but I almost know for sure that grott should be able to work with Ubuntu as well. I think this an elegant solution for getting Growatt information in MQTT (and Nodered to do more processing with it like sent it to domoticz, pvoutput.org, influxdb/grafana),

from grott.

johanmeijer avatar johanmeijer commented on July 30, 2024

Did you change the destination address in the ShineWlan to your ubuntu server (via initial setup dialog or growatt website)?

I run this on a raspberry pi. I will see if I can test it on a ubuntu server.

My experience is, if you have not made the isptable rules persistent there are gone after a reboot of the server (again on a rpi).

from grott.

Jeltel avatar Jeltel commented on July 30, 2024

Yes I did. I had a perl proxy running, to divert the data from the Shine-Wifi to the Growatt servers. Worked great, until the datamessage changed.

I did nothing on purpose to make the rules persistant, just copied your rule.

Can you share what you need to see in the iptables after adding the rules?

And how can you check the python script is running properly and is awaiting connection?

When it does this in verbose mode:

	 - Destination: 00:00:00:00:00, Source: 00:00:00:00:00, Protocol: 8
	 - IPv4 Packet protocol 8 :
		 - Version: 4, Header Length: 20, TTL: 128,
		 - Protocol: 6, Source: 192.168.10.110, Target: 192.168.10.100
	 - TCP Segment protocol 6 found
		 - Source Port: 55329, Destination Port: 445
		 - Source IP: 192.168.10.110, Destination IP: 192.168.10.100

	 - Ethernet Frame:
	 - Destination: 00:00:00:00:00, Source: 00:00:00:00:00, Protocol: 8
	 - IPv4 Packet protocol 8 :
		 - Version: 4, Header Length: 20, TTL: 64,
		 - Protocol: 6, Source: 192.168.10.100, Target: 192.168.10.110
	 - TCP Segment protocol 6 found
		 - Source Port: 445, Destination Port: 55329
		 - Source IP: 192.168.10.100, Destination IP: 192.168.10.110

	 - Ethernet Frame:
	 - Destination: 00:00:00:00:00, Source: 00:00:00:00:00, Protocol: 8
	 - IPv4 Packet protocol 8 :
		 - Version: 4, Header Length: 20, TTL: 64,
		 - Protocol: 6, Source: 192.168.10.100, Target: 192.168.10.110
	 - TCP Segment protocol 6 found
		 - Source Port: 445, Destination Port: 55329
		 - Source IP: 192.168.10.100, Destination IP: 192.168.10.110

(removed macs and IP's)

And if the ShineWifi is connecting I should see the IP of the ShineWifi and the 5279 port, right?

I've set the ShineWifi back to server.growatt.com so that I can still see the data at least. Too bad the perl proxy doesn't work anymore.

from grott.

Jeltel avatar Jeltel commented on July 30, 2024

They are gone now after a second reboot. Don't know what happened.

Thanks for all the info. Cleared up a lot. Will test later, when the sun is shining ;) and report back.

Hopefully it works on a Growatt 2500-MTL-S and Ubunut 18.04 :)

from grott.

Jeltel avatar Jeltel commented on July 30, 2024

One more question. For the perl solution it was mandatory to put the IP of my server in the shine WiFi stick. Can I just reroute server.growatt.com in my local DNS to the server?
Would save me some time during testing, because I won't have to edit the IP on the stick itself.

from grott.

johanmeijer avatar johanmeijer commented on July 30, 2024

I do not think that this will work. It is a 2 way communication. The traffic back from growatt to your inverter is also needed. I do not know if it is possible to find the way back if you use dns.

I am not sure. It might be worthwhile to test.

from grott.

johanmeijer avatar johanmeijer commented on July 30, 2024

I do not think that this will work. It is a 2 way communication. The traffic back from Growatt to your inverter is also needed. I do not know if it is possible to find the way back if you use dns.

I am not sure. It might be worthwhile to test.

from grott.

johanmeijer avatar johanmeijer commented on July 30, 2024

I do not think that this will work. It is a 2 way communication. The traffic back from Growatt to your inverter is also needed. I do not know if it is possible to find the way back if you use dns.

I am not sure. It might be worthwhile to test.

from grott.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.