Integration Solar inverter huawei 2000L

this graph and related code is mentioned in the thread already. just need to search my previous post, I did mention all the configuration.yaml and graph code in a previous post.

@alex5 here is the post. do check post above it too.

thank you very much for pointing me in the right direction, much appreciated

1 Like

eureka!! I finally install openwrt on my WR802N, but now, I stick to set up the parameter. My ISP rooter is 192.168.1.1 but the WR802N also, so how can I connect my wr802N, on my router ? and how to access to the config panel of WR802N taking into account that they have the same IP ?

start following this thread
Connect to Huwaei SUN2000 inverter using fiber modem - #20 by KOA - Network and Wireless Configuration - OpenWrt Forum

and this

@trevee you will be setting your tplink router in “dumb AP” mode, it will acquire dhcp from your ISP router, and you will set up a static route in ISP router.

Static route, obviously your isp modem will be different

Dumb Ap setup instructions

followed by connecting to Huwaei sun2000 inverter in client mode.

      * network -- wireless -- scan -- connect to Sun200HVxxxxxxxxx wifi with password change me.

followed by either the custom rules method or GUI method of port forwarding. whichever you like

Maybe the problem is on the Openwrt side. take a look to this post and this too.

Would you be so kind to add the info from these posts to the ‘Connecting to the inverter’ wiki-page? They contain very useful information, but get lost in the 1700+ replies in this topic. Maybe you can split the OpenWRT-part into a GUI-based and a CLI-based guide?

I cannot possibly help everybody personally with limited computer networking knowledge to get their setup working, but I do want to provide good documentation were possible :slight_smile:

1 Like

Hello, how can you update the LAN interface into DHCP because when I tried to save and apply the change, it’s get stuck on “Failed to confirm apply with 90s…”

NB: The ipv4 adresse is hiden in your post and i dont know why, it should be 192.168.1.1 nan?

Hello wlcrs, in your tuto you said that :

Blockquote
Note that failing to set ‘defaultroute’ to 0 will result in loss of internet connectivity as the OpenWRT router will try to route all internet traffic over the inverter instead of your ISP!

Blockquote

Do you know how to do it through GUI ? because cannont access to your file in SSH (permission denied). I think this is my problem…

thanks a lot for you help but i stick on this configuration :cold_sweat:

did you enable ssh on the OpenWRT router?

as for DHCP, you have to follow this guide

Your router Ip will change to something in range of your ISP modem/router subnet mask 192.168.1.x where X can be any value from 2-254.
see Point 4

Give the wireless AP router an IP address “next to” your main router. By default, the main router will have an address of 192.168.1.1, so use something like 192.168.1.2. (The address should be on the same subnet as your main router but out of the DHCP range used when assigning addresses to connected devices. By default, that means the wireless AP router IP should be between 192.168.1.2 and 192.168.1.100.)

did you enable ssh on the OpenWRT router?

yes

Your router Ip will change to something in range of your ISP modem/router subnet mask 192.168.1.x where X can be any value from 2-254.
see Point 4

OK, will try again tonight, yesterday was tough

first we need to write a draft here.

@trevee to summarise the steps

  1. Flash Openwrt on your router
  2. Setup your router as a dumb AP.
  3. Connect it to your ISP router via ethernet. This will change the IP to something in the router’s subnet range. e.g if your ISP’s router Ip is 192.168.1.1 then your openwrt 's router IP will be 192.168.1.24 (anything in between 192.168.1.2 to 192.168.1.100)
  4. Connect to your Huwaei Sun2000 inverter’s wifi as a client via 2.4Ghz radio.
  5. Check the connection between OpenWrt and router by ping 192.168.200.1 (in most cases but in your case 192.168.199.1)

this is the end of Part 1. I will try to write parts 2 and 3 tomorrow.

2 Likes

thank you so much for your help, really appreciated !!! I’ll do it right now!!

Thanks @yousaf465 for your help.

I tried also to put as detail as posible of this procedure above all that the procedure of openwrt is not really updated in terms of ergonomic / presentation of their workflow.

Step 1 : configure the second router as client with OpenWRT (model : TP LINK WR802N)

  1. Connect the WR802N (or other) directly to your PC in ethernet

  2. Disconnect wifi of the PC (to ensure to have only one access) and go to 192.168.1.1. to open the openwrt interface (w/o password but to be define later)

  3. Go to Network → Interfaces and click on the Edit button of the LAN interface.

Give the wireless AP router an IP address “next to” your main router. By default, the main router will have an address of 192.168.1.1, so use something like 192.168.1.2.(at list what I did)

  1. Click on Save and then Save & apply

  2. Into the browser, replace the IP 192.168.1.1 to the new one 192.168.1.2

  3. Go to Network → Interfaces and click on the Edit button of the LAN interface in General Settings tab and change the IPv4 gateway to point to your main router, 192.168.1.1 by default in my case.This sets the wireless AP router to use the main router for Internet access.

  1. Go to Network → Interfaces and click on the Edit button of the LAN interface in Advanced Settings tab. Enter the IP of your main router in the Use custom DNS servers field and click +.

  1. Go to Network → Interfaces and click on the Edit button of the LAN interface in *DHCP server and General Setup tab. Ensure the Ignore interface checkbox is checked.

