Show Posts
Pages: 1 ... 4 5 [6] 7
76  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield Setup on: November 18, 2012, 11:41:13 pm
HA!  That's exactly the one I got!

As of now, I have successfully ran a motor and controlled its speed by PWM from the iPad over wifi. Now I need to control eight LEDs individually through a 74HC595 shift register, ALSO from the iPad.  It's getting tricky!

Time for me to read up on bit wise operations I think...
77  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield Setup on: November 18, 2012, 06:43:31 pm
Well, I snapped.

I ran to Walmart and bought a router.  Working with the airport express just wasn't cutting it.  So my router doesn't have internet connected to it- but setting it up and following the tutorials, adjusting my code for the new router and forwarding the ports and...

SHABANG!  IT WORKS!

When I pressed the button on my ipad screen and saw the blue led connected to pin 6 turn on- I about flipped out like a little kid I was so excited!  I even set up a slider to dim the LED with PWM, and it works real-time like a charm!  THIS is the big hurdle I have been looking forward to clearing.

SurferTim and Zoomkat, thanks so much for helping me work through this.  Even though I ended up getting a different router in the end, your posts still got me to know what to do once I got it!  This is a very ambitious project, so I am sure you will see me again sooner or later.  Thanks again guys!


78  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield Setup on: November 18, 2012, 03:45:56 pm
So, I read and accomplished those articles and steps (some of which I had already done, but I re-accomplished anyways for the sake of the effort.)

In order to bring my airport express more in line with the examples, I canged it's default IP from 10.0.1.1 to 192.168.2.1

I changed my code to:
Code:

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xDB, 0x50 };  //Set your Ethernet Shield's MAC address here - make sure you replace the ZZs with your shield's values!
byte ip[] = { 192, 168, 2, 4 };    // Set your shield's desired IP address here - check your network for configuration details
byte gateway[] = { 192,168,2,2 };   //if you need to set a gateway IP
byte subnet[] = { 255,255,255,0 };    // Change this to your subnet address
 
unsigned int localPort = 7777;      // local port to listen on (set this the same as Port # on Ardumote Params Screen)


IPAddress iPhoneIP(192, 168, 2, 3);  //Set the iPhone/iPod/iPad's IP address to send messages back to Ardumote...
unsigned int iPhonePort = 7777;      //Set the Port # of the message table you configured in Ardumote (default is 7777)...



...But no dice.   I am of the belief something is still wrong sketch/IP address wise, but is it possible it could be my shield?  I had dreams all night that I woke up and it worked- that's how wrapped up in this I am lol.  The Ardumote site ( http://samratamin.com/Ardumote_Tutorial.html ) makes it look SO easy, and states this should take 3-5 minutes... not 2 days.  I just know it's something simple I am missing!

Any other suggestions guys?  BTW, thanks for your help so far, I really appreciate it.
79  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield Setup on: November 18, 2012, 12:00:12 am
Boy, I'm having a rough time.

I have no access to the router because it's the hotel WiFi, so forwarding the 7777 port doesn't seem to be a possibility (I tried to use portmapper, but it won't run on my computer for some reason)

I have an airport express though, so I plugged it in and set up my own little WiFi network (albeit w/o actual internet connection) I opened Airport Utility and forwarded port 7777.  I plugged the ethernet from the arduino into the airport express itself- but it doesn't show up on the DHCP client list.

I am at a loss here.  I have no idea which numbers go where... 

My NEW numbers are as follows:

Airport Tab:
Status: CONNECTED
AirPort is connected to Guest and has the IP address 10.0.1.2

iPad has IP of 10.0.1.3
in this new configuration, I changed the requested IP of the arduino to 10.0.1.5.

Here is the code snippet I am so frustrated over:
Code:

#include <SPI.h>         // for Arduino later than ver 0018
#include <EthernetUdp.h>   // UDP library from bjoern@cs.stanford.edu
#include <Ethernet.h>
         
                         // source:  http://code.google.com/p/arduino/source/browse/trunk/libraries/?r=1094#libraries%2FEthernet


//////////  NETWORK INFO  ////////////////

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xDB, 0x50 };  //Set your Ethernet Shield's MAC address here - make sure you replace the ZZs with your shield's values!
byte ip[] = { 10, 0, 1, 5 };    // Set your shield's desired IP address here - check your network for configuration details
//byte gateway[] = { 192,168,1,1 };   //if you need to set a gateway IP
//byte subnet[] = { 255,255,255,0 };    // Change this to your subnet address
 
unsigned int localPort = 7777;      // local port to listen on (set this the same as Port # on Ardumote Params Screen)


IPAddress iPhoneIP(10, 0, 1, 3);  //Set the iPhone/iPod/iPad's IP address to send messages back to Ardumote...
unsigned int iPhonePort = 7777;      //Set the Port # of the message table you configured in Ardumote (default is 7777)...

