Show Posts
Pages: [1] 2 3
1  Using Arduino / Programming Questions / [SOLVED] How do I print to the serial terminal the backslash as a "\"? on: August 08, 2013, 02:50:20 pm
Really?  That's not the Duh Moment I thought I would have.  I'd never had thought of that.  Thanks a bunch.
2  Using Arduino / Programming Questions / How do I print to the serial terminal the backslash as a "\"? on: August 08, 2013, 02:46:09 pm
It seems like a really easy thing to do, but I want the serial terminal to print \ as a "\" and not a see it as control character start such as \r or \n?
I played with everything I could think of.  When someone shows me what to do, I'm sure it will be a "Duh moment". 
PS I searched this a fair bit, but searching for print finds all sorts sketches with the typical Serial.print("BlaBla whatever \r"); type lines. I couldn't even figure out how to narrow the searches to show me what I wanted.  It's  been a frustrating morning:)
3  Using Arduino / General Electronics / Re: Please check my schematic and pcb on: August 05, 2013, 11:10:07 pm
Did you order this yet?

Are all layers shown?  If so....

I think you have a problem with the barrel power jack.  The traces don't seem correct to me.  Did you use a netlist?  Is the cap above it wired correctly?  I only see one connection to it.  Is there enough clearance through J1 to run the traces through the pins the way you have done it (or maybe it's just the resolution of the jpg).
4  Using Arduino / Programming Questions / Re: UDP delays my Sketch by 2 seconds if there is a network problem. on: August 05, 2013, 09:59:17 pm
Wow!  Thanks works great!  Thank you so much.
5  Using Arduino / Programming Questions / Re: UDP delays my Sketch by 2 seconds if there is a network problem. on: August 05, 2013, 06:39:07 pm
What I forgot to ask is there anything I can add to my sketch to ignore the network status so that it will run with no delays regardless of my LAN connection or the availability of the remote UNO?
6  Using Arduino / Programming Questions / UDP delays my Sketch by 2 seconds if there is a network problem. SOLVED on: August 05, 2013, 05:36:41 pm
I noticed an odd thing with my UDP sketch.  The sketch sends UDPs command to a second UNO.  When both the local and the remote Unos 'see' each over the network my sketch runs very quickly.

My UDP code I use is similar to the the SendReceive UDP example:

Udp.beginPacket(Udp.RemoteUnoIP(), Udp.remotePort());
Udp.write(DataCommands);
Udp.endPacket();

As I said if the network connection is working, the sketch sails through this section of the code and the command happens with typical network delays of a few milliseconds.

When I was working on my sketch with no network connection, as the code got to this UDP routine, it took about 2 seconds or so to run.  Obviously there is some handshaking taking place between the network and the UDP messaging that stalls if the UDP/network fails.  While UDP is a broadcast connectionless type protocol something must delay the routine if it doesn't complete properly. I then connected my Uno to the network so that it saw IP (but it couldn't 'see' the remote Uno as I didn't have it on the LAN).  Even with the local Uno having IP the delay was still there.

Does anyone know why the UDP code is waiting?  When it stalls, I can see the LED on my Ethernet sheild winking 3 or 4 times during the 2 second stall time.  Maybe it is doing some sort of retry loop?
7  Using Arduino / Programming Questions / Re: How do I get an Arduino to initiate a UDP session? SOLVED on: August 05, 2013, 05:11:28 pm
Quote
Please post your sketch up and change the title of the thread to SOLVED so that others can benefit in the future

Craig.  I changed the name, but as to posting my code it's still way too much of a work in progress.  

What I'm working on is a network based countdown Timer.  At first I worked with the display end where I used a network connected Uno to receive Telnet commands to generate RS422 like TimeCode.  This timecode is then fed into a professionally made Time Display.  The project then progressed to UDP and now to having a dedicated Uno based Controller that sends via  UDP such things as time load, start, stop Up and DownCount commands.  The 2 Unos work together to initiate the timer sequence, but once running each run independent.  It's almost working.
8  Using Arduino / Programming Questions / Re: How do I get an Arduino to initiate a UDP session? on: August 04, 2013, 08:29:50 pm
Quote
Udp.write("L1,23,45");

In case anyone is wondering, the L1,23,45 is my data I wanted to send to the other Arduino.  I should have pasted the lines in with a more generic field like "your data here".

Cheers
9  Using Arduino / Programming Questions / Re: How do I get an Arduino to initiate a UDP session? on: August 04, 2013, 12:36:53 pm
OK I figured it out myself.

I made an array called SendTo and populated it with my 'receive' Arduino's ip:

byte SendTo[] = {10, 1, 0, 222};


And then used these lines in a void Send() routine:

Udp.beginPacket(SendTo, 8888);
Udp.write("L1,23,45");
Udp.endPacket();

Where 8888 is the receive Arduino's Listen Port.

If anybody else is stuck on this I hope it helps.
10  Using Arduino / Programming Questions / Re: How do I get an Arduino to initiate a UDP session? on: August 04, 2013, 09:48:29 am
I'm aware with UDP  there isn't a connection that's why I used the word session.  It's a session to me and my communication with the other end.  I didn't know any other way of referring to the process.  Anyway, I have experimented with the Send Receive example and pretty well anything else I can find including some looking at a Youtube from 2009 :

