ESP node not really working, RS485 works great.

45 views
Skip to first unread message

stef mertens

unread,
Jul 9, 2017, 12:23:48 PM7/9/17
to souliss
Hi everybody,

I finally managed to start with Souliss after the renovation of our house. I am doing the first steps now, and tried some different setup in order to build a solid Souliss network.

As for now i used 2 ESP8266's, one as a gateway, and one as a peer. The gateway also has a RS485 module attached to USART and i have another peer with RS485 on a simple Arduino Uno.

The thing is: the gateway works perfectly. So is the Arduino Uno on RS485. But the ESP8266 peer on the same wireless network doesn't. When i send a command with Soulissapp, the ESP node immediately swithches the led on, but it seems like he doesn't send back it's status, so even with the led ON, Soulissapp doesn't 'see' it, and the health from that specific node is also very low - as if communication just goes in one direction.

I grabbed the code straight from the built-in examples.

Here is the gateway code:

// Let the IDE point to the Souliss framework
#include "SoulissFramework.h"


// Configure the framework
#include "bconf/MCU_ESP8266.h"              // Load the code directly on the ESP8266
#include "conf/Gateway_wPersistence.h"                   // The main node is the Gateway, we have just one node
#include "conf/usart.h"                      // USART / RS485 transceiver
#include "conf/IPBroadcast.h"
#include "conf/DynamicAddressing.h"


// **** Define the WiFi name and password ****
#define WIFICONF_INSKETCH
#define WiFi_SSID               "********"
#define WiFi_Password           "********"    


// Include framework code and libraries
#define USARTDRIVER_INSKETCH
#define USART_TXENABLE          1
#define USART_TXENPIN           5
#define USARTDRIVER             Serial






#include <ESP8266WiFi.h>
#include <EEPROM.h>


/*** All configuration includes should be above this line ***/
#include "Souliss.h"


// This identify the number of the LED logic
#define LL1          0  
#define LL2     1
#define LL2bright    2




// **** Define here the right pin for your ESP module ****
#define LL1OUT           2
#define LL2OUT           4


void setup()
{  
   
Initialize();


   
// Connect to the WiFi network and get an address from DHCP
   
//SetAddressingServer();
   
GetIPAddress();                          
   
SetAsGateway(myvNet_dhcp);       // Set this node as gateway for SoulissApp  


   
// This is the vNet address for this node, used to communicate with other
   
// nodes in your Souliss network
   
SetAddress(0xAB01, 0xFF00, 0x0000);
   
SetAddress(0xCE01, 0xFF00, 0x0000);
   
SetAsPeerNode(0xCE02, 1);
   
SetAsPeerNode(0xAB02, 2);
   
   
   
Set_SimpleLight(LL1);        // Define a simple LED light logic
   
Set_DimmableLight(LL2);        // Define a simple LED light logic
       
    pinMode
(LL1OUT, OUTPUT);         // Use pin as output
    pinMode
(LL2OUT, OUTPUT);         // Use pin as output


   
}


void loop()
{
   
// Here we start to play
    EXECUTEFAST
() {                    
        UPDATEFAST
();  
       
        FAST_50ms
() {   // We process the logic and relevant input and output every 50 milliseconds
           
Logic_SimpleLight(LL1);
           
DigOut(LL1OUT, Souliss_T1n_Coil,LL1);
           
Logic_DimmableLight(LL2);
           
int bitshift = mOutput(LL2bright) * 4; // ESP has a 10 bit DAC - Arduino has an 8 bit DAC
            analogWrite
(LL2OUT, bitshift);


           
ProcessCommunication();
                   
}
             
       
// Here we handle here the communication with Android
        FAST_GatewayComms
();                                        
   
}
    EXECUTESLOW
()
   
{  
        UPDATESLOW
();


        SLOW_10s
()  {
       
           
// The timer handle timed-on states
           
Timer_DimmableLight(LL2);                        
       
}
   
}
   
}


And this the code running on the ESP:

// Let the IDE point to the Souliss framework
#include "SoulissFramework.h"


// Configure the framework
#include "bconf/MCU_ESP8266.h"              // Load the code directly on the ESP8266
#include "conf/DynamicAddressing.h"


// **** Define the WiFi name and password ****
#define WIFICONF_INSKETCH
#define WiFi_SSID               "********"
#define WiFi_Password           "********"    


