#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();
}
}
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
^
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)
^
// 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();
}
}
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.
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))
^
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.