Mysql with ESP8266 and PHP


#1

i have this problem please help me.
i created a DB in DH, the DB is working, i create a PHP file that can add data to the DB, the PHP file is working, the problem is the ESP8266, it connect to wifi
and send data to the PHP file so the data can be added to the DB.
the ESP8266 shows no problem sendig the data to the PHP file but the data
is not added to the DB.
i already modofy the Alowable host even to %.%.%.% but still does not
add data to the DB
any ideas


#2

Hi there, if by ESP8266 you mean the wifi driver of your computer, I don’t think we can really help you … mysql has nothing to do with it… unless I didn’t understand what you’re trying to achieve. Maybe try to explain in more details?


#3

Hi thanks for your interest.
the proyect is to have microcontrolers programed in arduino IDE and connected to the internet via wifi with a chip ESP8266


the devices are going to be located in varios locations, each device have 3 butons and when one of the buttons is press
it will add a value or data to the DB that i have in DH, there are some services like https://thingspeak.com/ that receive data from devices like this to add to a DB and process the data.
in my proyect the data from the devices send it to a php files hosted in DH and then the php file adds the data to the DB.
to test the that the php file is adding data to the DB and that the credentials are correct to add data to the DB i made a form also hosted in my DH acount and uses the same php file
to add the data to the DB.
so we know the DB is working, the php files is also working and the device connected to internet is also working because we use it
to send data to thnigspeak.
when the device starts the process we can see that it connect to internet and only after it connects to internet it send the data
and reports that the data was sent successfully but when you examin the DB it does not add the data


#4

If your thinking that %.%.%.% is a wildcard to whitelist every IP to access a dreamhost DB from outside dreamhost then that is your problem. You’ll need to whitelist specific IP’s.


#5

hi.
i also try whitelist the internet provider, becasue all the devices are going to connect to internet
with the same provider.
%.infinitum.com.mx
but still no result


#6

You can’t do that either. Whitelist a single IP.


#7

According to the Dreamhost tech, “It does not perform a forward lookup on the allowed hosts, so a dynamic DNS hostname will not work here.” You can allow all remote access with “%.%.%.%” or limit it somewhat with something like “%.myprovider.net”.