then in advanced settings tab, enter your main router ip adress (192.168.1.1 in my case)

  1. Go to Network → Interfaces and click on the Edit button of the LAN interface in *DHCP server and IPV6 settings tab. Disable the RA-Service, DHCPv6-Service, and NDP-Proxy

  1. To save resources on the wireless AP router, disable some now unneeded services. Navigate to System → Startup. Disable the services labeled firewall, dnsmasq and odhcpd.

  2. Click the Save and Apply button.

  3. When rebooted, disconnect the client modem (WR802N in my case) from power and ethernet. Connect the client modem to the main router (ISP) though ethernet. You may need to reboot or power cycle either or both routers, the device connecting your main router to the Internet, and potentially any connected devices. In many cases this will not be necessary.

  4. then, browse your new ip adress of the client modem (192.168.1.2 in my case).You should be connected to the GUI interface of openwrt (but now in Lan with the main ISP router)

router

  1. Go to *Network → Wireless * and click on the Scan button to find the inverter AP wifi.

Select your Inverter in the list and click join. Put the password of the inverter wifi (“Changeme” by default) and valid.

  1. Then in the wireless, you should have this :

  1. Go to network and diagnotics to check the connexion :

It works unitil here…

A big big thanks to @yousaf465 for its patience !

Waiting for the second part!!! by huge step done today for me :grin:
hope it will help otherone like me (a bit newbie).

PS: at this step, not able to ping the inverter through HA (I guess it’s normal)

@trevee let’s start part 2.
This will involve setting up the static route in your ISP’s modem/router. This process is unique to everyone. For you, since you are using F@st 5366 (I do have that modem/router with me, but don’t have access to it right now Optus branded one https://www.optus.com.au/content/dam/optus/documents/for-you/broadband-internet/modems/Sagemcom_F%40ST_5366_TN_Modem_User_Guide.pdf )
On F@st 5366

  1. Open 192.168.1.1 (again depending on your Isp router Ip address)
  2. follow these instructions to open the static route page. Route - SAGEMCOM Swan F5366s User Manual [Page 19] | ManualsLib
  3. enter the following setting
    * IP address 192.168.200.0 (in your case 192.168.199.0)
    * Gateway IP address 192.168.1.2 (whatever your OpenWRT router Ip address is)
    * Interface IP_BR_LAN (in my case it was br0)
    * Subnet mask 255.255.255.0 (if there is a field for subnet mask)
  4. Save and reboot both your ISP modem/router and OpenWrt router.
    This will complete step 2.

Step 3.
Once you have done this I will write step 3.

1 Like

Blockquote
PS: at this step, not able to ping the inverter through HA (I guess it’s normal)

You can’t ping inverter from HA right now, bcz port forwarding isn’t enabled yet. which we will do in next steps.

1 Like

ok done, I don’t have choice to setup the subnet mask but I guess this is automatic :

@trevee Now start Step 3

  1. Download and install the latest Winscp from WinSCP :: Official Site :: Download

  2. Run WinScp
    *select Scp as protocol.

    • login with your OpenWrt’s ssh credentials e.g
      image
    • accept the terms etc etc
  3. You will be presented with these windows with OpenWRT folders. In these folders/paths, you will find the files mentioned by @wlcrs in his GitHub page. Connecting to the inverter · wlcrs/huawei_solar Wiki · GitHub
    double click on three dots icons


    you will be presented with

  4. Navigate to the first file by double-clicking etc and then config. Here you will find all the three files “network” “wireless” and “firewall”

  5. double click on the “network” and copy-paste the following code at the end of the files. remember to set defaultroute '0" as mentioned in the github wiki.

config interface 'wlan'
        option proto 'dhcp'
        option defaultroute '0'

  1. repeat the process with “wireless” files by adding the following code to the end of the wireless file. changing according to your inverter’s AP’s Name and BSSID
config wifi-iface 'wifinet0'
        option key 'Changeme'
        option ssid 'SUN2000-HV0123456789'
        option device 'radio0'
        option mode 'sta'
        option bssid '94:25:33:12:34:56'
        option encryption 'psk2'
        option network 'wlan'
  1. Add the following code to the “firewall” file.
config zone
        option input 'ACCEPT'
        option name 'sun'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option masq '1'
        option network 'wlan'

config forwarding
        option dest 'sun'
        option src 'lan'

config forwarding
        option dest 'lan'
        option src 'sun'
  1. Copy the following code by @manio and modify it according to your inverter IP. Integration Solar inverter huawei 2000L - #1365 by manio and paste it in the network – firewall – custom rules.
iptables -I PREROUTING -t nat -p tcp -d 192.168.1.2 --dport 6607 -j DNAT --to-destination 192.168.199.1:6607
iptables -I POSTROUTING -t nat -d 192.168.199.1 -p tcp --dport 6607 -j MASQUERADE

it will look like this, but obviously, IP will be different

  1. save everything and restart your OpenWrt router.
  2. Ping from HA terminal and it will look like thisimage

And report back. for step 4 and 5.

1 Like

ok, so I put the rule on :

network => OK
firewall => OK
Custom rules => OK
Wireless => ?? i did it also with my SSID and BSSID but strange results.

After rebooted I got :

What do you think?

@trevee only use it with wifinet0

try pinging from HA now. It seems to be connected, but the link speed is low, move openwrt router closer to your inverter.