help setting up 3 ethernet devices sketch

69 views
Skip to first unread message

Rich Vincelette

unread,
Nov 5, 2015, 5:28:48 PM11/5/15
to souliss
Hello, 
I'm a first time user and I'm trying to make sense of everything I've read in the wiki and the examples.

I wanted to start with (what I think is) a simple example having 3 uno's on an ethernet network, 1 acting as a gateway and the other 2 acting as "lights" (for now).

I'm having a hard time getting the addressing down to be able to edit the example sketches to do this. 

Gateway
ethernet IP: 192.168.0.70 

ethernet node1
ethernet IP: DHCP assigned

ethernet node2
ethernet IP: DHCP assigned

do I need to hardcode the IPs? do the nodes need to be hard coded into the gateway as peers or can this be done dynamically? if so how does addressing work if the ip is DHCP assigned? is the vNet ID based off the last octet of the IP?

could someone give a simple example sketch of at least a gateway and a node (I've looked at the examples but I can't seem to adapt the other media to work over ethernet.
thank you very much!!! 

Di Maio, Dario

unread,
Nov 5, 2015, 5:43:32 PM11/5/15
to sou...@googlegroups.com
Hi Rich,

are you using a W5100 based device? If so, you can use DHCP otherwise if you have ENC28J60 Ethernet you cannot. Generally I don't suggest you to use DHCP, because consume much of the RAM on an AVR.

You can have vNet addresses assigned dynamically. The IP address and vNet one are always related, but you can break this link using the IP Broadcast, so that vNet transmission is no longer in unicast.

So, if you are using a W5100 device use https://github.com/souliss/souliss/tree/friariello/examples/zeroconf examples to get three nodes working dynamically with DHCP and dynamic vNet addresses, you need to run the eraseEEPROM example before. Load these sketches and turn one node per time starting from the Gateway, in SoulissApp update the Database and the nodes will appears while turning them on.

Discovery a node may require a minute or so.

Dario.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/eb4e00c1-5f36-44f9-beaa-f94032ab0cb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Di Maio, Dario

unread,
Nov 5, 2015, 6:00:33 PM11/5/15
to sou...@googlegroups.com
Hi Rich,

the example that I've referred are specific for DINo boards, with few modification will works on your also. Tell me if you have a W5100 based Ethernet shield and I will tell you what you need to change.

Dario.

On Thu, Nov 5, 2015 at 11:28 PM, Rich Vincelette <rich.vi...@gmail.com> wrote:

Rich Vincelette

unread,
Nov 5, 2015, 6:10:11 PM11/5/15
to souliss
Hi Dario,
thanks for the quick reply. I am in fact using W5100 based ethernet shields

Thanks again for your pointers thus far!
-Rich

Di Maio, Dario

unread,
Nov 5, 2015, 6:15:12 PM11/5/15
to sou...@googlegroups.com
The sketch n1 is ok as is, for the n2 and n3 use 

#include "bconf/StandardArduino.h"          // Use a standard Arduino
#include "conf/ethW5100.h"                  // Ethernet through Wiznet W5100
#include "conf/DynamicAddressing.h"         // Use dynamic address

instead of the configuration option of the standard examples, this will give DHCP address for your Gateway.

Dario.



Rich Vincelette

unread,
Nov 6, 2015, 12:42:03 AM11/6/15
to souliss
awesome, this got me in the right direction! 
and now I can build on it ... and start changing things
Thank you so much
-Rich

Di Maio, Dario

unread,
Nov 6, 2015, 1:39:26 AM11/6/15
to sou...@googlegroups.com

Means that is working?

In any case, I would suggest you to don't use DHCP, this will free much of the RAM actually used on your Gateway.

Dario.

From Mobile.

Rich Vincelette

unread,
Nov 6, 2015, 5:31:11 PM11/6/15
to souliss
Yes your example worked great!

I've since removed DHCP and am manually assigning IP addresses but allowing the gateway assign vNet addresses (by leaving ' SetAddressingServer();' in the sketch) 

Di Maio, Dario

unread,
Nov 7, 2015, 4:30:14 AM11/7/15
to sou...@googlegroups.com

:)

From Mobile.

Reply all
Reply to author
Forward
0 new messages