http://smartliving.ru/Main/ScMonitorContactPAV писал(а):Как он считывает?
http://smartliving.ru/Main.DlinkHub
http://smartliving.ru/Main/ModuleOnewire
Без Ethernet
http://smartliving.ru/Main/ArduinoDirect
Модератор: immortal
Код: Выделить всё
Ethernet.begin(mac);
Код: Выделить всё
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0)
{
if (Serial.available())
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip);
}
// give the Ethernet shield a second to initialize:
delay(2000);
Так в том и дело, что адрес arduino получает от dhcp сервера и вижу я этот адрес в serial и пингую его. Но в браузере просто пустая страница. Всякие \status не отрабатывают.LutsenkoDenis писал(а):попробуй так:Код: Выделить всё
// start the Ethernet connection: if (Ethernet.begin(mac) == 0) { if (Serial.available()) Serial.println("Failed to configure Ethernet using DHCP"); // no point in carrying on, so do nothing forevermore: // try to congifure using IP address instead of DHCP: Ethernet.begin(mac, ip); } // give the Ethernet shield a second to initialize: delay(2000);
Код: Выделить всё
// client - соединение с сервером по ethernet
// /handlers/SetSensorTemperature.ashx - урл куда передаём
// data - передаваемые данные
client.println("POST /handlers/SetSensorTemperature.ashx HTTP/1.1");
if (Serial.available())
Serial.print("POST /handlers/SetSensorTemperature.ashx HTTP/1.1");
client.println("Host: www.silvergate.ru");
client.println("Content-Type: application/x-www-form-urlencoded");
client.println("Connection: close");
client.println("User-Agent: Arduino/1.0");
client.print("Content-Length: ");
client.println(data.length());
client.println();
client.print(data);
client.println();
if (Serial.available())
Serial.println("data uploaded");