Configuration for bridge Ethernet and USART

365 views
Skip to first unread message

Juan Luis

unread,
Dec 14, 2013, 12:43:51 PM12/14/13
to sou...@googlegroups.com
I want to connect some boards by serial using vNetDriver_usart. 

I configured the first board as an Ethernet-Usart bridge 

QuickCfg.h
#define QC_ENABLE 0x00

vNetCFG.h
# define VNET_SUPERNODE   1
# define VNET_MEDIA1_ENABLE  1
# define VNET_MEDIA2_ENABLE  0
# define VNET_MEDIA3_ENABLE  0
# define VNET_MEDIA4_ENABLE  0
# define VNET_MEDIA5_ENABLE  1

The board is an Arduino Mega +  ENC5100,
I loaded some examples like  Souliss_ex02_FiatLux_eth1 working fine local and remote from Android.

I expected read on serial port the vNet commands in broadcast mode, but nothing comes up from serial port to comunicate to other boards.

Do I need to configure something else?
Is there any example of vNetDriver_usart?
Thanks

Di Maio, Dario

unread,
Dec 15, 2013, 1:06:34 PM12/15/13
to sou...@googlegroups.com
Hi,

I've those example that was using while working on the driver, you may need to play a bit with them. Basically you will have one gateway ETH+USART and one node with only USART.

In the code you see the SoftwareSerial, but you can delete it, was for debugging purpose only.

Please note, you wont see anything on the USART until there will be a reason for it, isn't a pure broadcast.
Until you are using an RS485 driver (than you should add the enable for the driver) you need to cross TX and RX of the two boards, note that while compiling you need to remove the cross connection.

Are you planning to build a bus with this?

Regards,
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.
For more options, visit https://groups.google.com/groups/opt_out.

ex3.txt
ex4.txt

Juan Luis

unread,
Dec 15, 2013, 7:08:58 PM12/15/13
to sou...@googlegroups.com
Thanks Dario,
Can you check if those files are the correct?
Is it possible bridge ethernet and USART in QuickConfig mode? I can't see how you declare the bridge.


Yes, I'm planning to connect some boards by a bus.( rs485 +2 wire for power.) In my opinion should be the first option for home automation. Maybe mixed with some xbee modules and an ethernet bridge.

Di Maio, Dario

unread,
Dec 16, 2013, 3:26:30 AM12/16/13
to sou...@googlegroups.com

No attachments :-)

From mobile.

--

Juan Luis

unread,
Dec 16, 2013, 3:34:36 AM12/16/13
to sou...@googlegroups.com
I meant the ones you sent me. 
Is it possible bridge ethernet and USART in QuickConfig mode?
 I can't see how you declare the bridge.

Di Maio, Dario

unread,
Dec 16, 2013, 3:39:17 AM12/16/13
to sou...@googlegroups.com

A node with two medias active and the supernode option, acts automatically as a bridge/router.

Right now there is no support in QuickCfg.h so you have to declare manually all the option, as you traied at first.

Dario.

From mobile.

Juan Luis

unread,
Dec 16, 2013, 3:46:31 AM12/16/13
to sou...@googlegroups.com
ok, this is what I supposed. I will play with it later.

Thanks.
Message has been deleted

Juan Luis

unread,
Dec 16, 2013, 5:03:59 PM12/16/13
to sou...@googlegroups.com
Hi Dario,
I simplified the problem. Only two boards connected by serial. (crossing tx and rx) no ethernet.
Boards work local and It seems that send data through serial but the other board doesn't listen.

I attached the sketches based on the example  Souliss_ex14_TwinLights_eth1 without ethernet.

Could you take a look, maybe I missed something

Thanks

TwinLights_usart.zip

Di Maio, Dario

unread,
Dec 17, 2013, 4:07:49 AM12/17/13
to sou...@googlegroups.com

Later today I will have a look.

Dario.

From mobile.

Di Maio, Dario

unread,
Dec 17, 2013, 6:47:34 AM12/17/13
to sou...@googlegroups.com
The addresses are wrong, the Media 5 has range 0xCE00 0xFEFF, have a read at:

http://code.google.com/p/souliss/wiki/SupportedNetworkArchitecture

Let me know,
Dario.


Juan Luis

unread,
Dec 17, 2013, 8:02:29 PM12/17/13
to sou...@googlegroups.com
You are right, I didn't noticed that!
Now it works fine.

By the way, I found a bug on Souliss_DigIn() function, I will report it.
Thanks a lot
Juan

