Go Down

Topic: Error 502 Arduino YUN with PHP5 and MySQL (Read 2370 times) previous topic - next topic


Hello friends, I have a problem when trying to connect from my Arduino YUN through a PHP file to my MySQL database located on a Godaddy hosting.

In my Arduino YUN install the add php5 to connect from a web file to my MySQL database hosted on another server, then configure the server uHTTPd to use the php.

Later download and install the "opkg install php5-mod-mysql" and "install opkg-mysqli php5-mod", the set as this tutorial says that LAMP http://wiki.openwrt.org/doc/howto/lamp#installing.and.configuring.a.database.server is on page OpenWRT. Once you ready, got the files. Php to Arduino MicroSD card, to be all set, configuration.php file entry that is where all the data in order to connect to the MySQL database. And this is where the problem arises, then wait one minute, the search throws me the error 502 and that I can not connect with my bases.

For now that is the problem which I have with my connection from my Arduino to my MySQL database through php5

The issue is that once uploaded files .php to MicroSD card located in the Arduino YUN, when connecting from my browser, it takes a few minutes and then throws me http error 502 "Bad Gateway".

Do not know why this happens, I have looked everywhere and I modified the php.ini file many times to access.

The opkg that I have on the Arduino YUN are:

The php.ini code is this:

If anyone is to been the same or if I'm making a mistake please help c:


Did you open port 3306/tcp on the mySQL server firewall? I did not see that mentioned in your instructions. That will block any SQL requests if you didn't.


Hi SurferTim ! No, i haven't open any port on my firewall of Arduino YUN. as I can do?


Not the firewall on the Yun.  That needs only port 80 open. The firewall must be open on port 3306 on the MySQL server at Godaddy.


Yes, is enabled the Direct Access to remotely access the base (also port 3306), but still does not work: C
I have another option to fix this?



A quick Google search turned up this.
...and this
...and this


Thanks for the links!

I can remotely connect to my database on Godaddy, I proved from another scrip, but still keeps throwing me the error 505 when i try to connect me with my Arduino YUN ... really already are running out of ideas of how to fix it

have any ideas?
thanks !

Go Up