I've spent the majority of my Saturday trying to get my APM to control a plane in X-plane. I first set everything up according to the instructions from the manual. All seemed to go fine. I got into X-plane and control surfaces all moved, just needed to be reversed. Got distracted by something and left my desk. Came back, went to check my email and internet connection was gone, but my main wireless network adapter was still connected to my router. So, looked at network adapters to see what was going on, found the MS Virtual Miniport Adapter, a couple of wirless networks not in use, deleted them, rebooted and got my internet connection back. Went to try X-plan sim again and bam, no control surface movement.
So, that is where I'm still at now. No control surface movement. I can see that there is output from my APM, I've got the sim firmware loaded on my APM, MAVlink connection is fine, ports are set at 45000 and 45005 respectively; ip address set to 127.0.0.1. One thing that happens often is if I stop the SIM link and try to restart it again I get this error message:
"Socket setup problem. Do you have this open already? System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Bind(EndPoint localEP) at ArdupilotMega.GCSViews.Simulation.SetupUDPRecv() at ArdupilotMega.GCSViews.Simulation.ConnectComPort_Click(Object sender, EventArgs e)11:18:22 NO SIM data - 2011:18:22 NO SIM data - 2011:18:22 NO SIM data - 20"
Then I change the port numbers and the SIM link will successfully connect again, but can't move any control surfaces. My guess is that it's a network issue, but I'm not sure what the correct network setup should be regarding the MS Virtual WiFi Miniport adapter, if that's even part of the issue. I've looked around quite a bit on the forums and haven't found a similar problem. Most of the time when it's a control surface issue, not moving, it's because the person didn't have the correct ports set. In my case I do have the correct ports set.
I'm on com3, baud rate 115200. I've tested this out with APM Mission Planner versions .66, .86, and the most recent version 1.0.87. It won't work with any of them. So, I'm thinking it has to either be an issue with X-plane or something to do with the ports on my pc or virtual networking or something. Any help with this issue would be much appreciated.
Here is a video of the issue:
reboot your pc and try again
Yes, I've already rebooted at least 4 or 5 times. Also reset the APM after making changes.
try checking your firewall.
I'm sorry, I didn't say anything about that. I did disable my firewall as well and checked to make sure the exceptions were set for x-plane and ardupilot.
I'm going to try this out on my other computer and see what happens. Fresh installs of everything. Will update you on my results.
Ok, just tried it out on a different computer with fresh installs of everything. Interesting results. After I uploaded the firmware for the SIM to my APM and ran x-plane with it I was able to move the control surfaces and get throttle control. Did a little flying in manual mode, but couldn't trim anything out and the plane went crazy. At that point I realized that I hadn't uploaded the param file for xplane_pt_60. So, I loaded that and bam, lost throttle control. So, after that I stopped the sim link and wrote params to mission planner. Then restarted x-plane and tried to connect. Couldn't connect because it said existing connection. So, rebooted system. Still no luck. So, tried different ports 49001 and 49006. Connected, but no control surfaces moved and no throttle. Now it's the same situation on both computers.
It seems to me that the issue is somehow related to the pt_60 parameters. This is my first experience with this stuff, so I could be doing something wrong.
One other thing that I had noticed while testing this on a different PC was that when I got in to the network config window of x-plane I saw that it was communicating with 127.0.0.1 and it was printing some data. After changing parameters in mission planner I never saw that again.
Ok!!! finally got this thing to work. I reinstalled x-plane and it works now. It's an x-plane issue. It doesn't disconnect or end the port connection on my pc after the app is shut down, so it continues to think there's another instance of it running when there really isn't. For whatever reason, reinstalling it worked. I just deleted the installation folder and ran the setup exe again. Can now fly in sim mode. Hooray! Only took me 16 hours to figure it out.
Thanks for trying to help me, Michael. This problem didn't seem to be one that anyone else had.
I am also having this problem.. I will reinstall x-plane to see if it works for me.
I had same problem. I think sendmsgjohn is correct: xplane (and/or APM) were thinking there was already a port connection. After re-installing xplane, started it up and worked fine. The permanent fix: when finished for the session, click "Sim link start/stop" to STOP the sim link. This closes the port!!!!!