MakerGram Logo

    MakerGram

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups

    [Solved] Pushing multiple values in a single node in Firebase from nodeMCU.

    Arduino
    nodemcu firebase
    3
    3
    1253
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      SalmanFK last edited by salmanfaris

      Hi everyone!
      Since I'm new to nodeMCU and Firebase, I'm having a problem to push multiple values in a single node (randomly created) in Firebase from my nodeMCU-ESP8266. I can successfully push a single value whether it's String or Integer.
      To be clear... I'm willing to store temperature and humidity values to a new node that's randomly created each time as the values are available. But, the problem is I can't push more than one value in that single node!
      It'll be really helpful if you guys can help me out...

      The image is the result when I store the values through an android app. But, I can't do the same with the nodeMCU!

      firebase_image.png

      salmanfaris 1 Reply Last reply Reply Quote 0
      • kowshik1729
        kowshik1729 last edited by kowshik1729

        @SalmanFK Thanks for posting the query. I would like to know what exactly you are referring to when you say "node".
        According to what I understood you are not able to push more than one value at a time into the firebase. Am I right? is that your doubt is? Just to add on, I want to let you know that ESP8266 cannot send characters or strings to the cloud directly. You need to declare a C string and initialize a pointer to run over the length of string, then upload each character to the cloud. This is what basically I did when I faced the error.

        1 Reply Last reply Reply Quote 1
        • salmanfaris
          salmanfaris @SalmanFK last edited by salmanfaris

          Hi @SalmanFK ,

          You can Serialize the data as a JSON or CSV string format and publish that as a single string, so you get the data in a single node, you also DeSerialize the string simply in the application end.

          1 Reply Last reply Reply Quote 2
          • First post
            Last post

          Recent Posts

          • @codelery Awesome. That's great news. Kudos to @rafitc99 . 🙌

            @codelery Please keep us updated about your project, looking forward to seeing it in action 🤩

            • read more
          • C

            @rafitc99 I changed the buffer and that solved the problem. Thanks a lot for coming to my rescue.

            • read more
          • C

            @salmanfaris I did change the buffer size and everything is working perfectly. Thanks coming to my rescue.

            • read more
          • @codelery said in Help needed: Arduino Wireless Notice Board project:

            I am using the hardware serial (pin 0 and 1 on Arduino Uno)

            As @rafitc99 mentioned, you need to expand the Serila buffer, in the hardware serial also the Arduino board package implements a 64-byte ring buffer for send and receive on the hardware serial messages. So you need to change that to 256 as per your message length.

            • read more
          • C

            @rafitc99 The thing is that I am not using the SoftwareSerial library in receiving the message from the first microcontroller. I am using the hardware serial (pin 0 and 1 on Arduino Uno)

            • read more
          By MakerGram | A XiStart Initiative | Built with ♥ NodeBB
          Copyright © 2023 MakerGram, All rights reserved.
          Privacy Policy | Terms & Conditions | Disclaimer | Code of Conduct