Hello Rui and Mr Dattatraya Apte
Firstly, I’m very happy to discuss with you on this subject and to participade to your forum, it’s first time for me. Following the codes and recommendations of RNT, I am beginning to better understand how ESP8266 works for local and remote automation applications on the Internet.
1/ Currently I have a first experience from a RNT sketch in server mode that has been published in the ESP8266 Home Automation book and with a Base 64 security access code and a port transfer to the router that allows the connection with the ESP8266 from anywhere and also by phone on 3 or 4G.
This sketch works perfectly except for the change of IP which unfortunately does not remain fixed / static. From the RNT tuttorial to have a fixed and static IP address in the ESP8266, I will try to add some lines of code in my sketch and check if there is no conflict with the router at the level of port forwarding and fixed IP recognition.
Do you have any recommendations or experience on this topic to share?
2/ Actually I am working on another new project using the ESP32 and also compatible for the ESP8266 published by RNT in the book Learn the ESP32 on Arduino IDE. I integrated in the code ESP32 Web RNT tuttorial server to obtain an IP Static / Fixed and the program works perfectly in local mode.
However, the project does not work in remote mode and the router does not recognize the port of the fixed IP to transfer.Do you have experience and results with this project in remote mode for connection fromage anywhere ?
I think the tunnel mode is also interesting, but it is unfortunately necessary to have a PC on standby permanently and that for IOT is a technical solution too heavy in my opinion.There must be other ways to get a secure remote connection.
Thank you for your comments and remarks on these exciting topics and thank you again to Rui and his team for their work and the quality of their publications.Best regards and see you soon on RNT ForumDominique
Hello Dominique,
- If the IP is available in your network, you can assign it to your ESP
- Unfortunately I don’t have any information on that subject, that is different from router to router. I also don’t do port forwarding in any of my personal projects…
You can use ngrok.com to establish a secure tunnel to your network. Thanks!
Rui
Hello Rui,
Many thanks for your answers very quick.
I understand that:
1/ Ok, following your Guide Line, i try to ad few code lines inside my sketch and choose an IP available on my LAN to get an fixe/static. I’m not sûre about the gateway number, where i get this exact value ?
After uploading code and opening serial monitor, checking Ip and ( only for info Mac Adress Numbers ) and if WiFi are connected to LAN.
Check if local access URL open the HTML and the screen display work normaly.
And after to septup a forwarding / transfer port inside with static Ip adress and port of number.
And connect my routeur Ip with port number forwarding to open the HTML
Do you think this processing was Correct or No
2/ I think that the processing is probably the same for my second sketch ?
I watch ngrock also…. next Time .
Do you Know how the professionnal do to fixe an Ip adress on some IOT in a next futur ?
Thanks a lot for your comments.
Best regards.
Dominique
Hello,
- Unfortunately I don’t have any tutorial on that subject, but you can find it in you router configuration web page
- I’m not sure what you’re referring too…
I have this blog post that shows how set a fixed IP address for the ESP32: https://randomnerdtutorials.com/esp32-static-fixed-ip-address-arduino-ide/
The method for the ESP8266 is very similar…
Hi Rui,
-About the Second point, i refer to the ebook Home Automation and the code in the Unit 4. The code is also very similar to ebook Learn ESP32 excepted the HTML was different and in my opinion more beautiful. And also without the code portion for Ip fixed/static. This last point is very important to add in the code for avoid a best reliability on LAN application.
-Do you have one idea how the professional do and witch code are used for connected caméra or other remote équipements pump, heating, door … and without connected an laptop permently and dedicated to ESP microcontroler.
I think with IOT technology some people are interested by an device with few chanel for home application and connection from anywhere with smartphone or if any laptop.
See you soon and thanks you for your advice.
Best regards
It really depends on your exact application requirements and there are many ways to achieve that. I currently like to use either Home Assistant or Node-RED installed on Raspberry Pi. Then, I make the Dashboard accessible from anywhere using Ngrok (that runs on the Raspberry Pi, so I don’t need any extra device powered on).
For a simple IoT project, you might also consider using a dedicated IoT platform like blynk.cc, io.adafruit.com, mydevices.com, thingspeak.com, particle.io, or a similar platform that allows you already to access your devices from anywhere in the world.
I hope that helps!
Hello Rui,
Thank you for your recommendations. I completed the development of my server study with the ESP8266 and added the static / fixed IP code functionality and the Base 64 security protection that you offer. Everything is working properly and I am satisfied with the result.
The next step will be the top level with a Rasberry PI turntable to drive multiple ESP8266 or ESP32.
I will have to study in more detail the various books of RNT and your courses to acquire this new knowledge.
Thank you again and see you soon.
Dominique