Please help if you can!
80  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield Setup on: November 17, 2012, 09:25:47 pm
OK, I watched a youtube video about setting up my Mac to "bridge" or share its internet over my ethernet port, and my computer is now "bridged"!

However, I feel I still need help in getting the correct addresses into my code.  Anyone out there that can help with that?  Are the numbers I posted above helpful at all?
81  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield Setup on: November 17, 2012, 09:11:33 pm
Quote
What provisions have you made for the laptop to act as a bridge between the arduino and hotel wifi system?

None...  I'll google what that is and get to work.  Any other suggestions?
82  Using Arduino / Networking, Protocols, and Devices / Ethernet Shield Setup on: November 17, 2012, 08:49:54 pm
All,

Here is my situation:

Public Wifi from hotel room
Laptop connected to WiFi
iPad connected to WiFi
Ethernet shield connected to Laptop

My goal is to control the arduino from my iPad using the Ardumote HD app.  I think everything is in order, except it isn't working, and I feel it is because of my lack of network knowledge.  I think if I can get the addresses all set up, I'll be good to go.  Here is the network area of my sketch:

Code:
#include <SPI.h>         // for Arduino later than ver 0018
//#include <EthernetUdp.h>   // UDP library from bjoern@cs.stanford.edu
#include <Ethernet.h>
         
                         // source:  http://code.google.com/p/arduino/source/browse/trunk/libraries/?r=1094#libraries%2FEthernet


//////////  NETWORK INFO  ////////////////

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xDB, 0x50 };  //Set your Ethernet Shield's MAC address here - make sure you replace the ZZs with your shield's values!
byte ip[] = { 169,254,130,77 };    // Set your shield's desired IP address here - check your network for configuration details
//byte gateway[] = { 192,168,1,1 };   //if you need to set a gateway IP
//byte subnet[] = { 255,255,255,0 };    // Change this to your subnet address
 
unsigned int localPort = 7777;      // local port to listen on (set this the same as Port # on Ardumote Params Screen)


IPAddress iPhoneIP(192, 168, 252, 156);  //Set the iPhone/iPod/iPad's IP address to send messages back to Ardumote...
unsigned int iPhonePort = 7777;      //Set the Port # of the message table you configured in Ardumote (default is 7777)...

I am a complete idiot about network stuff.  I know what an IP address is, and what a MAC address is, but gateway and subnet masks... no idea.

For those that can help, here is some info from my network preferences:

Under the airport tab:
Status: CONNECTED
AirPort is connected to Guest and has the IP address 192.168.253.155.

Under the ethernet tab:
Status: CONNECTED
Ethernet has a self-assigned IP address and may not be able to connect.
IP address:  169.254.130.67
Subnet Mask:  255.255.0.0

83  Using Arduino / Programming Questions / Re: Ardumote HD coding hardships on: November 17, 2012, 08:28:49 pm
Quote
That isn't how you define an IPAddress
Ah yes- I just didn't see that I had typed it in like that.  Old habits die hard.

Quote
That wasn't what the error message told you to do
The original error message did:
Quote
At first it said "in version 1.0 UDP was changed to EthernetUDP"

UPDATE:
I Emailed the Ardumote creator, and within two minutes he emailed me back the new code!  It is MUCH better, but I now have new hurdles.  I'll probably make a new post, because they are completely different issues.  Thanks for reading smiley
84  Using Arduino / Programming Questions / Ardumote HD coding hardships on: November 17, 2012, 07:22:37 pm
Hello everyone,

I downloaded the iPad app "Ardumote HD" (www.SamratAmin.com/Ardumote.html) and picked up an ethernet shield.  I would like to use my iPad to light an LED connected to pin 2 on my Uno.  The ethernet shield is plugged into the ethernet port of my laptop, which is on a public wifi network with the iPad.

Almost immediately I hit a roadblock.  Going to the Ardumote tutorial website (http://samratamin.com/Ardumote_Tutorial.html) I was quick to discover the link to the example code... isn't even a link at all!  Scouring the web for another instance of the code, I stumbled across a post that contained a version of it by luck.

Inputting the code, it wouldn't compile (of course, lol)  At first it said "in version 1.0 UDP was changed to EthernetUDP"

So I changed the line that contained udp to EthernetUDP, and I also loaded the ethernet library at the top because it wasn't there originally.

NOW it's saying "Expected unqualified-id before "." token" and I am unsure of how to rectify the situation.  It highlights the line "EthernetUDP.begin(localPort);" as the issue, which is the same line I changed from Udp to EthernetUDP.  Any help will be greatly appreciated!

Here is what I have right now:
Code:
#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
#include <util.h>

#include <SPI.h>
#include <Udp.h>

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xDB, 0x50 };
byte ip[] = { 169,254,130,77 };
//byte gateway[] = { 192,168,0,1 };
//byte subnet[] = { 255,255,255,0 };

unsigned int localPort = 7777;

IPAddress iPhoneIP(192.168.252.156);
unsigned int iPhonePort = 7777;


int LED_Pin = 2;

