mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 17:15:53 +03:00
[GH-ISSUE #397] Add Custom Parameters #331
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#331
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 @nimaaryamehr on GitHub (Aug 13, 2017).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/397
In this program, I want to get the TOKEN_NOTIFY parameter from the user on the configuration page
How to do it
I also read the parameter "Custom Parameters" but I did not notice anything
`
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
const byte interruptPin = 2;
const char* BASEURI="http://telegramiotbot.com/api/notify?token=";
const char* TOKEN_NOTIFY="123456789"; " <=====================
bool interrupted=false;
/*
interrupt handler
/
void inputChanged(){
interrupted=true;
}
void notify(const char token){
HTTPClient http;
}
void setup() {
}
void loop() {
if(interrupted){
if((WiFi.status() == WL_CONNECTED)) {
notify(TOKEN_NOTIFY);
interrupted=false;
}
}
}
`
@herostrat commented on GitHub (Sep 19, 2017):
Hey @nimaaryamehr,
as far as I could understand you want the user to write a token in your configuration to be able to work with it in the code.
You can find an example of this int the examples/AutoConnectWithFSParameters/AutoConnectWithFSParameters.ino
Notice that you need to define custom parameters see e.g. line 76
Than add this paramter to your instance of the wifimanager e.g. line 91
And after the user put the information in the form and the connection to the network is done you can get the data via getValue() (e.g. line 123) which copys the data in a char array.
I hope this helps.
Cheers
@vaz83 commented on GitHub (Jul 13, 2018):
HI, i am also adding some parameters but i am noticing that the label of the field is now showing up, did this happened to anyone else =?
@tablatronix commented on GitHub (Jul 13, 2018):
development version adds labels.... is that what you mean?
@vaz83 commented on GitHub (Jul 14, 2018):
Sorry tablatronix, I was using an old version of the WM, i downloaded the latest development version so this issue is solved already :) thanks :)
@dontsovcmc commented on GitHub (Nov 28, 2019):
@tablatronix close, solved
@Robotical2 commented on GitHub (Dec 31, 2020):
Hi vaz83, can you please share which WM version you used for adding Custom Parameters.