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

Getting issue when use ArduinoJson ESP8266, ap-wifi disappears after first connection attempt #2161

Open
kalwinskidawid opened this issue Mar 11, 2025 · 1 comment
Labels
question v7 ArduinoJson 7

Comments

@kalwinskidawid
Copy link

Hey, I come with a strange problem.

  • I initialize wifi in AP mode by default.
  • In the meantime, the program checks itself for outputs and inputs, calculates the data, and then serializes to JSON.
  • Scenario 1:
    • When I try to connect to the AP then it rejects me and disappears completely - in the console it throws no error, and there is no memory leak.
  • Scenario 2:
    • When, for example, I add more values to JsonDocument sensors then everything works fine, the AP creates itself, you can connect to it normally and read the data over HTTP.

What could be the problem here? A very similar topic has been created before #1512. However, there is no solution there. The strangest thing is that when the json is larger everything works, and when it is smaller it does not.

Environment
Here is the environment that I'm using':

  • Microconroller: ESP8266 (NodeMCU V2)
  • IDE: Platformio

Exmaple how I create a JsonDocument:

//simple example how  I prepare the object to serialize
JsonDocument head;

JsonDocument sensors;
sensors[0]["value"] = 55;
sensors[0]["time"] = 1351824120;

sensors[1]["value"] = 75;
sensors[1]["time"] = 1351824120;

JsonDocument anotherSensor;

anotherSensor["sensor"] = "gps";
anotherSensor["time"] = 1351824120;
anotherSensor["data"][0] = 48.756080;
anotherSensor["data"][1] = 2.302038;

JsonDocument inputs;

input[0]["value"] = "on";
input[1]["value"] = "off";
input[2]["value"] = "off";
input[3]["value"] = "on";

head["anotherSensor"] = anotherSensor;
head["inputs"]  = inputs;

serializeJson(head, newState);
@bblanchon
Copy link
Owner

Hi @kalwinskidawid,

I'm sorry but the description is too vague.
Please investigate further and provide an MCVE.

Best regards,
Benoit

@bblanchon bblanchon added the v7 ArduinoJson 7 label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question v7 ArduinoJson 7
Projects
None yet
Development

No branches or pull requests

2 participants