-->
Page 1 of 1

IR Sensor and Esp8266

PostPosted: Mon Nov 02, 2015 11:21 pm
by Pfeiffer
I will take any thoughts and good advice.

I am trying to get connect an IR sensor to the ESP8266 and send data back to a SQL database.

What would be the best way to do this? What would a $_POST or $_GET look like code wise?

Its so confusing with Lua or Javascript, I a bit overwhelmed.

Thanks to everyone and good luck to all.

Moe

Re: IR Sensor and Esp8266

PostPosted: Thu Nov 05, 2015 1:30 pm
by drJeckyll
Best way ... there are many ways and every is best in some sort :)

For me easy way is to publish MQTT message from esp and then to read them from SQL server and save to SQL, because I already have MQTT broker and so on.

If you have just SQL and WEB server and have PHP knowledge may be best way is to open socket to WEB server from esp and make GET/POST with data. Then handle request with PHP ($_GET/$_POST) and save data to SQL. If data is short (no more than 2K) you can use GET. If not use POST.

Keep in mind that esp PWM is limited to 500 Hz (If I'm not mistaken). So if you want to read signals from TV remote or something like that you have to write your own IR routine and emulate PWM.

I can't see where JS can be used on this scenario, but ... you never know :)

Can't help with LUA. Never touched it.

Re: IR Sensor and Esp8266

PostPosted: Thu Nov 05, 2015 4:14 pm
by eduperez
First of all, you need a web server, an application, and a database, all tied together so you can post to a form on the web server that will store the data on the database. Once you have that working, making the call from a ESP is a piece of cake. However, the server part is way beyond the scope of this forum.