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



  • 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



  • @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.



  • 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.


Log in to reply
 

Recent Posts

  • A

    @sreu13 I edited comment please read that again. Most probably it will not effect your file system. In some scenarios it can create worse effect.

    read more
  • S

    @arunksoman i'll try this method, but while executing swap command, will the rasbian os and the files it contains be effected??

    read more
  • A

    @sreu13
    Ensure that you are installed tensorflow 1.x since screenshot of your code shows something like
    from keras.layers.convolution import covolution2D
    It is not correct in case for tensorflow 2.0 since keras api is part of tensorflow itself.

    Another thing is try to expand your file system. It should be do with your own risk.

    sudo raspi-config Navigate to Advanced options Select advanced options and hit enter(I believes tab key is useful here) Choose Expand File System and hit enter finish. Then your pi may prompt to reboot. If it didn't run. Execute
    sudo reboot Then execute following commands one by one: $ sudo apt-get purge wolfram-engine $ sudo apt-get purge libreoffice* $ sudo apt-get clean $ sudo apt-get autoremove Then increase swap memory by editing following file swapfile:
    $ sudo nano /etc/dphys-swapfile It will open nano editor. Navigate to variable CONF_SWAPSIZE=100

    It indicates your current swap is only 100mb.
    So you just have to increase by commenting down this line and increase to appropriate value something like shown below for 2GB swap:

    #CONF_SWAPSIZE=100 CONF_SWAPSIZE=2048 Save the file and exit nano editor. sudo reboot

    I believes if it did not helped you, you have to think about MOVIDIUS or NVIDIA Jetson nano etc.

    read more
  • S

    @arunksoman tensorflow 2.0.0 version had been installed

    read more
  • @arunksoman thanks,
    I will look more into it. Thanks again

    read more