`我是ESP8266的新手。
我创建了一个托管在000webhost上的网站,但每当我使用ESP8266的AT命令集连接到服务器时,连接立即关闭。我试图通过ESP8266从我的Arduino板发送一些数据到网站
因此我无法向网站发送任何消息。 关于如何处理这个问题的任何想法?谢谢!
串行监视器上的输出
Arduino代码
model = load_model('my_model.h5')
model.fit_generator(training_set,
steps_per_epoch = 100000,
epochs = 15,
validation_data = test_set,
validation_steps = 40000)
PHP代码:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); //RX,TX
int LEDPIN = 13;
void setup()
{
pinMode(LEDPIN, OUTPUT);
Serial.begin(9600); // communication with the host computer
//while (!Serial) { ; }
// Start the software serial for communication with the ESP8266
mySerial.begin(9600);
Serial.println("");
Serial.println("Remember to to set Both NL & CR in the serial monitor.");
Serial.println("Ready");
Serial.println("");
}
void loop()
{
digitalWrite(13,1);
// listen for communication from the ESP8266 and then write it to the serial
monitor
if ( mySerial.available() ) { Serial.write( mySerial.read() ); }
// listen for user input and send it to the ESP8266
if ( Serial.available() )
// { mySerial.write( mySerial.print("AT+CWMODE=1") ); }
{ mySerial.write( Serial.read() ); }
}