Di Maio, Dario

unread,
Dec 18, 2013, 3:28:59 AM12/18/13
to sou...@googlegroups.com

Nice, open an issue for it. There will be a christmas release, I will include the fix there.

Dario.

From mobile.

Juan Pinto

unread,
Dec 27, 2013, 11:47:32 AM12/27/13
to sou...@googlegroups.com
Hi! I tried to make two nodes, one with eth-serial and other with serial only. Both are input button and led in pins 2 - 9 and DHT sensor in pin 5. It based on files uploaded here.

Quick config are done using insketch mode, DHT and VNET_MEDIA5_ENABLE insketch mode are not enabled in framework, I modified files to make it working. Issue opened Dario ;)

TX and RX are crossed between nodes.

First node it's working, but second node or communication between us not works. Any help?

Salu2

PD. Jose Luis no se si hay muchos que hablemos castellano en Souliss, seria bueno comunicarnos sin la barrera del Ingles (al menos por mi parte)
Souliss_Bridge.ino
Souliss_Peer.ino
GetConfig.h
QuickCfg.h

Di Maio, Dario

unread,
Dec 27, 2013, 2:59:03 PM12/27/13
to sou...@googlegroups.com

From your prevoius message was looking that things was working. Isn't?

Dario.

From Mobile.

Juan Pinto

unread,
Dec 27, 2013, 4:39:06 PM12/27/13
to sou...@googlegroups.com
Sorry Dario, I'm not Juan Luis ;P  and he solved the problem between 2 boards with Serial only.

Im trying to make comunicate 2 nodes with Serial Crossed cable, and one of them be a gateway with ENC connected. So Bridge code runs OK, but second "Peer" not show any control, and when I touch pushbutton on peer board turn on led, and when I release pushbutton turn off led. (First board "Bridge" make toggle OK)

With this problem solved I really can expand my home project  !!

Salu2

Di Maio, Dario

unread,
Dec 27, 2013, 8:19:47 PM12/27/13
to sou...@googlegroups.com

Sorry, I've misunderstood.

Let me understand, if you press the pushbutton you can turn light on on the other node? If yes, your network configuration is ok.

Dario.

From Mobile.

Juan Pinto

unread,
Dec 28, 2013, 11:49:09 PM12/28/13
to sou...@googlegroups.com
No, only turn light on its node.

Di Maio, Dario

unread,
Dec 29, 2013, 3:08:29 AM12/29/13
to sou...@googlegroups.com

Got it, you shouldn't define the #if condition in get config.h file but change the configuration setting of your board.

As example, if you are using board 0x05 (in GetConfig.h at line 107) modify there the MEDIA5 as 1.
This is a trick, the best is define a new board (copy and paste 0x05 and assign an unsued number) with that media enabled.

Let me know.

Dario.

From Mobile.

Di Maio, Dario

unread,
Dec 29, 2013, 9:45:45 AM12/29/13
to sou...@googlegroups.com
Use these two files for USART with Quick Configuration, boards 0x41, 0x42 and 0x43 should fit your needs.

Dario.
GetConfig.h
QuickCfg.h

Juan Pinto

unread,
Dec 29, 2013, 12:13:26 PM12/29/13
to sou...@googlegroups.com
Ok, comunication working! and data showed in Android App! :))

Now the bridge button turns on both leds but peer button only turn on peer led, but its a minor problem, the most important thing its make Souliss read temperature from many nodes connected via Serial. Next step, buy 2 rs485 transceiver for longer distances.

Ty again Dario, in my last modification i've tried to make INSKETCH VMEDIA5 but I not updated GetConfig file uploaded before. Your solution it's best, addin more boards! more simple!

Salu2

Di Maio, Dario

unread,
Dec 29, 2013, 12:16:50 PM12/29/13
to sou...@googlegroups.com

Nice!

Your last problem is in the addresses of RemoteInputs, the gateway send the messages to itself. Change it and you will get also this feature.

Regards,
Dario.

From Mobile.

Di Maio, Dario

unread,
Dec 29, 2013, 2:22:21 PM12/29/13
to sou...@googlegroups.com

Remember that this is a new feature, so share with us the results because hasn't been deeply tested at this time.

We can also have a talk about the general sizing of your network, keep in mind that you can build several branch of rs485, each one has its own insependant ethernet bridge.

Dario.

From Mobile.

On 29 Dec 2013 18:13, "Juan Pinto" <juanp...@gmail.com> wrote:

