mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #549] Need help creating parameter for usable multicast port function -UPDATED #461
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#461
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 @mrlightsman on GitHub (Mar 7, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/549
UPDATE: I've resolved two of my issues but still need help with this one.
GOAL:
Use WiFi Manager to set Multicast IP and Port for use with ESP-01 multicast communication and as the SSID when the ESP is in AP Mode.
PROBLEM:
User inputs a multicast port in the captive portal for use with multicasting Udp. I don't know how to get this input (char) into a usable format for Udp.beginMulticast() (unsigned int).
I've tried two approaches. First I tried:
portMulti.toInt(multiPort);where portMulti is a parameter in the captive portal (char) and multiport is the variable for port for use in the Udp.beginMulticast() command.
and go this error
So then I tried:
portMulti.fromString(multiPort);This parameter is for use with Udp.beginMulticast(local IP, multicast IP, multicast Port) where it will look like this:
IPAddress ipMulti(parameter 1); resolved with
IPAddress ipMulti; ipMulti.fromString(multiIP);portMulti = parameter 2; unresolved issue... char needs to be unsigned int
Udp.beginMulticast(WiFi.localIP(), ipMulti, portMulti);The best solution would be for wifi manager and json to handle parameters in the correct format from the beginning. But, converting them later in the code can also work. If conversion is the way to go, you'll see where I would want to handle that in my code example.
Thank you all for looking at this and offering advice. It is greatly appreciated.
Here is my full code example: It is compiled and verified.
@mrlightsman commented on GitHub (Mar 10, 2018):
Resolved. Simple atoi() did it.