I was wondering if there is any way to connect the ESP32/ESP8266 to my domain in Hostgator, I have a website which has buttons to control LED's or other stuff connected to the ESP, but I was searching to see if it is possible to connect the ESP to my website, I can only see videos and documentation of the ESP creating it's on WebServer, Is there any way to connect it to my domain Website?
If your web site uses HTTPS you can find a useful example in the ESP8266 Arduino code. See the HTTPSRequest example .ino file.
First you have to set your ESP has an access Point, you can see how to it here https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/soft-access-point-class.html
Then in your website you need to make a POST request to your ESP IP. Considering you're not using any type of Back-End you do not need to connect your ESP to the Website but the other way around. Hope this gave you a little help
Making HTTP request from ESP8266 board is very simple and straight-forward process.
You can look at the WebClient example that is installed with the ESP8266 library.
Then - after you craft the URL you're querying and you know the format of the answer you get - you just test for it to decide what to do with your LEDs.
Please let know if there is a need for more clarifications or code sample.
Related
I am wondering what is suitable for my case, using espeasy or Tasmota. I know espeasy is using http requests and Tasmota is using mqtt.
I want to control my sonoff devices by a raspberry pi that is acting as a home automation hub, and it in turn send updates and receives commands from AWSIoT platform. For interacting with AWSIoT platform, it uses mqtt.
What are the pros and cons of using either? and will it cause problems if I control several sonoff devices with http, while using mqtt for AWSIoT? or better use mqtt for all AWSIoT and sonoff?
I am not an expert on the topic but have tried a few things and got some insight for you on why to prefer MQTT over HTTP.
Security. Remember that the 'S' in IOT stands for security. Joking aside. I have not seen an option for encryption (HTTPS) of the HTTP-traffic for tasmota. (May the internet correct me if I am wrong) So choosing HTTP means your user/password (which are not a requirement but should totally be used) are transfered via URL query parameters as plain text. MQTT has built-in mechanisms for encrypting the traffic. I haven't been able to get that working in my network but I'm trying.
Flexibility/Reliability. With MQTT/Tasmota you have the ability to implement automations that do not rely on your home automation hub by having your devices publish MQTT-messages directly to each other for interaction. For example if you would like to implement an emergency off button that turns multiple devices off you do not want that to rely on your home automation server. Doing this with HTTP 'could' be done too but requires all users/passwords of all the devices to reside not only in your home automation hub but also on other single devices.
Networking. Adding new devices to your hub should be as easy as possible. In matters of HTTP your home automation hub has to know how to find your devices via IP-addresses or domain names since it has to resolve a URL. When using MQTT you just connect your tasmota devices to your broker and use their topic in the home automation hub. The devices do not even need to have a static IP or reachable domain name of mDNS name of any sort. That's in an essence what makes pub/sub for IOT so interesting in the first place.
Existing support. Before building your own home automation solution be sure to check out home assistant (my favorite) or any of the other home automation solutions if they fit your need. Do not reinvent the wheel. A tipp for home assistant: Do not use MQTT auto discovery in combination with tasmota. This is the only thing that has not worked out for me. Manually registering devices works reliably.
Hope that helps. If you still prefer HTTP checkout the app "Tasmota control".
https://medium.com/#urish/reverse-engineering-a-bluetooth-lightbulb-56580fcb7546
Using the above link, I did try to hack and control a BLE Device which works in BLE-Mesh-Network, But it failed.
Came here by looking for help to Know the possibility of this idea as whether this is at least will workout in real world scenario.
I have a project where I have an Arduino Uno with an Ethernet shield, which needs to send messages to the Nexmo SMS API. I've done this in the past by sending serial data to a PC, which had a service running that would contact Nexmo and forward the data back to the Arduino. Unfortunately, in the latest project, I don't have access to a constantly-running PC, so I need to do a standalone system. I have experimented with Temboo and got it to work, but I've heard that once the 30-day trial runs out, it's a paid service. Obviously, I'd prefer a free service (it's a home automation project, so no client to send a bill to).
Any suggestions?
Thanks in advance.
Services like Temboo make it easier to use APIs like Nexmo from an Ardunio, but are certainly not needed.
As long as you can make an HTTP request from the Arduino (and, with the ethernet shield, you can) you can make a request to a web based API like Nexmo.
However, if you look at the example code for making a web request with an Arduino you see that there's a fair amount of complexity. This HttpClient library seems to make it a little easier, but still making a request and processing the response takes a bit of code.
It's that complexity that Temboo is removing for you, but you can definitely do it yourself.
I'm building a website, and I want my Arduino Uno (that is hooked up by USB to my local machine) to execute every time a certain page is reached on the site. (For example, blink the light when somebody signs up for our service.) I don't have an Ethernet shield. Is there an alternative?
The only thing that I've come up with is to repeatedly download a log file from the website to my local machine, and run a loop querying the contents of that log file on my Arduino, but the constant requests will put too much stress on the server. Is there any easier way to do this?
When the page is requested on the server, you can run a program that signals your local machine that is controlling the Arduino. Implemenaation depends on what Web Server you are running and if the content is static or not. But even if it just a simple static html page, that page can include a request to this service much like a html page includes requests for included images.
Your local machine will need a static IP address. If the local machine is on a different network behind a generic router, you may need to do port forwarding to the static address.
Eventually figured it out, with help from here:
http://labs.arduino.cc/NET/GettingStarted
You need to use Processing to ping the website, and send the acquired data through the serial port to the Arduino. Since both are using the same port, make sure to load the code over to the Arduino first before you start running the processing code.
I've got a script that programmatically applies different proxy settings for different wifi networks, but I'd like to make it automatic; when a certain wifi network is logged into, my script is called with the network name.
Any ideas?
Assuming you are on a linux if-up/if-down hooks is what you need.
Look at /etc/network/if-up.d and /etc/network/if-down.d .
The interfaces(5) manual page whould help in general.