mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #463] Add Parameters other than SSID and Password #389
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#389
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MehtaTJ on GitHub (Nov 23, 2017).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/463
I am thankful to @tzapu for giving this tremendous work. I want take some more parameters other than SSID and password from AutoConnectAP captive page. After selecting Configure Wifi if I want to add some more parameters, can anybody help me out there? I am novice programmer in HTML and C++. So requesting you to give detailed explanation
@alx-1 commented on GitHub (Nov 23, 2017):
I did that with this project : https://github.com/reseauducommun/cociclo/tree/master/cociclo_transpiksel_eastern_bloc/software/cociclo_transpiksel_eastern_bloc
The first file in that directory has an example of latitude, longitude and userid added to the ssid + password.
Good luck ++
@tablatronix commented on GitHub (Nov 23, 2017):
This is built in, see the parameters example.
@JhonControl commented on GitHub (Dec 12, 2017):
Hello, perform some tests adding parameters, maybe serve as a guide,
greetings
@JhonControl commented on GitHub (Dec 12, 2017):
http://pdacontrolen.com/wifimanager-emoncms-oem-with-esp8266-temperature-1/
@jgarridc commented on GitHub (Dec 19, 2017):
Hi, sorry about my english...
I have a problem, I added a new field in addition to pass and ssid. I am woriking with thinspeak to monitoring temperature and humity.
With de APIkey I dont have any problem, but if I want to put the channel number too, its not possible because de compilator says "invalid conversion from 'char' to 'long unsigned int' [-fpermissive*]"
This is te code I am using:
`#include <FS.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <DHT.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <ThingSpeak.h> //librería conexión a thingspeak
#include<ESP8266WiFi.h> //librería esp8266
//#define DHTTYPE DHT22
#define DHTTYPE DHT11
#include <DoubleResetDetector.h>
#include <LiquidCrystal_I2C.h>
#include <ArduinoJson.h>
#define DRD_TIMEOUT 100
#define DRD_ADDRESS 0
DoubleResetDetector drd(DRD_TIMEOUT, DRD_ADDRESS);
LiquidCrystal_I2C lcd(0x27, 16, 2);
const char* serverThingspeak = "api.thingspeak.com";
char myChannelNumber[] = "myChannelNumber";
char myWriteAPIKey[] = "myWriteAPIKey";
const int releCaldera = 16;
const int DHTpin = D4;
float histeresis = 1;
static unsigned long last_loop;
unsigned long int anteriorRefreshDatos = 0;
float temp= 0;
float humi= 0;
float tempDeseada = 00;
int calderaHabilitada;
int estadoRele = 0;
int contconexion = 0;
DHT dht(DHTpin, DHTTYPE);
WiFiClient client;
WiFiServer server(80);
void setup() {
//if you get here you have connected to the WiFi
Serial.println("Conectado a la red WIFI :)");
Serial.println("local ip");
Serial.println(WiFi.localIP());
Serial.println(myWriteAPIKey);
ThingSpeak.begin(client);
Serial.println("Cliente thingspeak iniciado");
server.begin();
Serial.println("Server iniciado");
delay(10000);
}
void refreshDatos(){
if (millis() > anteriorRefreshDatos + 20000){
anteriorRefreshDatos = millis();
float temp = dht.readTemperature();
float humi = dht.readHumidity();
if (isnan(temp) || isnan(humi)){
Serial.println("Fallo en lectura de temperatura y humedad");
void loop() {
drd.loop();
refreshDatos();
// Check if a client has connected
WiFiClient client = server.available();
if (!client) {
return;
}
// Read the first line of the request
String req = client.readStringUntil('\r');
Serial.println(req);
client.flush();
int val;
// Set GPIO2 according to the request
calderaHabilitada = val;
client.flush();
// Prepare the response
String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n\r\n<html>\r\nGPIO is now ";
s += (val)?"high":"low";
s += "</html>\n";
// Send the response to the client
client.print(s);
delay(1);
client.stop();
Serial.println("Client disonnected");
}
`