Merge pull request #451 from FreeBSDGeek/development

Allow setting the WiFi hostname
This commit is contained in:
Olivier
2016-05-29 18:59:55 +02:00
6 changed files with 19 additions and 0 deletions
@@ -103,6 +103,9 @@ bool gatewayTransportInit() {
#if defined(MY_ESP8266_SSID)
// Turn off access point
WiFi.mode (WIFI_STA);
#if defined(MY_ESP8266_HOSTNAME)
WiFi.hostname(MY_EPS8266_HOSTNAME);
#endif
(void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD);
#ifdef MY_IP_ADDRESS
WiFi.config(_ethernetGatewayIP, gateway, subnet);
@@ -167,6 +167,9 @@ bool gatewayTransportInit() {
#if defined(MY_GATEWAY_ESP8266)
// Turn off access point
WiFi.mode (WIFI_STA);
#if defined(MY_ESP8266_HOSTNAME)
WiFi.hostname(MY_ESP8266_HOSTNAME);
#endif
(void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD);
#ifdef MY_IP_ADDRESS
WiFi.config(_clientIp, _gatewayIp, _subnetIp);
@@ -86,6 +86,10 @@
// Enable UDP communication
//#define MY_USE_UDP
// Set the hostname for the WiFi Client. This is the hostname
// it will pass to the DHCP server if not static.
// #define MY_ESP8266_HOSTNAME "sensor-gateway"
// Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
//#define MY_IP_ADDRESS 192,168,178,87
@@ -88,6 +88,10 @@
#define MY_ESP8266_SSID "MySSID"
#define MY_ESP8266_PASSWORD "MyVerySecretPassword"
// Set the hostname for the WiFi Client. This is the hostname
// it will pass to the DHCP server if not static.
// #define MY_ESP8266_HOSTNAME "mqtt-sensor-gateway"
// Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
#define MY_IP_ADDRESS 192,168,178,87
@@ -85,6 +85,10 @@
#define MY_ESP8266_SSID "MySSID"
#define MY_ESP8266_PASSWORD "MyVerySecretPassword"
// Set the hostname for the WiFi Client. This is the hostname
// it will pass to the DHCP server if not static.
// #define MY_ESP8266_HOSTNAME "sensor-ota-gateway"
// Enable UDP communication
//#define MY_USE_UDP
+1
View File
@@ -97,6 +97,7 @@ MY_GATEWAY_MAX_SEND_LENGTH LITERAL1
MY_GATEWAY_MAX_RECEIVE_LENGTH LITERAL1
MY_ESP8266_SSID LITERAL1
MY_ESP8266_PASSWORD LITERAL1
MY_ESP8266_HOSTNAME LITERAL1
MY_IP_GATEWAY_ADDRESS LITERAL1
MY_IP_SUBNET_ADDRESS LITERAL1
MY_W5100_SPI_EN LITERAL1