极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: zcbzjx

【翻译教程】enc28J60 和 Arduino (3)——作为客户端

[复制链接]
发表于 2013-12-28 23:05:01 | 显示全部楼层
弱弱的问一下
  1.   if (millis() > timer) {
  2.     timer = millis() + 5000;
  3.     ether.browseUrl(PSTR("/demo/"), "aphorisms.php", website, response_callback);
  4.   }
  5. }
复制代码
有时间有什么限定么?太高太低都不行
回复 支持 反对

使用道具 举报

发表于 2014-3-10 16:22:24 | 显示全部楼层
tom 发表于 2013-6-30 09:28
为什么我总是出现这个结果

[webClient]

不好意思,我也出现了相同的问题。你是怎么解决的最后?
回复 支持 反对

使用道具 举报

发表于 2014-3-25 16:02:00 | 显示全部楼层
sddxwyt 发表于 2014-3-10 16:22
不好意思,我也出现了相同的问题。你是怎么解决的最后?

我也是出现这样的问题, 求大神帮助
回复 支持 反对

使用道具 举报

发表于 2014-3-29 21:12:57 | 显示全部楼层

为什么我总是出现这个结果

[webClient]
IP:  192.168.0.3
GW:  192.168.0.1
DNS: 192.168.0.1
DNS failed
SRV: 0.0.0.0
回复 支持 反对

使用道具 举报

发表于 2014-6-12 11:12:57 | 显示全部楼层
顺流逆流 发表于 2014-3-29 21:12
为什么我总是出现这个结果

[webClient]

把PROGMEM去掉试试
回复 支持 反对

使用道具 举报

发表于 2014-6-12 16:52:17 | 显示全部楼层
弘毅 发表于 2012-10-9 09:06
好贴。。。。

我按照他上面的操作一步步实验了,但是老是出现如下问题,百度无果,想向您请教一下
  1. [webClient]
  2. IP:  192.168.0.149
  3. GW:  192.168.0.1
  4. DNS: 192.168.0.1
  5. SRV: 217.64.195.207

  6. <<<REQ
  7. HTTP/1.1 406 Not Acceptable
  8. Date: Thu, 12 Jun 2014 08:52:05 GMT
  9. Server: Apache
  10. Vary: Accept-Encoding
  11. Content-Length: 101
  12. Connection: close
  13. Content-Type: text/html; charset=iso-8859-1

  14. Blocked by mod_slotlimit. More information about this error may be available in the server error log.
复制代码
回复 支持 反对

使用道具 举报

发表于 2014-6-15 12:44:45 | 显示全部楼层
谢谢啦!感谢老师发表.
回复 支持 反对

使用道具 举报

发表于 2014-7-11 13:37:14 | 显示全部楼层
楼主,我用51移植的enc28j60  现在ping通了  但是我不知道咋个和自己搭的服务器进行数据交换   而且现在服务器和网卡也还没联通  不知道咋个搞了现在  服务器需要搭建路由吗
回复 支持 反对

使用道具 举报

发表于 2014-8-6 12:10:57 | 显示全部楼层
本帖最后由 photoliao 于 2014-8-6 12:21 编辑
  1. #include <EtherCard.h>
  2. static byte mymac[] = {0x74,0x69,0x69,0x2D,0x30,0x31};
  3. byte Ethernet::buffer[700];

  4. static uint32_t timer;
  5. char website[] PROGMEM = "www.lucadentella.it";
  6. static void response_callback (byte status, word off, word len) {
  7.   Serial.print((const char*) Ethernet::buffer + off + 207);
  8. }

  9. void setup () {

  10.   Serial.begin(57600);
  11.   Serial.println("[webClient]");
  12.   if (!ether.begin(sizeof Ethernet::buffer, mymac, 10))
  13.       Serial.println( "Failed to access Ethernet controller");
  14.   else
  15.       Serial.println("Ethernet controller initialized");

  16.   if (!ether.dhcpSetup())
  17.        Serial.println("Failed to get configuration from DHCP");
  18.   else
  19.        Serial.println("DHCP configuration done");

  20.   ether.printIp("IP:  ", ether.myip);
  21.   ether.printIp("GW:  ", ether.gwip);  
  22.   ether.printIp("DNS: ", ether.dnsip);

  23.   if (!ether.dnsLookup(website))
  24.     Serial.println("DNS failed");
  25.    
  26.   ether.printIp("SRV: ", ether.hisip);
  27. }

  28. void loop() {

  29.   ether.packetLoop(ether.packetReceive());
  30.    if (millis() > timer) {
  31.     timer = millis() + 5000;
  32.     Serial.println();
  33.     Serial.print("<<< REQ ");
  34.     ether.browseUrl(PSTR("/demo/"), "aphorisms.php", website, response_callback);
  35. }
  36. }
复制代码
回复 支持 反对

使用道具 举报

发表于 2014-9-7 17:18:41 | 显示全部楼层
为啥我的是 DNS failed? 我的是去连接百度的。。。
ether.browseUrl(PSTR(""), "", website, response_callback);这样空着应该没关系的吧?
回复 支持 反对

使用道具 举报

发表于 2014-9-10 10:17:10 | 显示全部楼层
本帖最后由 yhy60 于 2014-9-10 12:12 编辑

我出现这样的问题??什么原因?
[webClient]
IP:  192.168.1.104
GW:  192.168.1.1
DNS: 202.96.104.65
SRV: 115.239.211.110

<<< REQ
<<< REQ
<<< REQ
<<< REQ : 222
Connection: Close
Content-Type: text/html; charset=iso-8859-1



程序好了,网页是联通的,换了一个网站地址,就好了,不过显示的信息各不相同。

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a >here</a>.</p>
</body></html>
回复 支持 反对

使用道具 举报

发表于 2015-7-6 19:20:32 | 显示全部楼层
编译的时候出现了错误:variable 'website' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
根据提示在char前加上const就好了
回复 支持 反对

使用道具 举报

发表于 2015-7-8 07:58:06 | 显示全部楼层
后知后觉 发表于 2014-6-12 11:12
把PROGMEM去掉试试

去掉也不行呢
回复 支持 反对

使用道具 举报

发表于 2015-7-8 08:17:24 | 显示全部楼层
顺流逆流 发表于 2014-3-29 21:12
为什么我总是出现这个结果

[webClient]

请问您  解决了吗    我也遇到这个问题
回复 支持 反对

使用道具 举报

发表于 2015-7-28 01:35:38 | 显示全部楼层
Client Demo

Ethernet controller initialized

Failed to get configuration from DHCP
IP Address:        0.0.0.0
Netmask:        0.0.0.0
Gateway:        0.0.0.0

DNS failed
SRV IP:        0.0.0.0
我是有多头痛。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-3-29 17:26 , Processed in 0.040815 second(s), 29 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表