// Include framework code and libraries
#include <ESP8266WiFi.h>
#include <EEPROM.h>


/*** All configuration includes should be above this line ***/
#include "Souliss.h"


// This identify the number of the LED logic
#define ESPL1          0      
         
// **** Define here the right pin for your ESP module ****
#define OUTPUTPIN 5


void setup()
{  


   
Initialize();
   
   
// Connect to the WiFi network and get an address from DHCP
   
GetIPAddress();                          


   
// This is the vNet address for this node, used to communicate with other
 
// nodes in your Souliss network
   
SetAddress(0xAB02, 0xFF00, 0xAB01);
   
   
Set_SimpleLight(ESPL1);        // Define a simple LED light logic
    pinMode
(OUTPUTPIN, OUTPUT);         // Use pin as output
   
}


void loop()
{
   
// Here we start to play
    EXECUTEFAST
() {                    
        UPDATEFAST
();  
       
        FAST_50ms
() {   // We process the logic and relevant input and output every 50 milliseconds
           
Logic_SimpleLight(ESPL1);
           
DigOut(OUTPUTPIN, Souliss_T1n_Coil,ESPL1);
       
}
             
       
// Here we handle here the communication with Android
        FAST_PeerComms
();                                              
   
}
}

 I am pretty sure i am overlooking something, but i haven't the slightest idea what exactly. 

Anybody out here who immediately sees my mistake?

Thanks inadvance,

Stef

Di Maio, Dario

unread,
Jul 9, 2017, 12:29:13 PM7/9/17
to sou...@googlegroups.com

Hi Stef,

likely adding IPBroadcast even on the peer will solve your issues.

Let me know,
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/c2b992db-8228-4d03-a38c-a41970210198%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

stef mertens

unread,
Jul 9, 2017, 12:34:30 PM7/9/17
to sou...@googlegroups.com
Hi Dario, 

First of all: WOW! Thanks for the superfast support, many companies' support teams should take an example from that! 
I'll try your solution tonight and will keep you informed. 

Thanks, 

Stef

Op 9 jul. 2017 18:29 schreef "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/2rj4mXrUM1A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+unsubscribe@googlegroups.com.

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

Di Maio, Dario

unread,
Jul 9, 2017, 12:35:54 PM7/9/17
to sou...@googlegroups.com

You just wrote while I was playing with my Souliss at home, generally is not that fast.

Dario.

stef mertens

unread,
Jul 9, 2017, 2:41:27 PM7/9/17
to sou...@googlegroups.com
Still, it's impressive ;-)

I have included the IpBroadcast, and the health of the node is very high now. Still the response time is quite long (as in: the led immediately goes on like before, but syncing takes about 10 seconds) and in 1/4 of the cases the peer does not report back the right status to the gateway.

I allready spent a lot of trying and figuring out what could be wrong here, maybe i should try to upload the sketch to a regular Arduino with a wizznet interface, so i can make sure it has nothing to do with an accidential poor quality ESP, allthough it replies to pings very well.

I'm going to try that tomorrow, and keep you posted.

Thanks,

Stef

Virusvrij. www.avast.com

Di Maio, Dario

unread,
Jul 9, 2017, 3:14:18 PM7/9/17
to sou...@googlegroups.com

Temporally swap the gateway and peer and see what happen.

Or try without the rs485 node. Isn't that related, but just to have a picture.

Dario.

stef mertens

unread,
Jul 14, 2017, 8:25:39 AM7/14/17
to sou...@googlegroups.com
Hi Dario,

I finally managed to swap GW and Peer. Still the same problem. On the gateway the led goes on and reacts perfectly, on the peer there seems to be no feedback (led lights immediately, but the gateway doesn't know)

So then i flashed the original code back on the 2 ESP's, commenting out the RS485 part, but it is buggy... Now the gateway doesn't find the typicals on the node anymore, and i have to reset both ESP's about 8 times before they even respond to pings and before i can get de nodes of it. (allthough they say they're connected with their blue leds)

I think the ESP platform seems to be unstable, do you have any experience with this?

Thanks,

Stef

Di Maio, Dario

unread,
Jul 14, 2017, 11:32:43 AM7/14/17
to sou...@googlegroups.com
ESP are stable and works well, most of the people have moved to that platform myself included.

Dario.

Reply all
Reply to author
Forward
0 new messages