USART Peer do not show Typicals in SoulissApp (ETH/USART Bridge)

119 views
Skip to first unread message

Gabriele Ribichini

unread,
May 25, 2014, 6:09:24 PM5/25/14
to sou...@googlegroups.com
Dear Dario,
I have tried to follow your suggestion for the architecture.. some ProDiNo supernodes working as bridge between ETH and USART others only USART.

My first configuration have one board configured as Gateway and Bridge ETH / USART and one board wired via RS485 to the first and configured as Peer.

Addresses are shared between the two skecthes as follow
#define eth_address_1 0x0065                  // 0x0065 is equal to 101 in decimal
#define eth_subnet_mask 0xFF00
#define eth_supernode 0x0000

#define usart_address_1 0xCE01
#define usart_address_2 0xCE02



The Gateway is configured with the following code:
#define BOARDTYPE_INSKETCH
#define GATEWAYTYPE_INSKETCH
#define ETHERNETMACRAW_INSKETCH

#define QC_BOARDTYPE 0x20
#define QC_GATEWAYTYPE 0x01
#define ETHERNETMACRAW 0x01

void setup()
{
DiNo_v2_HW_Setup();

// Define two Simple Light logics and the relays
Set_SimpleLight(RELAY1);
Set_SimpleLight(RELAY2);
Set_SimpleLight(RELAY3);
Set_SimpleLight(RELAY4);

Souliss_SetAddress(eth_address_1, eth_subnet_mask, eth_supernode);
Souliss_SetAddress(usart_address_1, eth_subnet_mask, eth_supernode); // this node act as a supernode bridge from USART to ETH

//SetAsGateway(eth_address_1);
SetAsGateway(usart_address_1);
SetAsPeerNode(usart_address_2, 1);
}

and calling FAST_GatewayComms() in the loop.


The Peer is configured as follow:
#define BOARDTYPE_INSKETCH
#define QC_BOARDTYPE 0x20

void setup()
{
  DiNo_v2_HW_Setup();

  // Define two Simple Light logics and the relays
  Set_SimpleLight(RELAY1);
  Set_SimpleLight(RELAY2);
  Set_SimpleLight(RELAY3);
  Set_SimpleLight(RELAY4);
  
  Souliss_SetAddress(usart_address_2, eth_subnet_mask, usart_address_1);
}

and calling FAST_PeerComms(); in the loop.

SoulissApp see two nodes but the second one have no typicals.

Any hint ?

thanks
- gabriele

Di Maio, Dario

unread,
May 26, 2014, 2:43:23 AM5/26/14
to sou...@googlegroups.com

Hi Gabriele,

In your code you can remove the ETHERNENETMACRAW and the gateway address shall be the ethernet one.

On the other hand, the RS485 driver has an enable pin that shall be mapped in the usartCfg.h file, I don't remember the pin number, you can probably found it into any sketch by KMP using the RS485.
Then you should be on the way.

I suggest in any case to use some KMP sketches to be sure that connection are ok, moving later to Souliss.

Let me know,
Dario.

From Mobile.

--
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/2ef1e212-c86b-44f3-8e1e-655bead72b93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Di Maio, Dario

unread,
May 26, 2014, 2:53:17 AM5/26/14
to sou...@googlegroups.com

One more, in the same file you should set Serial1 instead of Serial.

Dario.

From Mobile.

On 26 May 2014 00:09, "Gabriele Ribichini" <gabriele....@gmail.com> wrote:
--

Gabriele Ribichini

unread,
May 26, 2014, 3:39:04 AM5/26/14
to sou...@googlegroups.com

OK, I'll give a try tonight

Tnx
Gabriele

   

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/eDLBsUX8Vjw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.

To post to this group, send email to sou...@googlegroups.com.

Di Maio, Dario

unread,
May 26, 2014, 5:13:09 AM5/26/14
to sou...@googlegroups.com
Please replace the followings files:
usartUsrCfg.h in conf/usart
DINo_v2.h in hardware/KMP

and add DINo_v2_Gateway_RS485.h in /bconf folder.

In your sketch, change DINo_V2_Gateway.h with the DINo_v2_Gateway_RS485.h and use as Gateway address the ethernet one, then you should have a try.

These files sets the RS485 enable pin and the Serial port, so that no additional activity have to be performed. In any case I suggest you to build a test sketch that write periodically on Serial1 and one on the other node that reads Serial1 and prints on Serial (USB Serial Monitor), so that you can understand if you are ok from the hardware point of view.

Let me know,
Dario.


DINo_v2_Gateway_RS485.h
usartUsrCfg.h
DINo_v2.h

Gabriele Ribichini - LEANE Int. Srl

unread,
May 26, 2014, 8:06:52 AM5/26/14
to sou...@googlegroups.com

Too kind from you..

I will let you know soon.
Gabriele
   

Fulvio Spelta

unread,
May 26, 2014, 10:02:23 AM5/26/14
to sou...@googlegroups.com, gabriele....@leane.it
Keep us informed, I'm interested in this configuration :-)

Gabriele Ribichini - LEANE Int. Srl

unread,
May 26, 2014, 1:52:12 PM5/26/14
to sou...@googlegroups.com
Sorry.. it does not work (same behavior as before)
To me it looks like the two boards are not communicating at all.
I am not sure about the Serial input/output code, please see below.