byte remoteIp[4];
unsigned int remotePort;

char packBuff[UDP_TX_PACKET_MAX_SIZE];



void setup() {
Ethernet.begin(mac,ip);
EthernetUDP.begin(localPort);  //This is where the program is identifying a problem
Serial.begin(9600);
pinMode(LED_Pin,OUTPUT);
}

void loop()
{
int pwmVal;
int packetSize = Udp.available();  //should I change this one to EthernetUDP as well?
if(packetSize)
  {
    packetSize = packetSize - 8;
    Serial.print("Packet size: ");
    Serial.println(packetSize);

    Udp.readPacket(packBuff,UDP_TX_PACKET_MAX_SIZE, remoteIp, remotePort);  //does this need EthernetUDP too?
    Serial.println("Message: ");
    Serial.println(packBuff);

    pwmVal = (packBuff[3] - '0')*100 + (packBuff[4] - '0')*10 + (packBuff[5] - '0');

    if (packBuff[0] = 'P' && packBuff[1]=='W' && packBuff[2]=='M') 
      analogWrite(LED_Pin,pwmVal);
      Serial.println("PWM on Pin 2");
    }

    else if (packBuff[0] = 'P' && packBuff[1]=='2' && packBuff[2]=='H')
      digitalWrite(LED_Pin,HIGH);
      Serial.println("LED ON");

    else if (packBuff[0] = 'P' && packBuff[1]=='2' && packBuff[2]=='L')
    {
      digitalWrite(LED_Pin,LOW);
      Serial.println("LED OFF");
    }   
  }
  delay(20);
}
85  Using Arduino / General Electronics / Re: MATH: My Achilles Tendon on: November 14, 2012, 09:09:00 pm
Hey thanks guys!

I really appreciate it.  I love this forum- I have only hit it twice now with my vexing (to me at least) questions, and so far I have been met with enthusiastic gentlemen like yourselves, ready to help.
86  Using Arduino / General Electronics / Re: MATH: My Achilles Tendon on: November 14, 2012, 06:47:24 pm
Quote
Watch out!   Sometimes the "wattage rating" applies to the power pulled from the wall

... The power supply I found (I linked to it above) says it has 9W...  this won't be a problem will it?

Quote
The resistor in series with the transistor base, I assume?

Yes.  In between the shift register output and the transistor base.

Quote
Do you need a capacitor?  Where does it go?

Haha I don't even know!  I have a "starter kit" for my Uno (the seeed ARDX) and it has a schematic setup for a small DC motor that shows a capacitor like the one I mentioned plugged in between the power and ground coming from the Arduino.  It lists it on the schematic as "optional" so I have no idea, I just "stabbed in the dark" lol


87  Using Arduino / General Electronics / Re: MATH: My Achilles Tendon on: November 14, 2012, 06:33:45 pm
Awesome, thanks again!

I would've worried hooking my pumps up to it would've fried them because of the extra amps/watts.  Glad you were here smiley
88  Using Arduino / General Electronics / Re: MATH: My Achilles Tendon on: November 14, 2012, 06:21:43 pm
Thanks for the fast reply!

The news about the transistor/resistor is fantastic- I'm loading them into my cart right now then!

I have found a 6v DC 1.5A 9W power supply, and based on what you said it should work no problem then correct?  Here it is: http://www.google.com/products/catalog?q=6V+DC+power+supply&hl=en&client=safari&rls=en-us&prmd=ivns&um=1&ie=UTF-8&cid=17299215671186240564


89  Using Arduino / General Electronics / MATH: My Achilles Tendon on: November 14, 2012, 05:54:17 pm
Hello everyone,

OK, so I know Ohm's law (A=V/R) but I am having trouble figuring out what components to buy for a circuit I have in mind.

Using shift registers (the ones I have in mind are 74HC595), I want to control 16 transistors connected individually to 16 of these DC brushless pumps: http://www.amazon.com/temperature-approval-coffee-process-application/dp/B004HHW0FU/ref=cm_cr_pr_product_top

These pumps run at 300mA @ 6V.  Only one pump will ever be running at one time.  I plan on running them via their own power supply (obviously), but here is where I hit the mental roadblock.

3 problems:
     1.  I don't know how much their external power supply should be (Just 6V?  How many Watts?)
     2.  I am TRYING to use ohm's law to figure out which type of resistors I'll need... but something doesn't seem right... I suck at math
     3.  Capacitors/transistors.  I am in the dark here.  Will PN2222A transistors work?  25v 220uF Capacitor?  Those are complete stabs in the dark.

For the last couple of hours I have been trying to figure this out on my own... so now I am reaching for help!  Any answers to the above questions will be GREATLY appreciated!
90  Using Arduino / Project Guidance / Re: Barmonkey-type robot... seeking advice on: April 07, 2012, 11:52:55 am
Glad you mentioned that- I have one, but I may not have thought to use it  smiley-eek
Pages: 1 ... 4 5 [6] 7