/**************************************************************************
Souliss - Hello World for Expressif ESP8266
This is the basic example, create a software push-button on Android
using SoulissApp (get it from Play Store).
Load this code on ESP8266 board using the porting of the Arduino core
for this platform.
***************************************************************************/
// 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/IPBroadcast.h"
// **** Define the WiFi name and password ****
#define WIFICONF_INSKETCH
#define WiFi_SSID "TIM-12....7"
#define WiFi_Password "WLFpy.....8Xc8...."
// Include framework code and libraries
#include <ESP8266WiFi.h>
#include <EEPROM.h>
// Define the network configuration
uint8_t ip_address[4] = {192, 168, 1, 17};
uint8_t subnet_mask[4] = {255, 255, 255, 0};
uint8_t ip_gateway[4] = {192, 168, 1, 1};
#define Gateway_address 17
#define myvNet_address ip_address[3] // The last byte of the IP address (77) is also the vNet address
#define Gateway_RS485_address 0xCE01
#define Peer1_address 0xCE11
#define Peer2_address 0xCE12
#define Peer3_address 18
#define Peer4_address 19
#define Peer5_address 20
#define myvNet_subnet 0xFF00
#define myvNet_supern Gateway_RS485_address
/*** 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 5
void setup()
{
Initialize();
Souliss_SetAddress(Peer4_address, myvNet_subnet, Gateway_address);
// SetAsGateway(myvNet_address);
// 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(0x0013, 0xFF00, 0x0011);
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_PeerComms();
}
} L'ESP parte sempre in DHCP e poi dopo viene forzato l'indirizzo manuale nello stack.
Quindi inizialmente dovresti vedere un ip diverso.
Dario.
From Mobile.
--
Hai ricevuto questo messaggio perché sei iscritto al gruppo "souliss-it" di Google Gruppi.
Per annullare l'iscrizione a questo gruppo e non ricevere più le sue email, invia un'email a souliss-it+unsubscribe@googlegroups.com.
Per postare in questo gruppo, invia un'email a souli...@googlegroups.com.
Per visualizzare questa discussione sul Web, visita https://groups.google.com/d/msgid/souliss-it/310c978d-a12e-406e-a98f-d624eae595c2%40googlegroups.com.
Per altre opzioni visita https://groups.google.com/d/optout.
Nel tuo codice manca SetIPAddress
https://github.com/souliss/souliss/wiki/Addressing#use-of-ethernet-nodes-with-static-ip-address-m1
From Mobile.