* First changes for static IP on LN882H - WiP - need to set DNS server IP
Needs change in SDK in components/net/lwip-2.1.3/src/port/ln_osal/netif/ethernetif.c
to make sure, DHCP isn't called after we set the IP:
diff --git a/components/net/lwip-2.1.3/src/port/ln_osal/netif/ethernetif.c b/components/net/lwip-2.1.3/src/port/ln_osal/netif/ethernetif.c
index e2b485e..2884ef3 100644
--- a/components/net/lwip-2.1.3/src/port/ln_osal/netif/ethernetif.c
+++ b/components/net/lwip-2.1.3/src/port/ln_osal/netif/ethernetif.c
@@ -16,6 +16,7 @@
#define IF_NAME_STA "ST" // Only support two ascii characters
#define IF_NAME_AP "AP" // Only support two ascii characters
+static int STA_USE_DHCP = 1;
typedef struct {
struct netif nif;
@@ -267,9 +268,10 @@ int netdev_set_state(netif_idx_t nif_idx, netdev_state_t state)
netif_set_status_callback(nif, sta_netif_status_changed_cb);
netif_set_link_callback(nif, sta_netif_link_changed_cb);
-
netifapi_dhcp_stop(nif);
+ if (STA_USE_DHCP) {
netifapi_dhcp_start(nif);
+ }
}
else
{
@@ -362,6 +364,8 @@ int netdev_set_ip_info(netif_idx_t nif_idx, tcpip_ip_info_t *ip_info)
if (ndev && ip_info) {
netifapi_netif_set_addr(netdev2netif(ndev), &ip_info->ip, &ip_info->netmask, &ip_info->gw);
+ // we set an IP in STA mode? --> disable DHCP, or it will be overwritten
+ if (nif_idx == NETIF_IDX_STA) STA_USE_DHCP = 0;
return 0;
}
return -1;
* set DNS with dns_setserver()
* Changed code so during STA init a golbal variable is set, wheter static IP is used.
This will be respected in netif (see OpenLN882H PR#17)
* test
* Update drv_ir2.c
* fx
* fx
* fx
* qq
* test3
* tok
* test duty
* fx
* hdr
* fx
* fx
* tr
* n header
* tr
* tr
* fx
* fx
* test
* tr
tr
* fx
* simpler
* fx
* test
* fx
* dbg
* tr
* tr
* fx
* fx
* fx
* tr
* fx
* pin select
* fx
* fx
* Update drv_ir2.c
* Update drv_ir2.c
* try
* Update drv_ir2.c
* Update drv_ir2.c
* fx
* Update drv_ir2.c
* args len
* http_fn_cmd_tool: len
* better buffer handling
* try lager buffer
* clear
* Update drv_ir2.c
* long packet self tests
* Update drv_ir2.c
* Update drv_ir2.c
* alternate alias
* Queue size
* fx
* fx
* disable
* sample
* extend pin cfg page:
introduce a function te get number of channels for an IO role
in JS code generate all elements, but hide and disable unused fields. This way the should not count for POST action
* Fix for possible wrong index when pin can't be PWM
shorten code
---------
Co-authored-by: openshwprojects <85486843+openshwprojects@users.noreply.github.com>
introduce a function te get number of channels for an IO role
in JS code generate all elements, but hide and disable unused fields. This way the should not count for POST action
* update supported chips list on OBK about page
* forgot Belon
* correct spelling in drv_bp1658cj.h
in comments only
* update release notice supported chips and modules
* add BL602 modules
* add w600 module
* add more modules
* HASS discovery energy stats fixed except energycounter_clear_date
* HASS: add friendly entity names, remove timestamp class from energycounter_clear_date as workaround for hass-incompatible date format
* HA energycounter_clear_date fixed for correct interpreting as home assistant timestamp sensor
* refactor HA power sensors discovery info
* refactor HA power sensors discovery more
* add apparent power, reactive power, power factor to mqtt + hass discovery, refactor some vars into new energy_sensors[] struct
* amend hass sensor unique_ids due to mqtt topic/channel too long; 'Error:MQTT:Unable to queue! Topic (13), channel (66) or value (437) exceeds size limit'
* hass sensors: add 'energy 2 days ago', 'energy 3 days ago', 'uptime'
web UI: energy sensors apply their rounding setting
drv_bl_shared.c: add enum for daily_stats[], put rearrange energy_sensor[] struct to expose only names via DRV_GetEnergySensorNames()
* -HA energy sensor uniq_id values made consistent with prior builds via .hass_uniq_id_suffix
-Refactor drv_bl_shared sensor/counter vars into energy_sensors[] to simplify mqtt transmissions etc
-Add energy '2 days ago'/'3 days ago' to main web ui, data from vars already being saved to/from flash
-NTP fix html formatting in web ui
* -HA energy sensor uniq_id values made consistent with prior builds via .hass_uniq_id_suffix
-Refactor drv_bl_shared sensor/counter vars into energy_sensors[] to simplify mqtt transmissions etc
-Add energy '2 days ago'/'3 days ago' to main web ui, data from vars already being saved to/from flash
-NTP fix html formatting in web ui
* Update settings.json
ignore vscode settings...
* Update settings.json
* Update settings.json
* minor fix
* fix OBK_CONSUMPTION_LAST_HOUR missing from mqtt
* HASS entity names use channel labels when set, hass discovery excludes unpublished entities (i.e. those set via SetChannelPrivate), hass discovery firmware build info added to diagnostic section, energy sensor discovery bugfix re clear-date
* update submodule sdk
* Fix ch0 label wrongly applied to diagnostic sensors
* update docs
---------
Co-authored-by: Stefan Smith <stefan064>