-
Notifications
You must be signed in to change notification settings - Fork 105
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
Grott on Ubuntu Server routing issues #9
Comments
Is |
As far I understood the masquerade rule enables NAT and should enable the way back from the Growatt server to the Growatt inverter. It might be possible to replace this with a more specific Masquerade or SNAT rule. I am not very familar with these setting I will try to find out if there is more information availble. |
Sorry my intension was not to close it. |
Do you have both WLAN and Ethernet (Cable) enabled and connected on your NUC? |
Both enabled, but only connected on ethernet. |
Oke. I am not sure the masquerade NAT rule is the problem. But I see on internet that it might give some performance delays. I replaced these rule by a more specific SNAT rule. I do not expierence performance issue so I can not really verify if its helps. Maybe you can? What I did: Added the SNAT rule: After that I delete the masquerade rule: Show de rules with linenummers:
And the deleted the masquerade rule:
Hopefully this works............... |
Thanks for the research. I'll try it later and report back. |
Your network might be a little bit more complex (additional virtual adapters) because of the docker implementation. I have not found a lot information yet about the combination of IP forwording and the use of Docker. I like to know if this works. Otherwise I finally have to set up a docker environment myself ;) |
Since this isn't running in docker, I don't think the dockers running on the same machine should matter. But I'll see, when I get to it ;) |
@johanmeijer don't you mean to use the IP of the Growatt Inverter and not the device running grott (raspberry Pi in your case, Nuc in mine?)
|
@Jeltel: What I understood from the documentation (and what is working for me) is this the IP adrress of the used (physical) netwerkadapter of your NUC. The Masquerade options means the system is looking dynamically which adapter should be used. With the SNAT rule you fix (=make static) that. But be aware I am not running Docker containers. I looked at it on a other system with Docker and Docker containers can have there own virtual network interface (depends on the way you start it). You can see this with ifconfig. Docker also adds rules to iptables (e.g. a masquerade rule). The network of a Linux environment with docker is more complex. I am not sure docker networking will work if you change (delete) the Masquerade rule. I have created a grott docker container and it seem to be working (not fully tested yet). I will publish more about this later (in the other topic). Be aware when running grott in a docker container you still need to setup IP forwarding on base Linux level as described. |
I now have these entries:
Where 192.168.x.y is my local server IP. I see Grott is receiving messages, but is not able to process them:
Also the data is not visible within the Shine server. So the data is not going through. Are my settings correct? |
No, having the data not going through is not oke. So the settings are not working for you. There is no communication between the Inverter and Growatt so the "real data" is not send (and can not be processed bij Grott). I do understand that you have more postrouting setting because of the docker environment. I am working at a Docker setup myself so I can test it. |
I setup a Raspberry PI with docker containers enabled but can not reproduce your problem. I tried it with both the full masquerade rule and with the more specific SNAT rule and they both seems to work on a environment with docker installed (Grott in a container also works but I have to fine-tune that a little bit more). Just to be sure I share my settings in the pictures below. When I look at your rules I do not see real differences. I do not have a lot of docker containers running (only the grott one) so my configuration is not that complex. I can see that you have more post-routing chain rules than the 2 you shared (1 and 21, so there are 19 more I think). There might be a rule in there that prohibit the forwarding to the growatt server. I used the IP address of the wlan0 interface because that is the only network interface being used. I supose you used the eth0 IP address (192.168.x.y) ? I fixed this address in my router (not using dynamic IP address for my servers). |
@Jeltel. I think this mode will make it easier for you to run Grott on your Ubuntu server with Docker installed. I will also enable docker container support in the near future. See the topic on Docker Support requirement for more information. In the readme you can find information on how to use Version 2.0.0 and enabling the proxy mode. I am very interested in your opinion about this update, |
@johanmeijer installed version 2 on my nuc, copied settings over from the pizero and ran it. And if there is a problem with my nuc I will notice very soon (for far more important things stop working), so this proxy thing is a way easier setup. And more robust. Thanks! |
As mentioned before I'm trying to get grott running on my hassnuc with Ubuntu Server 18.04. On that system I have also Home Asssistant and two seperate other docker programs running. Adding grott to this should be great, because the nuc is already running.
I didn't got this working earlier, so I opted for the easy way out by starting my Pizero W and adding grott. That went smoothly :)
Now I've tried to start it on my nuc again by following your tutorial for the Pi. I've got this far:
/proc/sys/net/ipv4/ip_forward
exists and contains a 0 initially. Changed that to 1/etc/sysctl.conf
exists and I've rempved the # before the line that saysnet.ipv4.ip_forward = 1
sudo iptables -t nat -A PREROUTING -p tcp --dport 5279 -j DNAT --to-destination 47.91.67.66:5279
is also done nicelysudo iptables -t nat -A POSTROUTING -j MASQUERADE
can also be added, but slows the response of the NUC way down.After adding the POSTROUTING rule the NUC response is very slow and the data isn't send through to server.growatt.com. Therefore no communication is set up which can be sniffed on the NUC> Data from the ShineWifi stick is sent to the NUC as can be seen during the -t option output.
Since I have no knowledge of routing the data. I have no idea what's going on and where to search for the solution.
Home Assistant also adds rules to the iptables. Don't know if they might be conflicting.
Can someone with more knowledge of iptables help me?
The text was updated successfully, but these errors were encountered: