Any chance to connect two RS485 tranceivers to one Arduino Mega Souliss Gateway?

147 views
Skip to first unread message

Thomas R.

unread,
Dec 26, 2016, 2:04:12 PM12/26/16
to souliss
Hi everybody!

Currently doing renovation of my old house and because of a roughcast on one level I can't chiseling slots for new wires because I never can clone roughcast pattern transitions that you don't end up seeing that some one messed it up somehow. Because of that I need to reuse some traditional 3 wire NYM-J cables as RS485 bus (A,B,GND). Unfortunately in one place I can't avoid a star cabling and can't find the right bus termination that this star cabling combination of NYM-J wires and EIB wires works reliable with the speed I need. I know that star wiring and RS485 is a problem on it's own, but normally I always found a working setup even if I was not able to avoid star cabling. In this case the center of the star is near by by my gateway node and I could split off the star into two bus wires but for that I would need two transceivers and different RS485 subnets within souliss.

I can't find any information on how to setup this dual transceiver approach. Souliss UART configuration does not look like it's possible at all . 
This ist the setup I use on my gateway with a single RS485 transceiver:

#define USARTDRIVER_INSKETCH
  #define USARTDRIVER     Serial3 // ony available on ATmega2560 RX=PIN15,TX=PIN14
  #define USART_TXENABLE  0    // Activate the USART_TXENPIN pin before any transmission
  #define USART_TXENPIN   25    // The pin to use to active the transmission (not required by current UART RS485 Module)


#define USART_MAXRETRY        20

#define USARTBAUDRATE_INSKETCH
#define USART_BAUD9k6           0
#define USART_BAUD19k2          0
#define USART_BAUD57k6          0
#define USART_BAUD115k2         0
#define USART_BAUD256k          1

Is there any chance to configure two receivers to allow some configuration for the gateway node like this:

//TCP/IP Ethernet configuration
uint8_t ip_address[4]  =  {192, 168, 254, 10};
uint8_t subnet_mask[4] =  {255, 255, 254, 0};
uint8_t ip_gateway[4]  =  {192, 168, 254, 1};


//vNet Configuration
#define vNet_subnet           0xFF00
#define vNet_ip_gateway       ip_address[3]         // Gateway LAN address
#define vNet_rs485_gateway1    0xCE01            // Gateway RS485 Port 1 at Serial 3
#define vNet_rs485_gateway 2   0xCF01            // Gateway RS485 Port 2 at Serial 2

Thanks a lot for reading! 
Maybe someone of you has a constructive advice for me?

Best,
Thomas

Di Maio, Dario

unread,
Dec 26, 2016, 2:40:15 PM12/26/16
to sou...@googlegroups.com
No way as is coded now, you can anyhow use a dedicated board for each RS485 branch with Ethernet on the otherside to bridge the networks.

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+unsubscribe@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/cc825cff-0c43-4e5e-9b37-444c86173ef9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas R.

unread,
Dec 26, 2016, 3:04:30 PM12/26/16
to souliss
Thanks for your super fast reply, Dario!

I was afraid that you would answer that, cause this would rise power consumption a lot.

Will take a look into your code but if I cant patch it somehow I need to go with your advice to connect the second bus to a separate arduino or replace the arduino based light switch PCB with a new design based on ESP to connect via wifi. But I think wifi via internal antennas of a ESP12 board would even cause more power consumption than two arduinos, two RS485 tranceivers and one w5100 ethernet shield.

Best,
Thomas

Di Maio, Dario

unread,
Dec 26, 2016, 3:12:03 PM12/26/16
to sou...@googlegroups.com
Looks strange, one additional board may consume around 2 W that's nearly 3 or 4 euros per year on the electrical bill.

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+unsubscribe@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Thomas R.

unread,
Dec 26, 2016, 4:16:15 PM12/26/16
to souliss
Hi Dario,

Did not really calculate that! Along with the w5100 ethernet shield and a uplinked 100Mbit switch port its about 4,6W which is of cause not worth investing the time. Should have done this calculation before starting to change your code and add a media type 6 to it. Which was a VERY dirty work around to add a second RS485 interface. Going to throw the code away and go with the second arduino, now!

Thanks for your heads-up!

Best,
Thomas



Di Maio, Dario

unread,
Dec 26, 2016, 4:18:18 PM12/26/16
to sou...@googlegroups.com
Ethernet shield and AVR based arduino looks a quite outdated solution nowadays, go for multiple ESP8266 or if you really need an AVR use the ESP8266 as WiFi transceiver, wiki will give you examples.

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+unsubscribe@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Thomas R.

unread,
Dec 26, 2016, 4:58:31 PM12/26/16
to souliss
Hi Dario,

My first prototype PCB for this light switch was equipped with a ESP-12F (ESP8266) without any AVR and even though the next access point is not far away, the wifi wave radiation had to pass the wall diagonal. The main PCB with 8 buttons + 8 LEDs + temp and light sensors + port expander chip + the esp-12F is small and located in an normal 3d printed wall switch inlay (in-wall pattress box) along with its power supply board. So I measured about 970mA at 3.3V. In addition the wifi access point also consumes a little more power. I have not counted the amount of ESP PCBs I will end up in the whole house but it sums up to a lot.
So we are talking about power consumption over all switches + scattered radiation of all of this devices.

Am I crazy when trying by replacing them with ATmega32u4 + RS485?

Independent on my general decision for this special case the ESP might be the better solution instead of the dual bus / dual arduino setup.

I just need to redesign the ESP based PCB to end up aesthetically as nice as my current ATmega32u4 version. Maybe I should use the ESP07s to attache an external antenna beneath the wall socket frame to reduce power consumption a bit.

Sorry for thinking out loud but your input really helps me a lot even if it's not directly souliss related.

Best,
Thomas

Di Maio, Dario

unread,
Dec 26, 2016, 5:46:17 PM12/26/16
to sou...@googlegroups.com
Hi Thomas,

best design approach has many variables, one is how far are your installation places from the AP to identify if you should go with RS485 or WiFi. Likely the answer is go with both, you can use ESP8266 and RS485.

More, it depends on how many wires you can pull, because in some cases it may even better to collect many wires to a single point with many boards.

That's to say that there is no answer to your question as there are many possible options. You can merge several architectures based on your needs, this likely will give you the best result.

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+unsubscribe@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Thomas R.

unread,
Dec 26, 2016, 10:04:25 PM12/26/16
to souliss
Hi Dario,

You are right. I might have to rethink some of my decisions.

As a workaround I slowed down RS485 bus speed to 19.2kbaud. So I had to reprogram all nodes. With this setting even the star cabling RS485 bus works. 
Only downside at the moment is that after a power drop all peers which also where restarted ask my gateway node for their previous slot states and gateway asks my openHAB server to provide this states and afterwards the gateway broadcasts this states to the peers, so that they can restore their previous slot states. The gateway itself has to restore its slot states as well. Because of all of this peer traffic the RS485 bus is loaded and it takes a while to update all the states on all peers.

But compared to the unstable communication on the star cabling bus with 256kbaud this solution is a fair-trade off until I redesigned my PCB.

Thanks for your help!

Best,
Thomas
Reply all
Reply to author
Forward
0 new messages