Gateway has the following code:

SETUP:
Serial1.begin(9600);

LOOP:
Serial1.print("a");


Peer has the following code:

SETUP:
    Serial.begin(9600);
    while (!Serial) {
      ; // wait for serial port to connect. Needed for Leonardo only. If need debug setup() void.
    }
    Serial1.begin(9600);    

LOOP
   while(Serial1.available() > 0)
   {
    Serial.print("*");
    Serial.print(Serial1.read());
   }


--
Gabriele Ribichini
gabriele....@leane.it
mobile: +39 329 1920851
**************************
LEANE International s.r.l. - ROMA
Viale Odone Belluzzi, 33 00128 ROMA (ITALY)
tel +39 06 20369970 - fax +39 06 20369971
http://www.leane.it - http://www.dewesoft.com
**************************


On Mon, May 26, 2014 at 4:02 PM, Fulvio Spelta <fulvio...@gmail.com> wrote:
Keep us informed, I'm interested in this configuration :-)

--
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/eDLBsUX8Vjw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Di Maio, Dario

unread,
May 26, 2014, 1:55:30 PM5/26/14
to sou...@googlegroups.com

You are running this code only? Is it ok, but you need to put pin3 high on transmitting node and low on receiving.

Dario.

From Mobile.

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.

Di Maio, Dario

unread,
May 26, 2014, 1:58:07 PM5/26/14
to sou...@googlegroups.com

Put a delay in the trasmitting node.

Dario.

From Mobile.

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.

Di Maio, Dario

unread,
May 26, 2014, 2:25:27 PM5/26/14
to sou...@googlegroups.com

Marco and Juan,

Could you please share your experience with rs485? Have you used termination resistor?

Thanks,
Dario.

From Mobile.

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.

Gabriele Ribichini - LEANE Int. Srl

unread,
May 26, 2014, 2:37:34 PM5/26/14
to sou...@googlegroups.com

No.. This code has been added to the examples I mentioned yesterday, after upgrading files you sent me.

   

Di Maio, Dario

unread,
May 26, 2014, 2:57:43 PM5/26/14
to sou...@googlegroups.com

Ok, so build a sketch and run only the sample code that you have posted. Add a delay and the tx/rx pin3 that shall be high for transmitting.

The rs485 connection shall be A to A and B to B. The termination resistor should not be required in your case.

Dario.

From Mobile.

Gabriele Ribichini - LEANE Int. Srl

unread,
May 26, 2014, 5:01:25 PM5/26/14
to sou...@googlegroups.com
Dario,
finally I got the basic RS485 communication working with the attached two sketches...
the problem was that I had to wire A->B and B->A, is that right ? (not on my knowledge)

I will try to build the souliss skecth now.

- gabriele


usart_transmitter.ino
usart_receiver.ino

Di Maio, Dario

unread,
May 26, 2014, 5:10:12 PM5/26/14
to sou...@googlegroups.com

The attached sketches are empty :)

You got communication wiring A to B and B to A? It should be A to A and B to B.

Let me know,
Dario.

From Mobile.

Gabriele Ribichini

unread,
May 26, 2014, 5:12:57 PM5/26/14
to sou...@googlegroups.com
Sorry,
see attached files.

Yes, I had to cross A to B terminals.

- gabriele



- gabriele


   }
--
Gabriele Ribichini
gabr...@ribichini.net
usart_receiver.ino
usart_transmitter.ino

Gabriele Ribichini

unread,
May 26, 2014, 5:23:53 PM5/26/14
to sou...@googlegroups.com, gabr...@ribichini.net
Hello Dario,
the Souliss communication does not seems to work using the update you sent (even cross connecting A->B)
It is too late for me to try to debug your code.. I guess it is easier for you to integrate my very basic sketches in the vNet communication routines.

In the meanwhile I sent an email to KMP to understand why A and B terminals has to be crossed.

goodnight folks.
- gabriele

Di Maio, Dario

unread,
May 26, 2014, 5:32:00 PM5/26/14
to sou...@googlegroups.com, gabr...@ribichini.net

Lets wait for the answer by KMP. Actually in the Souliss code is only missing the pinMode set for TX and RX pins. Try to add that into the setup().

Dario.

From Mobile.

--
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.

Di Maio, Dario

unread,
May 27, 2014, 5:53:51 PM5/27/14
to sou...@googlegroups.com

Kmp has relased the schematic for ProDINo and the boards has a termination and bias resistor onboard. This can create troubles connecting multiple devices over the rs485 line.

In the actual configiration with only two boards it should not matter.

Dario.

From Mobile.

Juan Pinto

unread,
May 29, 2014, 10:06:50 AM5/29/14
to sou...@googlegroups.com
This create problems, for sure. Terminator and bias resistor must be on first and last node only.

Di Maio, Dario

unread,
May 29, 2014, 10:15:31 AM5/29/14
to sou...@googlegroups.com
Actually Gabriele has only two boards, so this is not his problem. But a bus with multiple DINo boards require to dissolder those resistor (SMD, so small) manually, that isn't a nice option.

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.

Juan Pinto

unread,
May 29, 2014, 10:38:17 AM5/29/14
to sou...@googlegroups.com
No it isn't :(
Reply all
Reply to author
Forward
0 new messages