Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect number for baud rate in log #2

Open
gskjold opened this issue Nov 23, 2021 · 1 comment
Open

Incorrect number for baud rate in log #2

gskjold opened this issue Nov 23, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gskjold
Copy link
Owner

gskjold commented Nov 23, 2021

Seems like it logs a pointer value rather than the actual value

@gskjold gskjold added the bug Something isn't working label Nov 23, 2021
@gskjold gskjold self-assigned this Nov 23, 2021
@sinamics
Copy link

when i use vsnprintf instead of snprintf_P i get correct output from the debugger function.

size_t debugI(const char* format, ...) {
    #if DEBUG_MODE
        va_list arg;
        va_start(arg, format);
        char text[255];
	vsnprintf(text, sizeof(text), format, arg);
        Serial.printf("[INFO] %s\n", text);
    #endif
}

Output with snprintf_P

[INFO] Connecting to ventilation unit at baud 1073421920
[ERROR]  - failed
[INFO] Successfully connected to WiFi!
[INFO] IP:  Tq�?Tq�?
[INFO] GW:  Tq�?Tq�?
[INFO] DNS: Tq�?Tq�?

Output with vsnprintf

[INFO] Connecting to ventilation unit at baud 9600
[ERROR]  - failed
[INFO] Successfully connected to WiFi!
[INFO] IP:  10.0.0.180
[INFO] GW:  10.0.0.138
[INFO] DNS: 10.0.0.138

im not a C guy, so i dont know if this would be a correct fix, but hopefully give some pointers where to look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants