Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
1,402 Views

sending data through php file to cloud server

Hello sir,

i want to send sensor data to our own cloud server which is https:// ...

so how to send sensor data to cloud by intel edison using .php file

0 Kudos
6 Replies
idata
Community Manager
38 Views

Hello gau999,

 

 

Thanks for reaching out!

 

 

As you may know Edison works with Yocto, this is an embedded version of Linux. The fact that Edison runs on Linux gives you the advantage of being able to use many of the generic packages developed for Linux. PHP is compatible with Linux, this means that you should be able to use PHP on Edison just as you would on a regular Linux PC. That being said, there are a few unofficial guides on how to create and interact with web servers, but not using PHP (at least I was not able to find one that uses PHP). You can check them, in case you are interested (even though I don't think they will be of much help for this case in specific), in:

 

 

https://www.hackster.io/20035/intel-edison-tutorial-webserver-7cba87

 

http://forum.arduino.cc/index.php?topic=330331.0

 

https://developers.google.com/web/updates/2016/03/web-enabled-internet-of-things

 

 

I would instead suggest you to read tutorials on how to approach this with regular PHP, as you should be able to access it on Edison. I would recommend you to start with:

 

 

http://php.net/manual/en/sockets.examples.php

 

http://php.net/manual/en/features.remote-files.php

 

 

There are many more guides on PHP's documentation, therefore, I would highly suggest you to check them. I believe they will be of much help for your project.

 

 

I hope this information helps you,

 

Pedro M.
idata
Community Manager
38 Views

Hello gau999,

 

 

Do you have any updates about this?

 

 

Pedro M.
idata
Community Manager
38 Views

hello sir,

thanks for reply

we want to call the .php file which is located on cloud server using intel edison wifi

what is the procedure for that.

idata
Community Manager
38 Views

Hello sir,

Thanks for reply,

now i'm able to send data to MySQL database , only one problem i'm facing is that " i want send dynamic value of sensor for that i'm concatenating two string which is as below "

//Store the query string in buff

sprintf(buff, "curl \"58.62.547.38/conget7.php?\"\n");

delay(5000);

sprintf(sBuff,"id_wasp=%s&frame_number=%s&sensor=%s&value=%d", id_wasp, frame_number, sensor, voltage13t);

delay(3000);

//Concatenate sBuff and buff and store in buff

strcat(buff, sBuff);

but i'm not able to concatenate

idata
Community Manager
38 Views

I'm not very familiar with this topic, so, I may be wrong, but wouldn't removing the new line (\n) from the first sprintf would do just that?

 

 

Anyhow, I found the definition of GROUP_CONCAT ( https://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html# function_group-concat), I believe this might be of help for this in specific.

 

 

Let me know.

 

Pedro M.
Reply