Juan Pinto

unread,
Dec 29, 2013, 3:46:03 PM12/29/13
to sou...@googlegroups.com
Finally I solved the problem, not are adresses. I added 2 lines in void Setup() Peer:

SetAsGateway(bridge_address);
Souliss_SetRemoteAddress(memory_map, bridge_address, 1);

"Final" code here.

Can I connect more than one node via serial with only one ethernet node when you say "you can build several branch", right?

Ty :) Salu2
Souliss_Bridge.ino
Souliss_Peer.ino

Di Maio, Dario

unread,
Dec 29, 2013, 3:55:49 PM12/29/13
to sou...@googlegroups.com

In the Peer you shouldn't configure as a gateway. I will have a look to the code.

Yes, you can connect multiple nodes but all shall be in the same subnet ( es: 0xce01, 0xce02, ...) and each branch need a different subnet (es: 0xcf01, 0xcf02, ...)

Dario.

From Mobile.

Di Maio, Dario

unread,
Dec 29, 2013, 6:11:46 PM12/29/13
to sou...@googlegroups.com

Remove lines 117 and 118 from the peer code, aren't needed.

Let me know.
Dario.

From Mobile.

Juan Pinto

unread,
Dec 30, 2013, 2:20:49 PM12/30/13
to sou...@googlegroups.com
I tried before, but without this lines Peer don't power Led on Bridge node.

Di Maio, Dario

unread,
Dec 30, 2013, 2:29:11 PM12/30/13
to sou...@googlegroups.com

Try again please and let me know.

Dario.

From Mobile.

Juan Pinto

unread,
Jan 2, 2014, 5:04:46 PM1/2/14
to sou...@googlegroups.com
You're right. Works OK without these lines.

Di Maio, Dario

unread,
Jan 2, 2014, 5:15:38 PM1/2/14
to sou...@googlegroups.com

Nice, please update us with your progress in the use of USART.

Regards,
Dario.

From Mobile.

Juan Pinto

unread,
Jan 7, 2014, 1:37:19 PM1/7/14
to sou...@googlegroups.com
Ok, Dario, Im waiting for RS485 modules :)

Juan Pinto

unread,
Jan 20, 2014, 10:57:29 PM1/20/14
to sou...@googlegroups.com
Ok, I received two RS485 modules :

Files from Souliss modified:
conf\usartUsrCfg.h
                   #define USART_TXENABLE 1
                   #define USART_TXENPIN 8

Wiring:   
RO          -    RX
DI            -    TX
DE . RE  -   PIN 8

And connect A - A and B - B  

Loaded into both ( Bridge and Peer ) and don't work :(  any help?  USART_TXENPIN requires a PWM pin?

Ty

Di Maio, Dario

unread,
Jan 21, 2014, 1:34:27 AM1/21/14
to sou...@googlegroups.com

Hi Juan,

No you don't need a pwm pin. Does have you setup Pin8 as output in your setup()?

If yes, please ensure that your code is working with the crossed RX and TX, if so we will move to the hardware connections.

Regards,
Dario.

From Mobile.

Di Maio, Dario

unread,
Jan 21, 2014, 1:47:24 AM1/21/14
to sou...@googlegroups.com

Di Maio, Dario

unread,
Jan 21, 2014, 1:49:58 AM1/21/14
to sou...@googlegroups.com

In vNetUsart.cpp please move lines from 100 to 103 at line 150.

Let me know,
Dario.

From Mobile.

Juan Pinto

unread,
Jan 21, 2014, 4:37:07 PM1/21/14
to sou...@googlegroups.com
Hi, yes, both RS485 are connected to Vcc and Gnd.
I tried to compile again with these lines moved from 100 to 150

El martes, 21 de enero de 2014 07:49:58 UTC+1, Dario Di Maio escribió:

In vNetUsart.cpp please move lines from 100 to 103 at line 150.


#if(USART_TXENABLE)
digitalWrite(USART_TXENPIN, HIGH);
#endif

in file \frame\vNet\drivers\usart\vNetDriver_usart.cpp  right?

