完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
大家好,我对基于和声的应用有问题。调试时,所有的工作都很好,但现在是时候把它连接到真正的网络了。我得到了专用IP,它是192.168164.4。它可以通过DHCP获得。调谐后的设备不可用。经过一些实验,我发现,它不能用大于192.1680.254的IP地址工作。无论是手动设置为静态地址,还是由DHCP提供。设备没有反应,谁能告诉我,什么会引起这样的问题?我的设置:PIC32 MX795F512LMPPLABX V4.01和声1.11,后来更新到2.04(没有改变)XC32 1.44和谐配置屏幕截图
以上来自于百度翻译 以下为原文 Hello Guys, I've got problem with my hARMony based application. Everything worked fine while debugging, but now it's time to connect it to real network. I got dedicated IP, which is 192.168.164.4. It can be obtained by DHCP. After tuning on device stay unavailable. After some experiments I figured out, that it can't work with IP addresses greater than 192.168.0.254. No matter is it set manually as static address, or it's given by DHCP. Device just does not respond. Could anyone tell me, what can cause problem like that? My setup: PIC32MX795F512L MPLABX v4.01 Harmony 1.11, later updated to 2.04 (nothing changed) XC32 1.44 Harmony configuration screenshots attached Attached Image(s) |
|
相关推荐
19个回答
|
|
|
你的子网掩码是255.255.255.0,它在不同的子网上放置192.168164.4到192.1681.xxx。
以上来自于百度翻译 以下为原文 Your subnet mask is 255.255.255.0 That puts 192.168.164.4 on a different subnet to 192.168.1.xxx |
|
|
|
|
|
这些数据并不是很重要,我的程序在启动时用NVM或“工厂默认”来定义它,在这个函数调用之前定义。如果启用DHCP,它只是DHCP,所以所有的东西都应该工作。
以上来自于百度翻译 以下为原文 This data are not really important, my program replaces it on startup with custom ones from NVM or "factory default", defined before this function call. And if DHCP enabled- it's just DHCP, so everything should work. void setNetwork(){ TCPIP_NET_HANDLE netH = TCPIP_STACK_IndexToNet(0); if(networkInitDone == 1 || nvmData.DHCP){ networkInitDone = 1; return; } if(!TCPIP_STACK_NetIsReady(netH)){ return; } TCPIP_STACK_NetAddressSet(netH, &nvmData.IPs[0], &nvmData.IPs[2], true); TCPIP_STACK_NetAddressGatewaySet(netH, &nvmData.IPs[1]); TCPIP_STACK_NetAddressDnsPrimarySet(netH, &nvmData.IPs[3]); TCPIP_STACK_NetAddressDnsSecondSet(netH, &nvmData.IPs[4]); networkInitDone = 1; } |
|
|
|
|
|
那么你真正的子网掩码是什么?司机实际使用的那个?
以上来自于百度翻译 以下为原文 Then what is you REAL Subnet Mask? The one the Driver is actually using? |
|
|
|
|
|
这不是更改接口的网络设置的正确方法。请从存储(IP地址、GW等)恢复参数,更新TCPIpJETNETWorksCONFIG数据结构,然后调用TCPIPPSSTACKILIALIALIZE(),以正确的参数开始。-更新参数,然后调用CaltTCPIPHSTACKNETUP()。
以上来自于百度翻译 以下为原文 This is not the right way to change the network settings for an interface. Recover your parameters from storage (IP addresses, GW, etc.), update the TCPIP_NETWORK_CONFIG data structure and then call TCPIP_STACK_Initialize() to start with the right parameters. Alternatively, turn down the interface - TCPIP_STACK_NetDown() - update the parameters and then call TCPIP_STACK_NetUp(). |
|
|
|
|
|
我们的网络策略-设备应该使用DHCP配置,所以我只提供IP地址,只是访问设备,知道它在哪里。所以我不应该关心参数,不是吗?但看起来真正的子网掩码应该是255.255.252.0关于配置更改-谢谢,我会更正我的代码,但是即使现在它在“启动”和“按用户配置”(从Web表单)上都很好用。尝试用这种方式调试:在IP地址和掩码上显示0.0.0.0。但它不是真的,因为设备获得地址,它只是没有响应。
以上来自于百度翻译 以下为原文 By the our network policy- devices should use DHCP configuration, so I was provided only with IP address, just to access device and know where it is. So I should not really care about parameters, isn't it? But looks like real subnet mask should be 255.255.252.0 About configuration changes- thank you, I will correct my code, but even now it works good with "propper" addresses, both on startup and on-the-fly by user configuration (from web form). Can't really say which addresses are obtained by the board, tried to debug it this way: Shows 0.0.0.0 both on IP address and Mask. But it's not actually true, because device getting address, it's just not responding. Attached Image(s) |
|
|
|
|
|
得到更多关于问题的信息。看起来PHY部分和MAC驱动程序运行良好,因为在打开ICMPv4服务器后,我得到了ping的响应。所以AdDress很好,DHCP也可以。这都是HTTP服务器故障,有什么建议吗?
以上来自于百度翻译 以下为原文 Got some more info on problem. Looks like PHY part and MAC driver runs fine, cause after turning on ICMPv4 Server I'm getting response to PING. So Adresses are fine and DHCP works OK. It's all HTTP server fault. Any suggestions? Attached Image(s) |
|
|
|
|
|
因此,如果该板在网络上生存和良好,地址也很好,HTTP有什么问题呢?你有没有尝试过一个已知的网页首先看看是否行得通?或者简单地与客户端套接字(不是浏览器)连接到服务器,让我们知道响应是什么。
以上来自于百度翻译 以下为原文 So, if the board if alive and well on the network and the addresses are fine, what is the problem with HTTP? Have you tried a known Web page first to see if that works OK? Or simply connect with a client socket (not a browser) to the server and let us know what the response is. |
|
|
|
|
|
是的,当然可以。我测试了app本身,效果很好。但只有当板的地址低于192.1680.254时,无论是手动设置还是从DHCP中获得。套接字连接也都失败,超时。
以上来自于百度翻译 以下为原文 Yes, sure. I tested app itself and it works great. But only if board has address lower then 192.168.0.254 No matter if it set manually or obtained from DHCP. Socket connection also failed, time out Attached Image(s) |
|
|
|
|
|
|
|
|
|
|
|
我对它所做的有一个共同的理解。但是,如果我有DHCP服务器,它能为我的板提供所有正确的参数,我真的应该关心它吗?我可以得到ping响应,这意味着网络部分工作正常,我说的对吗?所以问题是关于HTTP服务器。
以上来自于百度翻译 以下为原文 I have a common understanding of what it does. But again- should I really care about it if I have the DHCP server, which provides my board with all the right parameters? And I can get ping responds, that means that network part works right, am I right? So the problem is about http server. |
|
|
|
|
|
如果电路板工作正常,它有适当的IP地址,你可以ping它,等等,让我问:-你用什么HTTP模块为你的应用程序?你能给我们看一下你的Syras-CONFIG.H吗?
以上来自于百度翻译 以下为原文 If the board works fine, it has proper IP address and you can ping it, etc., let me ask: - what HTTP module do you use for your app? Can you show us a copy of your system_config.h? |
|
|
|
|
|
我使用的是由MPFS2压缩的WEB应用程序和NVM存储的正则HTTP服务器。在CuffyHyppApp.Apple中也有一些回调。请找到StimyConfig.h附件。最有线的东西是,如果我直接连接到PC,它工作的方式相同。为了最后阐明IP配置情况,我将举一个例子:PC Config:IP:192.165.0.Mase:255.255.255.0GW:192.16.0。10.板配置(静态IP,无DHCP)IP:195.165.255.0GW:192.165.0.10WorkSPC配置:IP:195.165.0GW:252.255.05.0GW:192.1680.10板配置(静态IP,无DHCP)IP:192.165.2.15Mase:255.255.255.0GW:192.1680.10不工作:(与DHCP相同,仅在给定地址时工作)“小于”192.1680.254,甚至192.1680.255使控制器无法达到。
以上来自于百度翻译 以下为原文 I'm using regular http server configured by harmony with web app compressed by MPFS2 and stored on NVM. There are also some callbacks in custom_http_app. Please find system_config.h attached. The most wired thing- is that event if I connect board directly to PC it works same way. To finally clarify IP configuration situation, I'll give an example: PC config: IP: 192.168.0.5 Mask: 255.255.255.0 GW: 192.168.0.10 Board config (static IP, no DHCP) IP: 192.168.0.15 Mask: 255.255.255.0 GW: 192.168.0.10 WORKS PC config: IP: 192.168.0.5 Mask: 255.255.255.0 GW: 192.168.0.10 Board config (static IP, no DHCP) IP: 192.168.2.15 Mask: 255.255.255.0 GW: 192.168.0.10 Does not work :( Same with DHCP, works only if given address is "less" than 192.168.0.254, even 192.168.0.255 makes controller unreachable. Attachment(s) system_config.h.txt (22.75 KB) - downloaded 87 times |
|
|
|
|
|
如果你的IP地址是192.1680.254,你的子网是255.255.255.0,那么它只会响应192.1680.xxx的IP地址,如果你想和192.1681.xxx交谈,那么你的子网掩码必须是255.255.0.0(或255.255.254.0)什么子网掩码是DHCP服务器给你的?
以上来自于百度翻译 以下为原文 If your IP address is 192.168.0.254 and your SubNet is 255.255.255.0 then it will only respond to IP address that are 192.168.0.XXX if you want to talk to 192.168.1.XXX then your Subnet mask Must be something like 255.255.0.0 (or 255.255.254.0) What Subnet Mask is the DHCP Server giving you? |
|
|
|
|
|
好的,明天我会试着戴口罩。不确定给定的子网,我不能用调试工具看到它,我只看到0.0.0.0,正如我之前提到的。我会问我们的系统管理员,并会回复。也许你是对的,这就是问题所在,但是所有的PC都在网络中由DHCP供电,所以我确信它是可以的,而且事件更奇怪——我可以ping它,但是不能访问HTTP服务器……
以上来自于百度翻译 以下为原文 Ok, I'll try to play a bit with mask tomorrow. Not sure about given subnet, I can't see it with debug tools, I only see 0.0.0.0 as I mentioned before. I'll ask our system administrator about it and will reply back. Maybe you right and that's the problem, but all PC's in network powered by DHCP, so I'm pretty sure that it's ok, and event more strange- that I can ping it but can not access http server... |
|
|
|
|
|
网关地址位于与主板地址不同的网络中。当然,这是行不通的。如果你想测试静态模式,至少在其中放置一个有效的网关地址。当然,你不想使用网关,但是栈可能仍然需要一个有效的地址。但是你说DHCP正在工作。请给出您从DHCP中得到的设置,这些设置应该是正确的。
以上来自于百度翻译 以下为原文 The gateway address is in a different network than the board address. Of course it won't work. Put a valid gateway address in there at least if you want to test the static mode. Maybe you don't want to use a gateway, sure, but the stack may still need a valid address. But you said that the DHCP is working. Please give the settings that you get from the DHCP, those should be correct. |
|
|
|
|
|
Runad,如果你设置了这个配置,这是和谐栈的行为[注意每个人:不要做下面的事情,这不是一个好主意。在发送数据包之前,它会丢掉吗?真的有路由表吗?网关地址位于与主板地址不同的网络中。当然,这是行不通的。如果你想测试静态模式,至少在其中放置一个有效的网关地址。当然,你不想使用网关,但是栈可能仍然需要一个有效的地址。但是你说DHCP正在工作。请给出您从DHCP中得到的设置,这些设置应该是正确的。
以上来自于百度翻译 以下为原文 rainad, whats the behavior of the harmony stack if you do set up this config [ note everyone: dont' do what is below its not a good idea. ] will it just drop the outbound packet before it gets sent? there is really a routing table is there? The gateway address is in a different network than the board address. Of course it won't work. Put a valid gateway address in there at least if you want to test the static mode. Maybe you don't want to use a gateway, sure, but the stack may still need a valid address. But you said that the DHCP is working. Please give the settings that you get from the DHCP, those should be correct. |
|
|
|
|
|
好的,我在我的本地安装上通过192.168164.4把PC地址设置成192.168164.15。这是可以的,你们是完全正确的。我也从IP板上得到IP,这是我们的系统管理员的错误……我会问并回复。
以上来自于百度翻译 以下为原文 Ok, I made it to work with 192.168.164.4 on my local setup by setting PC address to 192.168.164.15 It's ok, you guys were absolutely right. And I also got IP's from the board, here they are: IP: 192.168.164.4 Mask: 255.255.255.0 GW: 192.168.100.1 So it seems like our system administrator's fault... I'll ask and reply back. |
|
|
|
|
|
问题解决了…网络防火墙封锁端口80i很抱歉打扰你们,非常感谢你们!
以上来自于百度翻译 以下为原文 Problem solved... Network firewall blocked port 80 I'm so sorry about disturbing you guys, and thank you very much! |
|
|
|
|
|
KWS,当你开发IP解决方案时,你可能会做的一些事情对你确实有帮助;在你正在工作的机器上拥有一个二级网卡是非常有帮助的。把它放到以太网交换机上的“镜像”端口,并镜像设备的输入/输出数据(也连接到同一个交换机)。这让你看到所有的包进来/出去,使用WiReSARK…这可以帮你节省很多猜测工作。在你的情况下,你已经看到了DHCP包,看到他们不合适,排序了一些。
以上来自于百度翻译 以下为原文 Kaws, a few things that you might do that could really help you, when developing IP solutions; Its really helpful to have a secondary NIC in the machine that you are working on. Attch this to a 'mirror' port on an ethernet switch, and mirror the in/out data of the device ( also connected to the same switch ).. this lets you see all the packets coming in/out, use wireshark.. This can save you a LOT of guess work. In your case you coudl have seen the DHCP packets, seen that they were not appropriate and sorted somethign out. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 02:51 , Processed in 1.403604 second(s), Total 110, Slave 93 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
4938