[GH-ISSUE #473] Thingspeak and wifi manager #399

Open
opened 2026-02-28 01:25:07 +03:00 by kerem · 4 comments
Owner

Originally created by @jgarridc on GitHub (Dec 17, 2017).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/473

Originally created by @jgarridc on GitHub (Dec 17, 2017). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/473 #
Author
Owner

@liebman commented on GitHub (Dec 17, 2017):

I am assuming that your JSON config file specifies the value as a number and not a string, a string would be a quoted value - see this example: https://github.com/bblanchon/ArduinoJson/blob/master/examples/JsonParserExample/JsonParserExample.ino

FYI - this has nothing to do with WiFiManager.

<!-- gh-comment-id:352261939 --> @liebman commented on GitHub (Dec 17, 2017): I am assuming that your JSON config file specifies the value as a number and not a string, a string would be a quoted value - see this example: https://github.com/bblanchon/ArduinoJson/blob/master/examples/JsonParserExample/JsonParserExample.ino FYI - this has nothing to do with WiFiManager.
Author
Owner

@jgarridc commented on GitHub (Dec 19, 2017):

How its possible to convert the unsigned long to a char*?

<!-- gh-comment-id:352690937 --> @jgarridc commented on GitHub (Dec 19, 2017): How its possible to convert the unsigned long to a char*?
Author
Owner

@liebman commented on GitHub (Dec 19, 2017):

Again I'll make an assumption. That this line is the one you get the error for:

ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);

Again, this is totally unrelated to WiFiManager and should be handled in a forum related to ThingSpeak. In any case the issue is that your passing a character array, 'myChannelNumber', to a function that expects an integer of some size.

There are functions that will convert these for you:

  • strtol()
  • atoi()

as well as other methods to do this conversion. Some google searches for "string to int c" or "string to int c++" can give you more information.

FYI: You have marked many lines with "here I have the problem" without indicating the exact line that produced the error. And the formatting is almost unreadable.

<!-- gh-comment-id:352785012 --> @liebman commented on GitHub (Dec 19, 2017): Again I'll make an assumption. That this line is the one you get the error for: ``` ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey); ``` Again, this is totally unrelated to WiFiManager and should be handled in a forum related to ThingSpeak. In any case the issue is that your passing a character array, 'myChannelNumber', to a function that expects an integer of some size. There are functions that will convert these for you: * strtol() * atoi() as well as other methods to do this conversion. Some google searches for "string to int c" or "string to int c++" can give you more information. FYI: You have marked many lines with "here I have the problem" without indicating the exact line that produced the error. And the formatting is almost unreadable.
Author
Owner

@jgarridc commented on GitHub (Dec 20, 2017):

OK, thanks a lot, sorry but I am not a programmer and I have a lot of problems with the code, but all help its good. I am goin to look for information about your answer and try, thank you very much,.

<!-- gh-comment-id:353077068 --> @jgarridc commented on GitHub (Dec 20, 2017): OK, thanks a lot, sorry but I am not a programmer and I have a lot of problems with the code, but all help its good. I am goin to look for information about your answer and try, thank you very much,.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#399
No description provided.