https://www.youtube.com/watch?v=EZYaDEhVc_I

He posted 2 Arduinos connected together via Ethernet.  This is basically what I want to do.  His code is pre any official support from the Arduino libraries re UDP. He wrote his own called Library called ClientUDP_1.1, but I can't get the code to download from his blog link.

In the UDPSendReceiveString Arduino example, the initial SEND comes from the processing sketch, (which I can’t get to work either, but that’s another story..).  I managed to send and receive UDP to my Arduino with my Linux box using SOCAT.  I can confirm my Arduino code works with UDP.

What I want to do is start the “session” from one Arduino to another.  The SendReceive example only sends a UDP packet after it has determined the RemoteIP() and RemotePort() from the Processing (or any other UDP initiated session).

How do I manually load the RemoteIP() bytes into these UDP send statements:

Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
Udp.write(ReplyBuffer);
Udp.endPacket();

Thanks
11  Using Arduino / Programming Questions / How do I get an Arduino to initiate a UDP session? SOLVED on: August 03, 2013, 10:22:57 pm
I've been playing with UDP and all of the examples I have found "answer" a UDP session.  That is, the remoteIP() info is obtained after some other computer has sent a UDP packet to my Arduino.  The NTP sketch is the closest I have found to something where the Arduino starts the UDP.  The trouble with that sketch is it makes a call using a NTP based command called "sendNTPpacket(timeServer);".

I need something similar where I can start a UDP send to an IP I specify.  The "receive" examples use this line:

Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());

where remoteIP() and remotePort() are received from the other computer.

Is there an easy way for me to use the same command to start a UDP send where I specify remoteIP() and remotePort()?
12  Using Arduino / Networking, Protocols, and Devices / Re: Ethernet Shield UDPSendReceive not acknowledged on: July 21, 2013, 05:36:00 pm
I'm jealous! I've been trying to get this Processing app to run with the same Arduino UDP example, but I'm getting "nada".  I've confirmed that it is the Processing portion that isn't working.  I can use a Linux Socat UDP send to the Arduino and I see the communication.  When I try this Processing code I get a compile error, "The Constructor UDP(UDP,int) is undefined".  Also the import Link is invalid.  Hypermedia.net is no longer there.  I found the UDP library online elsewhere and have added it to my Library folder.  I think I probably haven't done this correctly, hence the compile error.  I've tried the latest Processing 2.0.1 code and then I downgraded to 1.2.1, still no go.  I believe the newest version of Processing deals with Libraries locations a little differently.

I'm only a month later at this than the previous post and I can't figure out why I'm having this trouble.  Can anyone confirm that the Arduino/Processing example will work with a "fresh" install as of today?
13  Community / Website and Forum / Re: Ethernet UDPSendReceiveString bugfix? on: July 19, 2013, 06:33:52 pm
After I posted, I played a bit more and I discovered my problem is with the Processing part of the example.  I searched for a command line UDP send and like all good things in computing, Linux came through for me.  I found a cool command line linux app called socat.

After doing a sudo get app for socat I did what this guy from the WEB suggested:

Quote
echo “HELLO” | socat – UDP-DATAGRAM:192.168.0.255:5000,broadcast

Checkout some examples:
http://thekissinglink.blogspot.com/2010/01/socat-examples.html

From the linux command line it sent the message to my Arduino.  Now to figure out what I am doing wrong in Processing smiley
14  Community / Website and Forum / Re: Ethernet UDPSendReceiveString bugfix? on: July 19, 2013, 05:00:20 pm
I hope it doesn't seem like I've "High Jacked" this thread, but I can't get the UDPSendReceiveString example to work. (or any UDP examples I have found for that matter).  I don't know if it is my Arduino IDE (1.0.5) sketch config, or if it is MY Processing (2.01) setup.
 
Adruino Sketch Setup:

I edit the IPAdress with a valid static IP from my router range (192.168.1.201) and I leave the local port at 8888.
Send/compile to UNO.  No errors other than the line "#include <EthernetUdp.h>" is all in BLACK.  The other include library statements, SPI and Ethernet are in ORANGE.  Does this mean anything.  Do I need to include a path or add the library EthernetUdp?

I've never done anything with Processing so this is new territory for me:

I edit this line to include my UNO address.  String ip       = "192.168.1.201"; // the remote IP address

It seems to run OK.  Hitting the RUN command a little Grey Window pops up.

No amount of text entry into the Arduino Terminal echos back to the Processing app, and the "Hello World" doesn't get sent to the UNO.

I can Ping my Uno at 192.168.1.201.  My lap top is on 192.168.1.49 via DHCP and Wifi.   I have turned off my routers Firewall.

Anything obviously wrong here?  Any suggestions as to how I might determine which side isn't working.  Are there command line UDP test I can do to see if the UNO will accept a UDP receive?


15  Using Arduino / Project Guidance / Re: Ethernet shield w/POE -- Can it run with normal power hookup? on: June 21, 2013, 12:15:10 am
I've used the POE shields.  They work with a regular non POE network just fine.  Without the POE switch your Arduino will work with either the USB power or with a separate 'wall wart'.  When it's connected to a POE switch it runs great with no extra power sources needed.  Even when you're on a POE network you can still connect your computer to the Arduino via USB.  The two supplies 'together' don't cause any trouble.
Pages: [1] 2 3