Pages: 1 [2]   Go Down
Author Topic: Read values from webpage to control relay (Ethernet Shield)  (Read 5106 times)
0 Members and 1 Guest are viewing this topic.
Wiscon
Offline Offline
Newbie
*
Karma: 1
Posts: 22
Admin whatisacnc.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am wondering how to do this myself. I have a website that is hosted with "Hostgator" and I would like to use it to switch on or off a light, nothing to tricky. I even have the Arduino live at http://70.68.49.190:89 so it's port forwarded, and I have the example Sketch working.
How do I write a simple sketch that works with my website rather than Twitter to interface with my Arduino? Is it RSS?
I have a Micro SD card plugged in to the Ethernet shield, is there a way to store HTML, XML and PHP documents on it and just call them when they are needed? 

Thanks for your help and time.
Logged

http://whatisacnc.com
The frustration of a CNC

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi imrobc

As far as i know you can call data in the SD card at any time however I have never done this. But you will surely find something similar in the forum you can alter to suit your needs. What do mean by interface your website with your arduino ? what do u plan to do?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What if you are using a wifi module instead of ethernet shield?

Do I just change the mac and specify an ip?
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 147
Posts: 6036
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The wifi and ethernet hardware are just transports, not protocols, so the code is interchangeable. Start the wifi shield in the setup function instead of the ethernet shield, then...
Code:
// change this
EthernetClient client;
// to this
WiFiClient client;

edit: Take a look at zoomkat's code earlier in this thread for the rest of the code. You can take a look at mine in the playground.
http://playground.arduino.cc/Code/WebClient

« Last Edit: August 24, 2014, 08:30:23 am by SurferTim » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the reply!  smiley

Its returns "WiFiClient does not name a type".

I attempted to change everything to 'WiFi' but it just says not connected.


EDIT
My wifi module can be reached at its ip address on the network... That means it's already connected?
Also, should the module be in server mode or client? I would think client as it is getting data from a server...
« Last Edit: August 24, 2014, 09:23:24 am by Divinity82 » Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 147
Posts: 6036
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Then you didn't change the includes to the wifi shield.
Code:
#include <SPI.h>
#include <WiFi.h>

edit: You keep referring to this device as a module instead of a shield. You should post a link to the wifi hardware you are using.
« Last Edit: August 24, 2014, 09:53:26 am by SurferTim » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I posted the English documentation on this module in another persons thread.

http://forum.arduino.cc/index.php?topic=241146.msg1852857#msg1852857

So I presume I need to change all references to "Ethernet" to "WiFi"?
« Last Edit: August 24, 2014, 10:50:06 am by Divinity82 » Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 147
Posts: 6036
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This part is easy. That is not an Arduino WiFi shield. It does not use the same library as the official Wifi shield, so I can't help you with it. Maybe you can get some help from the users in the other thread you posted a link to.

Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay. Thank you for your time.  smiley
Logged

Pages: 1 [2]   Go Up
Jump to: