Dear All,

Firt...let me thank you guys working very hard with all these Ardu-things (ArduPilot, ArduCopter, APM, ...). Very nice and I love it!

I have bought a set of APC220 RF sender/receivers for using as telemtry link for my ArduCopter. I could not connect with the APM Mission Planner...got a time-out for "no heartbeat sent". It did however work with HK GCS and QGroundStation so I started to dig into why it did not work with APM. Luckily, the code is available and hence I have now managed to get it to work.

The APC220 requires the RTS and DTR to be false at all times as no handshaking can be used. I also found that the version of ArduCopter (2.4.1) that I have does not send heartbeats on the telemetry port...have I set something up badly here?

To get this to work you can edit the code to change how the OpenBg() is executed in the MavLink.cs according to:

lock (objlock) // so we dont have random traffic

{
log.Info("Open port with " + BaseStream.PortName + " " + BaseStream.BaudRate);

if (useAPC220)
{
// No RTS/DTR at all for this one...
BaseStream.RtsEnable = false;
BaseStream.DtrEnable = false;

BaseStream.Open();

BaseStream.DiscardInBuffer();
}
else
{
BaseStream.Open();

BaseStream.DiscardInBuffer();

BaseStream.toggleDTR();
}

Thread.Sleep(1000);
}

I added a small "useAPC220" propery that I set to "true".

I also added/changed a setting where the code expects the heartbeats to come:

if (useAPC220)
{
// No hearbeats coming from my 2.4.1 FW using APC220...why?
// firmware issue?
sysid = 1;
compid = 1;
mavlinkversion = 2;
aptype = 2;
break;
}
else
{
// incase we are in setup mode
BaseStream.WriteLine("planner\rgcs\r");

buffer = getHeartBeat();

// incase we are in setup mode
BaseStream.WriteLine("planner\rgcs\r");

System.Threading.Thread.Sleep(1);

buffer1 = getHeartBeat();
}

So, I hardcoded some values (version, id's etc) that is coming from the heartbeat package normally.

Anyhow, this is a rather bad approach (but quick and dirty and works for my special case). So, now I wonder if it would be possible to add a few settings in the APM Mission Planner to handle this? Maybe one can have a setting for "use handshake" and one for "expect heartbeat". This would make the APM to be compatible with the APC220 as well.

Well...that was what I had in mind. Thanx once again for your hard work!

/Stefan

Views: 4699

Reply to This

Replies to This Discussion

what happens if you mode toggledtr() and add

BaseStream.RtsEnable = false; BaseStream.DtrEnable = false;

at the end of the function?

Hi there,

That works (as regards to RTS) also. I did avoid that because I thought the normal USB Virtual COM required RTS enabled. However, I just tested and it seems like it is working anyhow. I am not deep into the process of how that port is used for FW loading etc, hence I did a small hack to be able to easy change back.

However, the hack to stop waiting for heartbeats is still required as there are no HB coming on Serial3 in my ArduCopter 2.4.1. Do I need to configure this in any way?

Regards

Stefan

what i will end up doing i removing the toggle dtr in mavlink.cs as its not needed there anyway.

Just wanted to say that I have the same problem, also using APC220, ACM firmware 94c14cef91ab and mission planner .50 .  Cannot connect to mission planner due to no heartbeat packets received.

I used to be able to connect just fine with older versions.

Just to tie these together the problem is reported here as an issue.

Glad I'm not alone.

Ahhh...missed that. Should have reported there. Anyhow, at least we know how it can be solved. Remove the RTS handshake and look into why the fw does not send hb packets, or as I did to get it to work, remove the waiting for hb packets.

So if Michael reoves the rts setting, we still need to solve the hb in some way. Let me know if I can assit in any way.

Thank you for your input, without which it may have been a long time before this was resolved. Which file are you changing? There's no mavlink.cs in my download of MP v1.1.50.

I am downloading the source code (from the GIT repo) and compiling it. In the distribution only the compiled files (exe/dll's etc) are included. So, to test you need to re-compile the APM using Visual Studio etc.

aha, thanks, unfortunately for me a bit above my level of expertise...

Sorry for the OT, but I wanted to get wo of these modules from time ... are well enough? But do not come up to 19200 baud? Enough?

I am running them on 57600 (serial port rate) and 19200 (rf rate). The protocol is using around 7-10% of bandwidth when testing in HK GCS. If this enough...I have no idea as I have not actually flown by GCS, just using as telemetry a alittle. It seems OK at least.

I've tested Stefan's fix and it works fine on APM1. So far APM2 doesn't connect with the error below.

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service