Tasmota: Static ip configuration through the web interface

Created on 21 Mar 2018  路  26Comments  路  Source: arendst/Tasmota

Hi Tasmota folks,

This is a feature request for adding option to set static IP using the web interface.
I would love to have such feature.

Cheers.

enhancement requested feature (hold over) workaround

Most helpful comment

@andrethomas I believe that already works, when going directly to http://192.168.4.1/cs

All 26 comments

Use Web Console and enter
IPAddress1 192.168.1.2
will do that

or use the command on Web line, e.g.
http://sonoff/cm?cmnd=IPAddress1%20192.168.1.2

see Wiki Commands for WiFi

I think Console was designed for all what do not have an explicit input field on page. Always have in mind, that the resource of Sonoff device (flash, mem) is limited.

I'm aware of this command and used it before.
However, I think that for such a common configuration it would be much easier to be able to set it through the UI.

Static IP is not really common and can be bad idea with some routers. While I am sure you understand the constraints not everyone does. My Asus router always assigns the same IP address to the same mac address, so I have static IP addresses but am using DHCP. Some other manufacturers do the same, but others do not. My router also let's me assign particular static addresses to individual devices. It's been several decades since static IP has been required for normal use.

I agree with @Frogmore42 fixed IPs are not needed by almost everyone.
This job is best handled by a a DHCP Server (in most cases does this a router)
And there is the possibility to assign always the same IP to a MAC adress.
If not trash the so called router in the bin

There is Static IP field in Espurna Web interface, and I filled it in to make ip address of my RF bridge static.
However, my Virgin Media Hub 3.0 assigned it a different address..
Don't know who to blame, but I just decided to stick with the hub's reservation rules to be on the safe side.

@akasma74 This is Tasmota not Espurna!

@Jason2866 I know. My post is just an illustration of what @Frogmore42 and you explained to the TS.

You're all right to a ctain extent :-)
However, I like to have an overview of my home network and each device especially server or home devices have it's fixed static address only my mobile devives (phones and tablets) get dynamic addresses.
I have even reserved ranges for certain classes (server, TV, PC, Home Automation) and from .0-.99 the DHCP devices are assigned.
It also does not allways work in every case thet you can connect via hostnam (but via IP-Adress always works) and static IP devices connect faster.
But in gernal, I have nothing against DHCP.

But as you gave me us/a hint/solution how I can change the IP address via console. At least I would be satisfied and IP via Web-Interface in the Admin section would be nice, but not a must).

If you really want the feature, there is nothing stopping you from creating it. That is the beauty of open source.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Yes here too I am interested in static IP configuration. Today I do utilize DHCP reservation for a few devices but most of my network devices are using static IP. (subnet mask here is full now at /25).
The Sonoff modes have introduced me to using Mosquitto and Node Red. Current automation is using X10, UPB, ZWave and Zigbee. I like what I can do with Mosquitton/Node Red.

image

@peteeee

(subnet mask here is full now at /25)

You use live internet IP addresses for Tasmota devices? Just trying to understand why you have a /25 limitation?

That aside I think the use of static ip addresses are a little deprecated and over complicates things for normal users. If you really want to use static IP addresses then there are commands that can be used for this as explained by @curzon01 and in the Wiki.

I do not think this particular feature would be in the best interest of 99% of Tasmota users.

@ascillato thoughts on this one?

Hi,

To use or not to use a fixed IP depends only on how you are configuring your network. You are free to use this feature or not. There are all the commands for setting that, using the console, a mqtt message or a http command.

But I think that the intention goes beyond that. It is on how easy is to set up Tasmota at first if you are using the standard precompiled bins.

Now, first you flash your sonoff.
Then you power it up and:

  • If you send the wifi and mqtt broker config by serial, that is enough. The rest of configuration can be sent by mqtt and the ip doesn't matter.
  • If you search the AP with your phone, you can set the wifi credentials. But then, as you can't configure the mqtt, you need to search the IP of your new sonoff in your router or using another program in order to finish the configuration.

So, for the second case, I think that should be useful to have more initial configuration fields in the AP mode like MQTT broker config and also fixed IP if you need it. At least all the parameters to config your Tasmota and not need to use your router or another program to continue the initial config.

@ascillato

Good point, will it be possible to give web console access in AP mode? That will solve a lot of other initial setup requirements.

@andrethomas I believe that already works, when going directly to http://192.168.4.1/cs

_You use live internet IP addresses for Tasmota devices? Just trying to understand why you have a /25 limitation?_

No.

I still live in old world here of a small DHCP scope and many static IPs. Home network is a bit over 100 devices today using multiple managed Gb switches talking to 4 networks from firewall.

I use 192.168.32.0/20 - for static ip devices I just do static reservations on the DHCP server.

I am trying to set 192.168.0.201 (my sonoffs current ip is 192.168.0.102) as my static ip on my sonoff but every time that i type: IPAddress1 192.168.0.201 it just says:
15:15:49 CMD: IPAddress1 192.168.0.201 15:15:49 MQT: stat/ceilinglight/RESULT = {"IPAddress1":"192.168.0.201 (192.168.0.102)"}

And its not switching the ip address
even after a restart.

Hi, seems that you have saving settings disabled. Please address this to the Tamota support chat. Thanks.

chat: https://discord.gg/Ks2Kzd4

How can I enable saving settings?

Please, address this to the Tasmota Support Chat. It is more dynamic for questions and answers and for testings. Let's try not to go offtopic in this thread. Thanks.

I would also like this option. I鈥檓 a dedicated IP-guy. The DHCP-settings of my ISP provided momden/router can鈥檛 handle that many assigned IP-addresses and I can鈥檛 remember that many hostnames. Since a while the Fing app doesn鈥檛 provide that much info on the devices it finds. ipaddress1, ipaddress2, etc. does also work, but having this in the GUI would be a nice feature.

Closing this one for now since a simple workaround is posted here https://github.com/arendst/Sonoff-Tasmota/issues/2219#issuecomment-439521753

Can always be opened again later if there is demand for it.

Support Information

See Wiki for more information.
See Chat for more user experience.
See Community for forum.
See Code of Conduct

to change ip in tasmota to 192.168.0.210

type in console:

ipaddress1 192.168.0.210
ipaddress2 192.168.0.1
ipaddress3 255.255.255.0

restart 1

First post when searching google for "Tasmota static ip"
I too need static IPs.
My ISP modem/router has a maximum DHCP range of 2-26. This fills pretty quick and I routinely assign IPs at 27 and above.
IP reservation is not reliable as the ISP might randomly reset the router.

For the sake of it, I'll copy/paste from doc, it was quite obscure why ipaddress1/2/3/4 (yes, RTFM, but it usually starts with a Google search)

IPAddress Set networking IP (XXX.XXX.XXX.XXX) addresses
IPAddress1 = set device IP address
0.0.0.0 = use dynamic IP address (DHCP)
XXX.XXX.XXX.XXX = set static IP address
IPAddress2 = set gateway IP address
IPAddress3 = set subnet mask
IPAddress4 = set DNS server IP address

follow IPAddress commands with restart 1 to apply changes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TylerDurden23 picture TylerDurden23  路  3Comments

grizewald picture grizewald  路  3Comments

JoergZ2 picture JoergZ2  路  3Comments

ximonline picture ximonline  路  3Comments

Joeyhza picture Joeyhza  路  3Comments