logo elektroda
logo elektroda
X
logo elektroda

[Solved] Serializing ESP32 Data with ArduinoJson in a For Loop: Key Value Issue

xury 666 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20332007
    xury
    Automation specialist
    I have this function:
    Code: Arduino
    Log in, to see the code
    .
    The intention was to take a value from the array and assign another key named e.g. "CellV_01 etc".
    Code: Arduino
    Log in, to see the code


    But I don't know why the iteration in the for loop doesn't work like this. Instead of the expected consecutive key value entries I have one with bushes.

    When I use println in the same loop the key displays correctly.
    What am I doing wrong?
  • ADVERTISEMENT
  • Helpful post
    #2 20332091
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #3 20332109
    xury
    Automation specialist
    I tried it anyway. Now I don't have my code exactly. I was writing from memory.
    I tried various ways: via std::string and by rewriting to const char* etc.
    Is it even possible to iterate like this in arduinojson? Because maybe it is not possible? And is there another way to do it?
  • ADVERTISEMENT
  • Helpful post
    #4 20332118
    Anonymous
    Level 1  
  • #5 20332424
    xury
    Automation specialist
    Surprisingly today I did as you suggested and it works beautifully. Thanks a lot mate khoam . This is not the first time you have helped me.
ADVERTISEMENT