Topic: Help with esp8266
Hi there,
great programm
I have actually two issues. First is the app, see: http://forum.remotexy.com/viewtopic.php?id=221
My second problem is the esp8266-12.
It is connected to my arduino micro. It should communicate to the arduino, but it does not work properly.
In the serial monitor, i can see that the arduino is sending "AT". After that "AT+RST". But then it says: "Module not available, RemoteXY stoped".
If i check the RX on the Arduino with an FTDI UART-USB-Converter, I can see that the esp gives the response "OK" to the first "AT"-request. But than nothing.
In my thinking, that means that the wiring should be ok.
I have plugged the esp via an external 3,3V power supply.
Why is the esp not responding on the restart-command?
Do you have any idea?
Here is my sketch, just 2 LED added to see if the arduino is running...
Thanks in advance, ungesimmt
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT
#define REMOTEXY__DEBUGLOGS Serial
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_SERIAL Serial1
#define REMOTEXY_SERIAL_SPEED 115200
#define REMOTEXY_WIFI_SSID "Lichtsteuerung"
#define REMOTEXY_WIFI_PASSWORD "12345678"
#define REMOTEXY_SERVER_PORT 6377
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,7,0,0,0,68,0,6,0,2,
6,0,1,10,43,43,5,10,39,39,
6,4,0,50,5,8,53,49,2,9,
54,6,1,1,81,34,18,24,6,78,
18,18,2,83,97,118,101,0,1,1,
81,9,18,24,6,57,18,18,4,77,
111,100,101,0,3,4,62,9,13,49,
49,62,9,31,2 };
// this structure defines all the variables of your control interface
struct {
// input variable
uint8_t rgb_picker_r; // =0..255 Red color value
uint8_t rgb_picker_g; // =0..255 Green color value
uint8_t rgb_picker_b; // =0..255 Blue color value
int8_t helligkeit_slider; // =0..100 slider position
uint8_t button_save; // =1 if button pressed, else =0
uint8_t button_mode; // =1 if button pressed, else =0
uint8_t select_1; // =0 if select position A, =1 if position B, =2 if position C, ...
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
//globale Variablen
#define LED_gruen 14//MISO
#define LED_rot 15//SCK
int test=0;
unsigned long previousMillis = 0;
void setup()
{
pinMode(LED_BUILTIN, OUTPUT); //integrierte LED
pinMode(LED_gruen, OUTPUT);
pinMode(LED_rot, OUTPUT);
Serial.begin(115200); //Verbindung USB direkt zu PC (debug Console)
delay(1000);
RemoteXY_Init ();
} //Ende void setup()
void loop()
{ unsigned long currentMillis = millis();
RemoteXY_Handler ();
if (currentMillis - previousMillis >= 250) //Timer 1ms
{ previousMillis = currentMillis;
if ( test == 0 )
{ digitalWrite(LED_gruen, HIGH);
test=1;
}
else if ( test == 1 )
{ digitalWrite(LED_gruen, LOW);
test=0;
};
};
} //Ende void loop()