// 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);
}
}
}
// 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();
}
}
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.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/CAKGhMPL9te56Xx19T1iOog7VWu86VrtnoWypuCBAOA5hjmzbwg%40mail.gmail.com.
You just wrote while I was playing with my Souliss at home, generally is not that fast.
Dario.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/CALySKD8hHHh90TtKT7rYFXYKk%3DnBQSOeeCS0DUNuqsq8eFrrzg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/CAKGhMPL7vJb-xZX4PbAkZx2%3D%3DcU59d37kDpxx3v30jXgCKUeag%40mail.gmail.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/CALySKD8eQAJbpy2C-gZ8pXLxcCExqf7dr5VpKYrSXcFLWp6RaA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/CAKGhMP%2B9KxrWfa7A5qHVo9nz0vKQPw5yLjo5h1HaiKSjiO2Vpg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/CALySKD_mOXOhXGKEmRMoG3FcDs1wTnddZhFwd577q_F-uoKCmA%40mail.gmail.com.