How can Arduino Mega2560+Wifi Shield 2.0 (seeedstudio) receive data from database in xampp server on my pc

I'm trying to connect my Arduino Mega via wi-fi to my xampp server. My main objective is get a value at my database and store it on a variable in Arduino code. With this new variable I'll be able to control the rest of the program... so for that matter I need your help. Can someone give-me advice?

I already try every thing that i found in the internet but it just dosen't work.

I think that the simple way is to send a GET request to the server and read his response... but for some reason i cant send the GET request trought...

I test it on the browser directly and the value show up, so i think that the server side is allright.

Here is my Arduino Code:
[code]#include <Arduino.h> #include <SoftwareSerial.h> #include "WiFly.h" #include "HTTPClient.h" #define SSID "mySSID" #define KEY "myKEY" #define AUTH WIFLY_AUTH_WPA2_PSK #define HTTP_GET_URL "http://192.168.1.80/xampp/training/send_data_db.php/?temp=0" // Pins' connection // Arduino WiFly // 2 <----> TX // 3 <----> RX SoftwareSerial uart(10, 11); WiFly wifly(uart); HTTPClient http; char get; void setup() { Serial.begin(9600); Serial.println("------- WIFLY HTTP --------"); uart.begin(9600); // WiFly UART Baud Rate: 9600 // Wait WiFly to init // delay(3000); // check if WiFly is associated with AP(SSID) if (!wifly.isAssociated(SSID)) { while (!wifly.join(SSID, KEY, AUTH)) { Serial.println("Failed to join " SSID); Serial.println("Wait 0.1 second and try again..."); delay(100); } wifly.save(); // save configuration, } Serial.println("\r\nTry to get url - " HTTP_GET_URL); Serial.println("------------------------------"); while (http.get(HTTP_GET_URL, 10000) < 0) { } while (wifly.receive((uint8_t *)&get, 1, 1000) == 1) { Serial.print(get); } if (wifly.commandMode()) { Serial.println("\r\n\r\nEnter command mode. Send \"exit\"(with \\r) to exit command mode"); } } void loop() { int c; while (wifly.available()) { c = wifly.read(); if (c > 0) { Serial.write((char)c); } } while (Serial.available()) { c = Serial.read(); if (c >= 0) { wifly.write((char)c); } } }[/code] And here is my PHP code:
[code]<?php include("./connection/database_connect.php"); include("./top_table.php"); if((isset($_SESSION["ID"])) AND (isset($_GET["temp"]))) { $id=$_SESSION["ID"]; $sql="SELECT temp FROM perfil, client WHERE perfil.ID ='$id'"; $consult=mysqli_query($connect,$sql); $result=mysqli_num_rows($consult); if(($result==1)) { $person_data=mysqli_fetch_array($consult, MYSQLI_ASSOC); $temp=$person_data["temp"]; header("HTTP/1.1" . " " . 200 . "OK"); header("Content-Type: text/html; charset=UTF-8"); header("Content-Length: 1112"); header("Connection: close"); header("/r/n"); echo $temp; } else { //se user dosen't exist on data base header("Location: http://192.168.1.80/xampp/training/login.php"); exit; } } else { header("Location: http://192.168.1.80/xampp/training/login.php"); exit; } ?>[/code]

Functions Available in PIC18F452

hey, i wana know that there are 40 pins in PIC18F452 i know each pin do the unique work i need the whole description of these 40 pins to understand their working and usage.

Getting Started With Pic Programming, i wana learn

first i hope this is the right section. iv wanted to learn how to program a pic for a while and i have a project in mind that could use one and have decided now is a good time to learn. i want it to do the ps3 jailbreak boot sequence (unplug, plug back in, power then eject quick) it should be a easy beginning ( trigger a relay the either trigger 2 transistors or just short to ground) and it could prolly be done with a 555 but i wana learn how to program pics. keep in mind that i only kno a bit of html, what software/language do i have to get and learn. and anyone know of a tut along the lines of what i have to do ( a input signal will trigger 3 output signals in a timed sequence) or any good beginners tut. thanks to all.
BTW i have all the hardware needed to program the pic and build the circuit

How to get started with microcontrollers?

My point is not to start a flame war, or have an opinion based fight. I really just need advice based off of my experience.

I am pretty experienced with using an arduino, I understand C, & C++ fluently. What is a 8 bit microcontroller I could start with that would give me a solid foundation and understanding? I understand the programming and theory, but I am lacking practical experience. Besides the chip, do I need an IDE? or an IDE & a compiler?

convert data from serial port to real time plot

I have a serial terminal that reads my data in the following format.

X=-0.020 Y= 0.026 Z= 1.160
X=-0.007 Y= 0.015 Z= 1.144
X=-0.007 Y= 0.020 Z= 1.160
X=-0.010 Y= 0.015 Z= 1.160
X=-0.012 Y= 0.015 Z= 1.170

How do I get this data to be graphed on X, Y or versus time plots? Please help I usually work with excel macros and I am not familar with labview

How to read continuously from rs232?

Hello,

I am new to LabVIEW and my questions would be obvious for some for you. So please help if you know the solution.

This is for my school project. For your information, we need to program an Altera DE2 board to control the traffic lights (something like that) and at the same time, the board transmits the states of the lights to a computer with LabVIEW installed via RS-232 cable.

The rest of the project was going well except for the LabVIEW part because as I said earlier, I am new to LabVIEW.

We are using the 'Basic Serial Write and Read.vi' provided in the NI examples folder. The problem is that we don't know how to modify the vi in order to receive continuously the data coming form the DE2 board. Each time, the vi stops to read after it received 24 bytes of data.

Thus, the first question is:
1.) How to read continuously from the RS-232 port? (We tried to use 'while loop' but with no success, maybe we were doing it the wrong way.) If you know the solution, please shed some light for us in a detailed manner.

Easy VR Commander... Training error;recognition failed

Hello,

I have an Arduino Mega 2560 and the EasyVR shield. When I use EasyVR Commander, I can only train the trigger command. Everything else I try to train it tells me "Training Error: Recognition Failed".
This is the only issue I'm having since I can test the trigger command as well as the wordlist. I even tried using the same command on the group lists but even that tells me the message.

Any help is appreciated.

How to communicate the Arduino board with SIM900?

I have a problem. I bought a SIM900 board, but I can not connect there with the Arduino. To send AT commands on the serial the SIM900 doesn't respond, but the LED indicating that the network is on. I've tried to change the baud rate of 9600 to 19200 in the firmware of the Arduino, but it still fails. I think I'm having a problem with the connections of the SIM900, since this board strikes me as obscure (could not find the schematic on the Internet)

I'm 90% sure that I am connecting to the wrong pins. But I tried to reverse the jumpers and even some soldered pins on UART.

How can I make a delay in Visual Studio 2010

Hi all,



I need to know how can I make a delay of ~1msec in that platform.

beside the Order sleep() that gives me delay in seconds.



Thanks,

A4954 Dual H-Bridge DC Motor Controller Board

I am searching for a way to make an H-Bridge as a motor controller. The Dual H-Bridge board offered is a good start for now. Is the schematic avaliable so that I can complete my analysis of the design? Next, the applicaiton is for a motor voltage of 150-200 VDC. The A4954 must be removed and other low voltage components and replace with devices that function at the higher voltage. Can standard MOSFETs be mounted on this board along with a heat sink? Are there pin compatable IGBT/MOSFET driver IC that will work up to 200 VDC? Are there other solutions that you may offer? Thanks.
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir