Compilation errors on an ESP8266

36 views
Skip to first unread message

stef mertens

unread,
Nov 18, 2017, 3:55:16 AM11/18/17
to souliss
Hi,

I have a gateway running on an arduino mega with ethernet and an RS485 connection (with no nodes connected to it just yet), works well. - I can connect to the gateway through Soulissapp 

I want to set up a supernode on an ESP8266, also with a RS485 connection, to act as a bridge between the gateway and more RS485 nodes.

The end setup should be:

Gateway <> ethernet <> ESP <> RS485 > node1 > node 2 ...
        |                               ESP <> RS485 > node 3 > node4 ...
        |
      RS485 > node 5 > node 6

I took some example code to start with for 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/SuperNode.h"                   // The main node is the Gateway, we have just one node
#include "conf/usart.h"                      // USART / RS485 transceiver
#include "conf/IPBroadcast.h"

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

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

// 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 MYLEDLOGIC          0               

// **** Define here the right pin for your ESP module **** 
#define OUTPUTPIN           4

void setup()
{   
    Initialize();

    uint8_t ip_address[4]  = {192, 168, 80, 181};
uint8_t subnet_mask[4] = {255, 255, 255, 0};
uint8_t ip_gateway[4]  = {192, 168, 80, 1};
#define myvNet_address  ip_address[3]    


    // This is the vNet address for this node, used to communicate with other
    // nodes in your Souliss network
    SetAddress(0xAB02, 0xFF00, 0x0000);
    SetAddress(0xCE01, 0xFF01, 0xAB02);
    SetAsPeerNode(0xCE02, 1);
    
    Set_SimpleLight(MYLEDLOGIC);        // 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(MYLEDLOGIC);
            DigOut(OUTPUTPIN, Souliss_T1n_Coil,MYLEDLOGIC);
        } 
              
        // Here we handle here the communication with Android
        FAST_GatewayComms();                                        
    }


The gateway has IP 192, 168, 80, 180, and vnet address 0xAB01.

The code doesnt want to compile.

This is the error i get: (sorry it's in dutch)

Arduino: 1.8.3 (Windows 10), Board:"NodeMCU 0.9 (ESP-12 Module), 80 MHz, 115200, 4M (3M SPIFFS)"

C:\Users\stef\AppData\Local\Temp\arduino_modified_sketch_480714\e02_WiFitoRS485_n1.ino:28:0: warning: "USART_TXENABLE" redefined [enabled by default]

 #define USART_TXENABLE          1

 ^

In file included from C:\Users\stef\AppData\Local\Temp\arduino_modified_sketch_480714\e02_WiFitoRS485_n1.ino:16:0:

C:\Users\stef\Documents\Arduino\libraries\souliss-7.2-friariello.1/bconf/MCU_ESP8266.h:52:0: note: this is the location of the previous definition

 #define USART_TXENABLE    0

 ^

C:\Users\stef\AppData\Local\Temp\arduino_modified_sketch_480714\e02_WiFitoRS485_n1.ino:29:0: warning: "USART_TXENPIN" redefined [enabled by default]

 #define USART_TXENPIN           5

 ^

In file included from C:\Users\stef\AppData\Local\Temp\arduino_modified_sketch_480714\e02_WiFitoRS485_n1.ino:16:0:

C:\Users\stef\Documents\Arduino\libraries\souliss-7.2-friariello.1/bconf/MCU_ESP8266.h:53:0: note: this is the location of the previous definition

 #define USART_TXENPIN    2

 ^

sketch\e02_WiFitoRS485_n1.ino.cpp.o:(.text.loop+0x14): undefined reference to `Souliss_CommunicationChannels(unsigned char*)'

sketch\e02_WiFitoRS485_n1.ino.cpp.o:(.text.loop+0x18): undefined reference to `Souliss_GetTypicals(unsigned char*)'

sketch\e02_WiFitoRS485_n1.ino.cpp.o: In function `loop':

C:\Users\stef\Documents\Arduino\libraries\souliss-7.2-friariello.1/base/T1n.cpp:34: undefined reference to `Souliss_CommunicationChannels(unsigned char*)'

C:\Users\stef\Documents\Arduino\libraries\souliss-7.2-friariello.1/base/T1n.cpp:34: undefined reference to `Souliss_GetTypicals(unsigned char*)'

collect2.exe: error: ld returned 1 exit status

Meerdere bibliotheken gevonden voor "SoulissFramework.h"
Gebruikt: C:\Users\stef\Documents\Arduino\libraries\souliss-7.2-friariello.1
Niet gebruikt: C:\Users\stef\Documents\Arduino\libraries\souliss
Niet gebruikt: C:\Users\stef\Documents\Arduino\libraries\souliss
Niet gebruikt: C:\Users\stef\Documents\Arduino\libraries\souliss
Niet gebruikt: C:\Users\stef\Documents\Arduino\libraries\souliss
exit status 1
Fout bij het compileren van board NodeMCU 0.9 (ESP-12 Module)

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.



  Any idea what could be wrong here?

Thanks

Di Maio, Dario

unread,
Nov 18, 2017, 4:46:59 AM11/18/17
to sou...@googlegroups.com

A supernode is not a gateway, so you should not process FAST_GatewayComms();  but the Peer ones instead.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/7eb9abd9-0de0-4633-8194-aeef875c7a74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

stef mertens

unread,
Nov 18, 2017, 5:16:12 AM11/18/17
to sou...@googlegroups.com
Thanks, it compiles now... Did it through remote desktop while on the train, and i will check if communication works when I get back home.


Op 18 nov. 2017 10:46 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/n4T7zVG240o/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,
Nov 18, 2017, 5:20:52 AM11/18/17
to sou...@googlegroups.com

It won't you have to correct the addresses, there is an example on the wiki that fits your case.

Do not forget routing path (either dynamic or static)

https://github.com/souliss/souliss/wiki/ESP8266-to-RS485

Dario.

stef mertens

unread,
Nov 18, 2017, 5:38:22 AM11/18/17
to sou...@googlegroups.com
Ok, i see now. That's a very nice explanation. Seems like the documentation had a major update since my last experiments with Souliss last year, thanks for that! 

Op 18 nov. 2017 11:20 schreef "Di Maio, Dario" <dario....@souliss.net>:

stef mertens

unread,
Nov 18, 2017, 10:55:09 AM11/18/17
to sou...@googlegroups.com
Hi Dario,

Can a bridge contain any typicals? I have set-up the esp8266 as a bridge, following the instructions provided in your link. No RS485 nodes are connected to it yet. I made 2 T19's in its sketch, but soulissapp "finds" the node, but does not see the typicals defined on it. Als, the health from the ESP node is very low. 
I can ping it, and it has nice responsetimes.

Thanks,

Stef

Virusvrij. www.avast.com

Di Maio, Dario

unread,
Nov 18, 2017, 11:41:55 AM11/18/17
to sou...@googlegroups.com

Yes it can behave as any other node.

You have defined your nodes in the Gateway, so SoulissApp has the full list even if there is no connection with those (so healthy is low).

Your Gateway and your Bridge will communicate via IP so you should see the T19s of the Bridge regardless the RS485 connectivity.

Get your Bridge online and visible in SoulissApp then move to RS485.

Dario.

Reply all
Reply to author
Forward
0 new messages