I tried with Pin 3 too but still not working :(

Ty 

Di Maio, Dario

unread,
Jan 21, 2014, 4:40:58 PM1/21/14
to sou...@googlegroups.com
Lets go by steps, as are compiled now, cross the TX and RX and be sure that things are working. If yes, post here the pictures that shows the connections and we will go deeper.

Dario.


Juan Pinto

unread,
Jan 21, 2014, 4:58:02 PM1/21/14
to sou...@googlegroups.com
Yes, with crossed RX-TX works ok.

This is the wiring:

Bridge - Peer:        RS485:
   TX                      DI
   RX                      RO
 PIN 3                    DE and RE            

Bridge, Peer and RS485 modules are connected to VCC GND :)
And from RS485 (Bridge) to RS485 (Peer) A to A and B to B.

Di Maio, Dario

unread,
Jan 21, 2014, 5:00:54 PM1/21/14
to sou...@googlegroups.com
Ok, the connection looks ok as described, could you attach a photo?

Dario.

Juan Pinto

unread,
Jan 21, 2014, 5:06:52 PM1/21/14
to sou...@googlegroups.com
Ok, wait a minute, Im trying to make a photo with "clean" connection to make more visible.

Di Maio, Dario

unread,
Jan 21, 2014, 5:08:12 PM1/21/14
to sou...@googlegroups.com
I'm there.

Di Maio, Dario

unread,
Jan 21, 2014, 5:15:17 PM1/21/14
to sou...@googlegroups.com
In your sketch, have you defined the enable pin as output?

Dario.

Juan Pinto

unread,
Jan 21, 2014, 5:18:43 PM1/21/14
to sou...@googlegroups.com
That its in vNetDriver_usart.cpp line 64

#if(USART_TXENABLE)
pinMode(USART_TXENPIN, OUTPUT);
#endif

it already done, right?

Di Maio, Dario

unread,
Jan 21, 2014, 5:20:09 PM1/21/14
to sou...@googlegroups.com
You are right! I've forgot about!

Dario.

Juan Pinto

unread,
Jan 21, 2014, 5:21:55 PM1/21/14
to sou...@googlegroups.com

Di Maio, Dario

unread,
Jan 21, 2014, 5:28:00 PM1/21/14
to sou...@googlegroups.com
Add on line 66
digitalWrite(USART_TXENPIN, LOW);

These won't solve your problem, but is needed.

I'm having a look to the photo.

Dario.

Juan Pinto

unread,
Jan 21, 2014, 5:30:16 PM1/21/14
to sou...@googlegroups.com

Di Maio, Dario

unread,
Jan 21, 2014, 5:36:47 PM1/21/14
to sou...@googlegroups.com
I'm probably wrong, but I can see just three wires in the front instead there should be four (Vcc, GND, A and B).

The connection looks ok, have you tried an Arduino sketch to write from one end to the other? So that you can try your hardware with a different piece of code.

Dario.

Di Maio, Dario

unread,
Jan 21, 2014, 5:48:34 PM1/21/14
to sou...@googlegroups.com

Isn't required, but as test try to share the ground between the two RS485 drivers.

Dario.

From Mobile.

Juan Pinto

unread,
Jan 21, 2014, 6:21:49 PM1/21/14
to sou...@googlegroups.com
They are shared.

