1
我正在使用SerialIP庫,並試圖爲我的Arduino創建一個SLIP連接。現在,當我嘗試ping時,RX LED亮起,證明它實際上接收到數據包,但TX引腳不亮,並且數據包不返回。爲什麼我的Arduino不能返回它的ping?
我正在使用示例服務器程序。它設法到達主環(已與一些數字寫入測試),這樣我就可以看到那將是錯誤的代碼的唯一事情就是IP地址定義:
// Set the IP address we'll be using. Make sure this doesn't conflict with
// any IP addresses or subnets on your LAN or you won't be able to connect to
// either the Arduino or your LAN...
IP_ADDR myIP = {192,168,5,2};
IP_ADDR subnet = {255,255,255,0};
我通過Ubuntu服務器本,當我跑route
,我得到這一行:
Destination Gateway Genmask Flags Metric Ref Use Iface
... ... ... ... ... ... ...
192.168.5.2 * 255.255.255.255 UH 0 0 0 sl0
我想,也許我不得不改變子網{} 255255255255,但它仍然有同樣的結果:沒有TX點燃RX。
現在我不知道爲什麼這不起作用。爲什麼是解決方案?
我遵循本教程,並使用示例程序中的確切代碼:http://arduino.cc/playground/Code/SerialIP – tyjkenn 2012-07-20 20:24:55
@tyjkenn請告訴我們您嘗試了什麼。這就是Arduino在你發佈的鏈接上說的:「如果RX閃爍但不是TX,Arduino忽略數據包,確保你分配給SLIP接口的IP地址與上傳到Arduino的代碼中的IP地址相匹配,確保代碼例如通過使用digitalWrite()在主循環中打開和關閉LED()。內存不足可能導致Arduino在到達主循環之前復位。「你讀過嗎?除非你給我更多的信息,否則我無法幫助你。祝你好運。 – 2012-07-25 14:44:53
它到達主循環,並且IP地址確實匹配。 – tyjkenn 2012-07-25 22:21:02