|
|
Miramar Beach, Florida
Offline
Faraday Member
Karma: 50
Posts: 3448
|
 |
« Reply #1 on: October 06, 2012, 07:45:15 am » |
Here is a topic that has both my Arduino client code and the php code for an Apache/mySQL server. http://arduino.cc/forum/index.php/topic,124289.0.htmlIt is for the ethernet shield, but after the connection, it should be about the same.
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #2 on: October 06, 2012, 07:46:01 am » |
My question is, should i use wifi.h library ? Use it for what? If you want to talk to the WiFi shield, you need some kind of library. The one that goes with your hardware is always best. and always what i am getting in my serial is - "Attempting to connect to SSID". Then, why are you worried about what needs to happen after you successfully connect to the wireless router? Connecting to the wireless router is essential if you are going to do anything with the network.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #3 on: October 06, 2012, 09:47:29 am » |
Okay, how can i connect to wireless router ? seems like SurferTim's example is not connecting to router.
|
|
|
|
|
Logged
|
|
|
|
|
Miramar Beach, Florida
Offline
Faraday Member
Karma: 50
Posts: 3448
|
 |
« Reply #4 on: October 06, 2012, 09:56:10 am » |
My code will not work without connecting to the wireless AP first. Mine is designed for the ethernet shield, which has no security settings.
You obviously have a wireless setting incorrect. Check the SSID, the security type, and passphrase if needed.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #5 on: October 07, 2012, 07:27:23 am » |
My wifi module is configured with other programme, it has SSID and WPA keys, your programme is not working for me, because you are using ethernet, and i am on my Wifi module.. can't find any example which suits me
|
|
|
|
|
Logged
|
|
|
|
|
Miramar Beach, Florida
Offline
Faraday Member
Karma: 50
Posts: 3448
|
 |
« Reply #6 on: October 07, 2012, 07:36:36 am » |
.. can't find any example which suits me
I couldn't either, so I wrote my own using code others had posted here, combining/modifying them to my needs. The transport doesn't matter, only the protocol. Once the connection to the wireless radio is established, it is all the same. Have you tried just a simple sketch to test connecting to your wireless system?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #7 on: October 07, 2012, 09:58:10 am » |
i just used example skecth: http://www.elechouse.com/elechouse/index.php?main_page=product_info&cPath=90_186&products_id=1007it prints Hello world in my http://192.168.1.158:8090/i am thinking, that i could just print http request, but don't know how to write it, maybe it would work, don't know, i am bad in those wifi wireless and other networks. i am thinking smth like: serial.println ("GET /suvis.wu.lt/arduino.php?temperatura=22 HTTP/1.1"); or wlan.write ("GET /suvis.wu.lt/arduino.php?temperatura=22 HTTP/1.1"); Just need to write good http request, that maybe would work
|
|
|
|
|
Logged
|
|
|
|
|
Miramar Beach, Florida
Offline
Faraday Member
Karma: 50
Posts: 3448
|
 |
« Reply #8 on: October 07, 2012, 10:32:41 am » |
Does that sketch WiFiWebClient respond with "connected to wifi"? Or doesn't it ever get that far? If it doesn't, you should check the SSID and security settings for your wireless network in your sketch.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #9 on: October 07, 2012, 10:45:34 am » |
nah it doesn't respond, that sketch is not for my hardware.. it is for arduino wifi webshield, mine is another one, from china.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #10 on: October 08, 2012, 11:34:39 am » |
okay, i got it working, my wifi module can work as a server and as a client, in my settings i putted wifi module to Client, gave them servers IP address, after that in my Arduino i wrote: Serial.println("GET /temp.php?temp=656 HTTP/1.0"); Serial.println("Host: example.com"); Serial.println("");
Vuolia
|
|
|
|
|
Logged
|
|
|
|
|
|