• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

combining arduinocode with firebase_webapp

Q&A Forum › combining arduinocode with firebase_webapp
0 Vote Up Vote Down
Herman Van twillert asked 3 years ago

I completed the example to control ESP8266 with the firebase example from your book working nice.

I have another working project (with webserver)  in arduinoIDE coded in .ino  with an html page and javascripts.
I  convert the .ino code into a main.cpp and moved it in a Firebase project.  This compiles and deploy’s  and seems to function well  but not the parts controlling the FirebaseDB .

So I can now control my hardware by means the Firebase control and the index.js and at the same time through the wifi webserver socket.
Would  there be  a way or an example to  connect this all together, switching outputs and updating the FirebasDB

It was my idea to add javascripts to the arduino code (main.cpp) so that the index.js and auth.js combination can be combined with the arduino code.

All help is appreciated and I am prepared to send over the project

Best regards  Herman

1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
 
I’m not sure that I understood your question.
So, at the moment you can control GPIOs using a web server and the Firebase app simultaneously, is that it?
And you want to update the database when you use the web server?
 
To do that, you need to add some code to your Arduino sketch that sends a new value to the database whenever the GPIOs change state.
If you’re using websockets, you can add that code to the callback function that handles new websocket messages.
You can use the regular function to update a database path like

Firebase.RTDB.setInt(&fbdo, "DATABASE_PATH", VALUE)

I hope this helps.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.