• 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

Firebase – Web page behaviour depending on user location

Q&A Forum › Category: ESP32 › Firebase – Web page behaviour depending on user location
0 Vote Up Vote Down
Guy Gauthier asked 3 years ago

I want to have access to my watering system (based on ESP32) from anywhere using Firebase.  When i am at home, connected to the same WiFi as the ESP32, I want to be able to use the manual mode and the configuration of the automatic mode and also know the status of the watering system.

When I am somewere else, connected via the mobile phone network, I want to have access to all but not to manual mode. So, the manual mode must be dislabled when I am not connected to the same WiFi used by the ESP32.

Is it possible to change the behavior of the Web pages in Firebase accordingly to the network used by my cellphone (My WiFi, other WiFi not at my home, cellular network) ?

Question Tags: Firebase, user location, Web page
2 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
 
I’m not sure how to do that. But it should be possible.
Mybe you can do that based on the client’s IP address. For example, if you know your phone IP address when it is connected to your home router, you can add conditions for the web page using JavaScript, for example.
 
To get the client’s IP address, you can check this discussion: https://stackoverflow.com/questions/48032909/how-to-get-client-ip-address-in-a-firebase-cloud-function (note that I never tried this).
 
Probably, there is a better way to achieve this… but I’m not sure…
 
Regards,
Sara
 

0 Vote Up Vote Down
Guy Gauthier answered 3 years ago

Thank you very much, I would read that !!!

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

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition 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.