connecting two ESP8266

119 views
Skip to first unread message

Thierry Ev

unread,
Aug 23, 2016, 9:28:13 AM8/23/16
to souliss
Hi folks,
As I explained briefly in the presentation topic, I'm using ESP8266 under Arduino IDE (but without any Arduino board, only FTDI board for USB interface).
I'm now able to upload and run a sketch on two separate ESPs and transfer some text. Typically,one is  a web server, other a client, but I need an external router, not my aim.
I would like to exchange datas from some of these ESPs (say A type, quantity 1 to 8, data from 4 accelerometer captors) to a central ESP (say B type), without the need of any internet connection.
I don't need data exchange between A type nodes.
As I'm a newbe, I would appreciate some basic questions :
1) What would be the best scenario ? 1 to 8 nodes, A type, and 1 gateway, B type ?
I saw somewhere in Souliss (but don't remember where) that one needs to wait about 1 second between to events. I want some reactivity from accelerators, so i plan to agregate multiple reedings of captors (say 4 by second, with 6 readings each, for a total of 24 integers) and send them on a single Souliss event :
2) is this possible ?
3) due to the max number of 8 A type ESPs, the central B type one will receive 8 events during a second : is this possible ?
Many thanks for your help :-)

Thierry Ev

unread,
Aug 23, 2016, 11:15:42 AM8/23/16
to souliss
Sorry about another newbie question...
I could compile the Souliss Hello_ESP8266 example without any problem.
From this example, I started developing my "server" part (type B of my example), removed all lines dealing with external connection, and for ease during devlopment, I removed any comment...
but I have a long error message while compiling my sketch, and don't find the reason even comparing with the Hello_ESP8266 example :-/
Please could you help me ?
Here is my "minimal" sketch :

#include <ESP8266WiFi.h>
#include <EEPROM.h>
#include "Souliss.h"
uint8_t values
[4];

void setup()
{
 
Serial.begin(115200);
 
Initialize();
 
SetAddress(0xAB01, 0xFF00, 0x0000);
 
SetAsPeerNode(0xAB02, 1);
//SetAsPeerNode(0xAB03, 2); to add if a 2nd "client" node
}

void loop() {
  EXECUTEFAST
() {
    UPDATEFAST
();
    FAST_50ms
() {   // We process the logic and relevant input and output every 50 milliseconds
     
if (subscribedata(GeneralEvent, values, 4)) {
       
Serial.print(" received : ");
       
Serial.println(values[0], DEC);
     
}
   
}
    FAST_PeerComms
();
 
}
}

The beginning of error message :

In file included from C:\Documents and Settings\user\Mes documents\Arduino\libraries\souliss/Souliss.h:39:0,
                 from SouslissServerBrief.ino:3:
C:\Documents and Settings\user\Mes documents\Arduino\libraries\souliss/GetConfig.h:64:42: error: redefinition of 'const U16 vnet_media_en [5]'
 const U16 vnet_media_en[VNET_MEDIA_NUMBER] = {VNET_MEDIA1_ENABLE,  // Media 1
                                          ^

and the end of error message :

In file included from C:\Documents and Settings\user\Mes documents\Arduino\libraries\souliss/Souliss.h:194:0,
                 from SouslissServerBrief.ino:3:
C:\Documents and Settings\user\Mes documents\Arduino\libraries\souliss/base/Communication.cpp:374:4: error:   initializing argument 5 of 'U8 Souliss_SubscribeData(U8*, U16, U8, U8*, U8*)' [-fpermissive]
 U8 Souliss_SubscribeData(U8 *memory_map, U16 message, U8 action, U8* data, U8* len)
    ^ 

Thierry Ev

unread,
Aug 23, 2016, 12:17:54 PM8/23/16
to souliss
I finally found my error... sorry to bother you :-/
Here is my compiling code :

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

#define WIFICONF_INSKETCH
#define WiFi_SSID               "none"
#define WiFi_Password           "none"    

#include <ESP8266WiFi.h>
#include <EEPROM.h>
#include "Souliss.h"
uint8_t values
[4];

uint8_t valL
=4;

void setup()
{
 
Serial.begin(115200);
 
Serial.println("Starting ESP as master...");

 
Initialize();
 
SetAddress(0xAB01, 0xFF00, 0x0000);
 
SetAsPeerNode(0xAB02, 1);
//SetAsPeerNode(0xAB03, 2); to add if a 2nd "client" node

 
Serial.println("Startup done !");

}

void loop() {
  EXECUTEFAST
() {
    UPDATEFAST
();
    FAST_50ms
() {   // We process the logic and relevant input and output every 50 milliseconds

     
if (subscribedata(GeneralEvent, values, &valL)) {

       
Serial.print(" received : ");
       
Serial.println(values[0], DEC);
     
}
   
}
    FAST_PeerComms
();
 
}
}


 Now my problem is ESP8266 is trying to connect to my router, due to a previous essay (stored in the background, seems...)

Di Maio, Dario

unread,
Aug 24, 2016, 3:39:45 AM8/24/16
to sou...@googlegroups.com

Souliss peers exchange data on change, no delay out of the processing time. As rule of thumb, 1 frame/s is the throughput of each node in the network.

Your central node should be the Gateway, your peers can report changes and then your Gateway can store those values (have a look at LastIn in the Gateway page of the wiki).

Likely you are looking to get your gateway to be an AP for your peers, look at the LYT examples as tgey start as AP when no WiFi is configured.

Dario.

From Mobile.

Thierry Ev

unread,
Aug 26, 2016, 5:49:36 AM8/26/16
to souliss
Thanks for your help, Dario :-)
I could compile and run LYT8266_WiFi_Erase, WiFi_Bulb and LYTBulb_ESP8266 examples
But I got an error message while compiling e02_LYT8266_WiFi_Bulb :-(
Here is beginning of the message error :
In file included from C:\Documents and Settings\user\Mes documents\Arduino\libraries\souliss/Souliss.h:197:0,
                 from e02_LYT8266_WiFi_Bulb.ino:31:
C:\Documents and Settings\user\Mes documents\Arduino\libraries\souliss/base/NetworkSetup.cpp: In function 'void Souliss_SetIPAddress(U8*, U8*, U8*)':
C:\Documents and Settings\user\Mes documents\Arduino\libraries\souliss/base/NetworkSetup.cpp:169:35: error: cannot convert 'String' to 'const char*' for argument '1' to 'int strcmp(const char*, const char*)'
   if(strcmp(WiFi.SSID(), WiFi_SSID) || strcmp(WiFi.psk(), WiFi_Password))
                                   ^
Do you have any idea the error could come from ?

Di Maio, Dario

unread,
Aug 26, 2016, 12:58:01 PM8/26/16
to sou...@googlegroups.com

It depends on ESP8266 cores that you are using. In the Wiki under "Micro and Transceivers" you can find for each Souliss release the supported ESP8266 cores.

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+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/6f941c8f-8f23-40be-b9b5-a092b2b06425%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages