I am trying to send data from my Arduino to my database but it seems that the process is not successfully beginning. Here is my code for Arduino:

#include <Process.h>
#include <Bridge.h>
int temperature;
void setup() {
  Bridge.begin();  // Initialize Bridge
void loop() {
  int temperature = random(0, 100);
  Process p;               
  p.begin("");// address of localhost.

I am using xampp and I put db.php inside the htcocs folder. Can anyone point out why it does not work?

1 Answer 1


I'm not familiar with those libraries, but a quick look gives me the impression that Bridge and Process are used together to make system calls over serial connection on the host system. Based on that..

First, looking at Arduino Process Tutorial Process.begin() should call the process that you want to call. Maybe something like this:

p.begin("curl"); // Assuming you have curl installed on your host system

Second, your PHP script is broken.

/ check connection

^ That comment is missing a second slash /

You should definitely get the PHP/MySQL part working standalone before attempting to integrate Arduino in the process. I'm a bit doubtful that $argv gets populated unless you're running the script from command line. If you're making a GET HTTP request (as you would with curl) you might wanna try instead

$temperature = $_GET['temperature'];

If the above works as a workaround, you should get an entry into your MySQL table if you visit the URL below with your browser.


In any case, get the PHP script working first in your browser. One step at a time.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.