Robofun 機器人論壇

 找回密碼
 申請會員
搜索
熱搜: 活動 交友 discuz
查看: 6427|回復: 7
打印 上一主題 下一主題

使用內部ip做一個web server

[複製鏈接]
跳轉到指定樓層
1#
發表於 2013-10-17 09:30:18 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
我的Arduino有加裝Ethernet模組,
server程式也已上載到Arduino板子,
透過區域連線是可以連進server,
但如果我想讓外面連進server, 要如何做呢?
2#
發表於 2013-10-18 09:49:27 | 只看該作者
回復 1# pizg


   連到internet請參考:Arduino Ethernet Shield Tutorial
http://www.instructables.com/id/Arduino-Ethernet-Shield-Tutorial/
3#
 樓主| 發表於 2013-10-19 00:12:34 | 只看該作者
本帖最後由 pizg 於 2013-10-19 01:04 編輯
回復  pizg


   連到internet請參考:Arduino Ethernet Shield Tutorial
vegewell 發表於 2013-10-18 09:49


我從中華電信的盒子拉一條網路線接到 Ethernet 模組, 然後依照您提供的網頁內容做, 將 DhcpAddressPrinter.ino 上載到 Arduino 板子,
開啟 Serial Monitor, 卻印出 "Failed to configure Ethernet using DHCP",
請問是哪裡出錯了?


我忽然想到, 是不是因為"尚未連線"緣故?
這又衍生一個問題,
Arduino 如何撥號連線到網路?
4#
發表於 2013-10-20 03:01:50 | 只看該作者
回復 3# pizg


   我想先看看你的Ethernet Shields板子是新的?還是舊的?如果長這樣可能是新的:


-------
如果長這樣可能是舊的:


-------
有些店家明明是舊的,當新的賣,
新的會自動得到位址自動上網, 舊的要自己手動指定,
Newer Arduino Ethernet Shields include a sticker with the device's MAC address.
With version 1.0, the library supports DHCP. Using Ethernet.begin(mac) with the proper network setup,
the Ethernet shield will automatically obtain an IP address.
5#
 樓主| 發表於 2013-10-20 22:45:12 | 只看該作者
本帖最後由 pizg 於 2013-10-20 22:47 編輯
回復  pizg


   我想先看看你的Ethernet Shields板子是新的?還是舊的?如果長這樣可能是新的:


-- ...
vegewell 發表於 2013-10-20 03:01


報告V老師:我的是舊版子, 哈~~我是不是當冤大頭了?
自己隨便指定一個唯一的網址都可以嗎?例如 192.168.0.12
6#
發表於 2013-10-23 02:50:58 | 只看該作者
回復 5# pizg

讓你有加裝Ethernet模組的Arduino,及電腦同時接上路由器盒子你應該可以知道Arduino的區域位址是多少?就是192.168.?.?
你先告訴我是什麼數字?
7#
 樓主| 發表於 2013-10-23 17:48:13 | 只看該作者
本帖最後由 pizg 於 2013-10-23 23:56 編輯
回復  pizg

讓你有加裝Ethernet模組的Arduino,及電腦同時接上路由器盒子你應該可以知道Arduino的區域位 ...
vegewell 發表於 2013-10-23 02:50

要知道 Arduino 的位址得查Router哪兒?
若是電腦, 可以在命令列打入 'ipconfig',或是到網站 http://myip.com.tw/ ,
http://checkip.dyndns.org/ 查詢,
但 Arduino 呢?
我的作業系統 Windows7, Arduino IDE 1.0.5
我的中華電信 router 是 DSL-5540C,
無法用 192.168.1.1 登入.

我在電腦上鍵入 ipconfig, 出現:
C:\Users\xxx>ipconfig

Windows IP 設定


PPP 介面卡 hinet:

   連線特定 DNS 尾碼 . . . . . . . . :
   IPv4 位址 . . . . . . . . . . . . : 118.161.140.xxx <<< 這個xxx好像會自動跳不一樣的
   子網路遮罩 . . . . . . . . . . . .: 255.255.255.255
   預設閘道 . . . . . . . . . . . . .: 0.0.0.0

乙太網路卡 區域連線 2:

   連線特定 DNS 尾碼 . . . . . . . . :
   連結-本機 IPv6 位址 . . . . . . . : fe80::a9e9:718d:f290:cdb9%13
   自動設定 IPv4 位址 . . . . . . . .: 169.254.205.185
   子網路遮罩 . . . . . . . . . . . .: 255.255.0.0
   預設閘道 . . . . . . . . . . . . .:

乙太網路卡 區域連線:

   媒體狀態 . . . . . . . . . . . . .: 媒體已中斷連線
   連線特定 DNS 尾碼 . . . . . . . . :

通道介面卡 isatap.{18E6AE3A-A413-4466-9E63-A38CF221C313}:

   媒體狀態 . . . . . . . . . . . . .: 媒體已中斷連線
   連線特定 DNS 尾碼 . . . . . . . . :

通道介面卡 isatap.{91111A39-4CFF-472F-A427-F176CE902029}:

   媒體狀態 . . . . . . . . . . . . .: 媒體已中斷連線
   連線特定 DNS 尾碼 . . . . . . . . :

通道介面卡 6TO4 Adapter:

   連線特定 DNS 尾碼 . . . . . . . . :
   IPv6 位址. . . . . . . . . . . . .: 2002:76a1:8cb0::76a1:8cb0
   預設閘道 . . . . . . . . . . . . .: 2002:c058:6301::c058:6301

通道介面卡 isatap.{21A42F6A-45CE-4010-934F-A2DA9DE54601}:

   媒體狀態 . . . . . . . . . . . . .: 媒體已中斷連線
   連線特定 DNS 尾碼 . . . . . . . . :
===================================================

另外, 這個網址 http://www.tinyosshop.com/index.php?route=product/product&product_id=66
我發現內文有敘述 Ethernet 和 micro SD Card 共用一個 SPI 接口,
他們無法同時被使用。若要使用 Ethernet, 好像要設
// disable SD card if one in the slot
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
8#
發表於 2013-10-24 02:56:20 | 只看該作者
回復 7# pizg

dlink dsl-5540c 不能web登入,只能透過傳輸線比較麻煩
你試試這個軟體 路由器端口映射工具Simple Port Forwarding V3.7.0綠色中文版

http://www.ddooo.com/softdown/7255.htm
擊 [廣東電信服務器下載]
使用這個軟體之時 讓你有加裝Ethernet模組的Arduino,及電腦同時接上dsl-5540c 看能否看出什麼?
您需要登錄後才可以回帖 登錄 | 申請會員

本版積分規則

小黑屋|手機版|Archiver|機器人論壇 from 2005.07

GMT+8, 2024-9-28 02:40 , Processed in 0.278740 second(s), 7 queries , Apc On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表