I tried with this little code, but led 13 on RECEIVER not power ON, I tried with 2 RS485 and 2 Atmega :( 
on SENDER side seems works ok ( PIN 13 flash while sending )


I dont know if could be a hardware problem, both RS485 are new :(

I keep trying.

Juan Pinto

unread,
Jan 21, 2014, 9:36:17 PM1/21/14
to sou...@googlegroups.com
Ok the problem seems to be one of rs485 modules, when I read voltage on RO RE DE DI pins of both are not equal. I readed the datasheet and pins must be 0 or 5v but in one module read 1, 2, 3v :(

Waiting for more RS485 modules :(

Di Maio, Dario

unread,
Jan 22, 2014, 1:28:03 AM1/22/14
to sou...@googlegroups.com

Keep us updated!

Dario.

From Mobile.

Juan Pinto

unread,
Feb 6, 2014, 7:26:29 PM2/6/14
to sou...@googlegroups.com
Well, I received some MAX485 IC's. Wiring its so simple:

RO -       RX
RE-DE -  PIN3
DI -        TX

A - A
B - B
GND
VCC

But don't work's anyway :(

I tried with crossed TX - RX and works. Maybe a problem with TXENABLE?

Di Maio, Dario

unread,
Feb 6, 2014, 7:33:56 PM2/6/14
to sou...@googlegroups.com

Lets make it simple, build a simple sketch that send on one side and receive on the other. Test it with a crossed wire and later with your RS485.

The Rs485 is differential and doesn't need to share the GND between the two boards. You can share it and should not affect your communication.

Last time your connection was looking good, so isn't easy to troubleshoot it.
Are you sure that your transceiver is enabled? May be a reversed active one (looking at the data sheet should not, but you can try).

No other idea at the moment :(

Dario.

From Mobile.

Juan Pinto

unread,
Feb 6, 2014, 8:26:30 PM2/6/14
to sou...@googlegroups.com
With Bridge and Peer sketches and TX-RX crossed works perfect ( from SoulissApp and pushbuttons )

With same wires, connecting to both RS485 and PIN 3 and this example:


Led indicator seems to blink ok but when I write in Serial Monitor from Master not shows back the text I wroted.

:(((( I'll find some extra help from arduino forums 

Di Maio, Dario

unread,
Feb 7, 2014, 3:52:13 AM2/7/14
to sou...@googlegroups.com

Please share with us the link of the topic, I want to follow the discussion.

Thanks,
Dario.

From Mobile.

Juan Pinto

unread,
Feb 7, 2014, 12:23:25 PM2/7/14
to sou...@googlegroups.com


2014-02-07 Di Maio, Dario <dario....@souliss.net>:

--
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/0q8CUQ63cI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

Di Maio, Dario

unread,
Feb 8, 2014, 5:05:11 PM2/8/14
to sou...@googlegroups.com

Any news?

Dario.

From Mobile.

Juan Pinto

unread,
Feb 8, 2014, 7:17:09 PM2/8/14
to sou...@googlegroups.com
No :(

Juan Pinto

unread,
Feb 16, 2014, 11:26:22 AM2/16/14
to sou...@googlegroups.com
Added a new Image, captured with SerialOscilloscope.

https://drive.google.com/?tab=wo&authuser=0#folders/0B9ptep7VZAWySHhQeDdoWXIxY00

From Bridge node:

Red is USART_TXENPIN
Green is TX PIN 

TXENPIN it's not enabled while TX is enabled, then RS485 is not enabled for transmiting. Im not sure but seems an error on TXENPIN, needs to be ON while TX is sending data and goes to OFF when data is sended, right? 

Again, sorry for my english, in Spanish its so easy to me to explain that things :((

Salu2

Di Maio, Dario

unread,
Feb 16, 2014, 11:30:57 AM2/16/14
to sou...@googlegroups.com

Got your point and was one of my worries.

It looks strage I will try to dive into the code to find why it happen, but of course this is a problem.

Does your code use external libraries that address that pin?

Dario.

From Mobile.

Di Maio, Dario

unread,
Feb 16, 2014, 11:37:53 AM2/16/14
to sou...@googlegroups.com
Try if the attached helps you.

Let me know,
Dario.
vNetDriver_usart.cpp

Juan Pinto

unread,
Feb 16, 2014, 12:04:23 PM2/16/14
to sou...@googlegroups.com
Not working :( same behavior

Di Maio, Dario

unread,
Feb 16, 2014, 12:07:23 PM2/16/14
to sou...@googlegroups.com
Marco is setting up a debugging session using Software Serial, that will give a better understanding on how the code behave.

If you haven't at least one USB to serial converter, I cannot help you directly.

Lets wait for Marco and we will look together whats happen, is probably a stupid mistake by me.

Dario.

Juan Pinto

unread,
Feb 16, 2014, 1:15:45 PM2/16/14
to sou...@googlegroups.com

Ok I have a USB,  tonight i'll try, rx 10 tx 11 right?

Di Maio, Dario

unread,
Feb 16, 2014, 1:17:50 PM2/16/14
to sou...@googlegroups.com
Those pins are used for Ethernet, you should use some other ones.

Consider to have the setup done for the gateway node, it will be easier. Follow the previous post to setup the SoftwareSerial as exaplained to Marco.

Dario.

Di Maio, Dario

unread,
Feb 16, 2014, 1:52:45 PM2/16/14
to sou...@googlegroups.com
Hi Marco and Juan,

please use the attached code for your next tests, it solve the compilation problem for Marco and include the SoftwareSerial on the code side if the USART_DEBUG is activated.

In order to proceed with your test enable USART_DEBUG in usartUsrCfg.h file and use the following code for your sketch:

SoftwareSerial myUSARTDRIVER(6, 7); // RX, TX

void setup()
{
  myUSARTDRIVER.begin(9600);
  myUSARTDRIVER.println("Serial is working!");

...

}

Use the Serial to USB on the gateway node and not on the peer one, and you should see the request that flows from the gateway to the peer node.

Let me know and thanks for your troubleshooting,
Dario.


_Souliss A5.1 r3.zip

Di Maio, Dario

unread,
Feb 16, 2014, 2:05:59 PM2/16/14
to sou...@googlegroups.com
You will also need to add

#include "SoftwareSerial.h"

in your sketch.

Dario.

Di Maio, Dario

unread,
Feb 16, 2014, 2:22:46 PM2/16/14
to sou...@googlegroups.com
I've probably found the problem, the Serial is the only piece of code that is based on Arduino core and looks that has to be moved to an asyncronous implementation

http://blog.arduino.cc/2011/10/04/arduino-1-0/#.UwEPUs60D0w

So, the EN pin is disabled before the data trasmission is completed.

I will work to solve the problem.

Regards,
Dario.

Juan Pinto

unread,
Feb 16, 2014, 2:32:19 PM2/16/14
to sou...@googlegroups.com

Ok, we are near to solve the problem ;)

Di Maio, Dario

unread,
Feb 16, 2014, 2:35:05 PM2/16/14
to sou...@googlegroups.com
Lets try this,
Dario.
vNetDriver_usart.cpp

Marcolino

unread,
Feb 16, 2014, 3:43:27 PM2/16/14
to sou...@googlegroups.com
Hi Dario,
I gave a quick try at this new patch. It work with crossed cable, but does not work over RS485 comunication.
@Juan, have yiu tried?

Thanks

Marco 

Di Maio, Dario

unread,
Feb 16, 2014, 3:45:45 PM2/16/14
to sou...@googlegroups.com

Are you able to get the debugging information?

Dario.

From Mobile.

--

Marcolino

unread,
Feb 16, 2014, 3:57:17 PM2/16/14
to sou...@googlegroups.com
Hi Dario,
on Gateway I got this message:

Serial is working!
(USART)<Send> Bus free
(USART)<Send> Bus free
(USART)<Send> Bus free
(USART)<Send> Bus free

One every xx seconds (i have not count), and one when I get nodes from souliss app.

Nothing Else

Marcolino

unread,
Feb 16, 2014, 3:59:13 PM2/16/14
to sou...@googlegroups.com
Hi,
connecting with cross cables, i got this:

Serial is working!
(USART)<Send> Bus free
(USART)<Read> Data aval
(USART)<Read> Data aval
(USART)<Read> Retrieve data
(USART) Set bus free
(USART)<Send> Bus free
(USART)<Read> Data aval
(USART)<Read> Data aval
(USART)<Read> Retrieve data
(USART) Set bus free
(USART)<Send> Bus free
(USART)<Read> Data aval
(USART)<Read> Incomplete
(USART)<Read> Data aval
(USART)<Read> Retrieve data
(USART) Set bus free
(USART)<Send> Bus free
(USART)<Read> Data aval
(USART)<Read> Incomplete
(USART)<Read> Data aval
(USART)<Read> Retrieve data
(USART) Set bus free
(USART)<Read> Data aval
(USART)<Read> Data aval
(USART)<Read> Retrieve data
(USART) Set bus free

Di Maio, Dario

unread,
Feb 16, 2014, 4:01:49 PM2/16/14
to sou...@googlegroups.com

Ok so the board start to send data, could you please move to the peer the debugging.

I want to understand what the peer see.

Thanks,
Dario.

From Mobile.

--

Marcolino

unread,
Feb 16, 2014, 4:13:20 PM2/16/14
to sou...@googlegroups.com
Hi Dario,
I got another adapter.
When i see Send message on the gateway, nothing arrive on peer.
I got only Serial is working! when i reset the peer.

Marco

Di Maio, Dario

unread,
Feb 16, 2014, 4:18:19 PM2/16/14
to sou...@googlegroups.com
We need to make a trick, remove the USART_TXENABLE option and set manually the pin as output for both gateway and peer, then in the gateway force the pin to HIGH and in the peer as LOW.

If the hardware is ok and is only a problem on the handling of the ENABLE, you should see data on the peer node.

Consider that even if you get corrupted data, at least you should see on the peer the message: "(USART)<Read> Data aval\r\n"

Thanks,
Dario.



--

Marcolino

unread,
Feb 16, 2014, 4:26:28 PM2/16/14
to sou...@googlegroups.com
Hi Dario,
SONO UN PIRLA !!!! (I'm stupid) :-)
I had not enable TXEnable Pin.
After enabled this pin, now there is the comuncation, and I can get Typiclas over RS485 connection.
It Works !!!!!!!!!!!!!!!

But there is Another issue, related to this.
On my peer, I have a servomotor if you remember.
When the peer send or receive 485 data, my servo moving. I do not why, this does not happen on serial comunication with crossed cable.

Thanks for help

Di Maio, Dario

unread,
Feb 16, 2014, 4:28:18 PM2/16/14
to sou...@googlegroups.com
That's a great news, let check also with Juan if he get things working.

Is the TX ENABLE pin related to servo?

Dario.


Marcolino

unread,
Feb 16, 2014, 4:31:12 PM2/16/14
to sou...@googlegroups.com
TX Enable in on pin 3, the servo PWM goes out from pin 9.

@Juan, let us know if it work. I have not uset the preassembled modules, but a couple of bare chip. I used the pullup and pulldown resistor on Gateway on line A and B, and a termination resistor on the peer.



Juan Pinto

unread,
Feb 16, 2014, 4:33:04 PM2/16/14
to sou...@googlegroups.com
Ok, now TXENABLE PIN its On while TX is sending, re-programed both (Bridge and Peer) and ............. TADAAAA!!! now its WORKING!!

Ty so much Dario!! These are very good news for me!!!

:))

El sábado, 14 de diciembre de 2013 18:43:51 UTC+1, Juan Luis escribió:
I want to connect some boards by serial using vNetDriver_usart. 

I configured the first board as an Ethernet-Usart bridge 

QuickCfg.h
#define QC_ENABLE 0x00

vNetCFG.h
# define VNET_SUPERNODE   1
# define VNET_MEDIA1_ENABLE  1
# define VNET_MEDIA2_ENABLE  0
# define VNET_MEDIA3_ENABLE  0
# define VNET_MEDIA4_ENABLE  0
# define VNET_MEDIA5_ENABLE  1

The board is an Arduino Mega +  ENC5100,
I loaded some examples like  Souliss_ex02_FiatLux_eth1 working fine local and remote from Android.

I expected read on serial port the vNet commands in broadcast mode, but nothing comes up from serial port to comunicate to other boards.

Do I need to configure something else?
Is there any example of vNetDriver_usart?
Thanks

Di Maio, Dario

unread,
Feb 16, 2014, 4:33:26 PM2/16/14
to sou...@googlegroups.com
May you have a try with a crossed connection with TXENABLE active?

Dario.


On Sun, Feb 16, 2014 at 10:31 PM, Marcolino <marco.p...@gmail.com> wrote:
TX Enable in on pin 3, the servo PWM goes out from pin 9.

@Juan, let us know if it work. I have not uset the preassembled modules, but a couple of bare chip. I used the pullup and pulldown resistor on Gateway on line A and B, and a termination resistor on the peer.



Marcolino

unread,
Feb 16, 2014, 4:35:42 PM2/16/14
to sou...@googlegroups.com
The servo moving also with direct crossed connection.
Servo Library use Interrupt, can this cause problem with pin 3 or Software Serial?

Marco

Di Maio, Dario

unread,
Feb 16, 2014, 4:36:29 PM2/16/14
to sou...@googlegroups.com
We haven't yet won the battle :D

One more step is understand how many devices can be connected on the same bus, this will depend on how the collision avoidance mechanism works and if perform well.

I hope that we can run at least 30 nodes.

Of course, we can build several busses, connected via Ethernet or others to go over the limit.

I need yours and Marco help to investigate further!

Dario.


--

Di Maio, Dario

unread,
Feb 16, 2014, 4:37:26 PM2/16/14
to sou...@googlegroups.com
If you disable TXENABLE are you still having the problem?


--

Di Maio, Dario

unread,
Feb 16, 2014, 4:44:47 PM2/16/14
to sou...@googlegroups.com
Marco can you try to setup a test with 4 nodes or more nodes?

Thanks,
Dario.


On Sun, Feb 16, 2014 at 10:31 PM, Marcolino <marco.p...@gmail.com> wrote:
TX Enable in on pin 3, the servo PWM goes out from pin 9.

@Juan, let us know if it work. I have not uset the preassembled modules, but a couple of bare chip. I used the pullup and pulldown resistor on Gateway on line A and B, and a termination resistor on the peer.



Marcolino

unread,
Feb 16, 2014, 4:46:11 PM2/16/14
to sou...@googlegroups.com
Hi Dario,
Servo is moving also without TX Enable.
Now I try do disable SerialSoftware

M:,

Di Maio, Dario

unread,
Feb 16, 2014, 4:46:53 PM2/16/14
to sou...@googlegroups.com
Guys I've added you both into the release note of A5.1

Dario.
Release note.txt

Marcolino

unread,
Feb 16, 2014, 4:52:00 PM2/16/14
to sou...@googlegroups.com
Hi Dario, thanks for including.
Removing software serial from peer, servo is fine even with TX pin enabled.

For the test you request, i have the hardware to do that, I have one Mega, 2 Uno and 1 nano, bit it take some time.....I would like to finish the board for my Locale Caldaie, so i can do the test with 5 nodes.
This board will be equiped wit 485 and ethernet.
I'll also do some test on long cable.

Please Juan, update us if also from your side are able to connect the 2 board with 485.

Marco

Juan Pinto

unread,
Feb 16, 2014, 4:55:53 PM2/16/14
to sou...@googlegroups.com
Wow, second mention in last 3 releases!! =)) jaja

Now I can work in next node ( an Atmega644 with OpenHab ) and all nodes comunicate with other over RS485 using the standard RJ11 installation of my house (phone installation)

I'll try with more nodes and longer distances.

Juan Pinto

unread,
Feb 16, 2014, 5:58:33 PM2/16/14
to sou...@googlegroups.com
Ok, third node runing over 3 RS485 bare chips! That's working!

Di Maio, Dario

unread,
Feb 16, 2014, 8:18:02 PM2/16/14
to sou...@googlegroups.com

Stress it!

Dario.

From Mobile.

--

Marcolino

unread,
Feb 17, 2014, 4:24:44 PM2/17/14
to sou...@googlegroups.com
Hi Dario,
I'm trying to add 3rd device, but I cannot make it working.
I think that I'm wrong here:

Souliss_SetRemoteAddress(memory_map, caldaia_address,1);
Souliss_SetRemoteAddress(memory_map, test_address,2);

Changing the 3rd parameter the behaviour is different, but I don't know how to use to make it work the 2 nodes.

Any help?

Thanks

Marco

Di Maio, Dario

unread,
Feb 17, 2014, 4:32:54 PM2/17/14
to sou...@googlegroups.com

It should be fine, ensure that you receive frames using the debug.

Let me know,
Dario

From Mobile.

--

Marco Pozzuolo

unread,
Feb 17, 2014, 4:36:29 PM2/17/14
to sou...@googlegroups.com
Adding the 3rd node, configured like this, I cannot get typicals on node working before. If I put 6 on second remote address i got all typicals on 1st node.
Frame are sent, i can se rx Tx led blinking on all nodes.
Tomorrow I'll add debug.
Meanwhile if Juan can link their sketch for all nodes.

Thanks

Ps. Dario can you move Debug settings in sketch? Is very slow process each time edit the config files for each board I have. Now I have 3 board, 1 with and 2 without debug, and each time i have to edit config file.

Thanks

Marco


-----------------------------------------------------------------------------------------------------------------
Marco Pozzuolo
PS. Realizzo PCB artigianali con piste stagnate.


--
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/0q8CUQ63cI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

Juan Pinto

unread,
Feb 17, 2014, 4:38:41 PM2/17/14
to sou...@googlegroups.com
Try with my sketches  :)


--
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/0q8CUQ63cI4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.
Souliss_Bridge1_22.ino
Souliss_Peer2V1_15.ino
Souliss_PeerV1_15.ino

Di Maio, Dario

unread,
Feb 17, 2014, 4:40:34 PM2/17/14
to sou...@googlegroups.com

You should not debug so often, but for your case just cut the code from usartUsrCfg.h to your sketch, it will be enough.

Dario.

From Mobile.

Marcolino

unread,
Feb 18, 2014, 4:40:28 PM2/18/14
to sou...@googlegroups.com
Hi Dario,
attaching the 3rd node I can't make bus working.
I get a lot of this on Gateway Debug:

(USART)<Read> Corrupted

I attach The 3 scketches. Please Help.

Marco
Souliss_GatewayPrincipale.ino
Souliss_LocaleCaldaia.ino
Souliss_TerzoNodo485.ino

Di Maio, Dario

unread,
Feb 18, 2014, 4:46:36 PM2/18/14
to sou...@googlegroups.com

Have you tried the Juan ones?

Dario.

From Mobile.

--
It is loading more messages.
0 new messages