[SOLVED] PublishQueueAsyncRK using v6.4

Hello,

I am looking to use the PublishQueueAsyncRK library with v6.4
Our devices in the field have a hardware watchdog timer which prevents updating firmware updating

Also note: This library requires system firmware 0.7.0 or later. The publish flags were different in 0.6.x, and this library doesn't support the old method.

I was curious what is required to make this library work for v6.4?

Thanks!

Based on @rickkas7's comments, it may be as easy as editing this line to use the older Particle.publish flags:

bool bResult = Particle.publish(eventName, eventData, data->ttl, flags);
1 Like

Oh nice,
Thank you @ninjatill ! Where could I find more information about editing that line to use the older version of the flags?
The only difference I see from the documentation is that 7.0 and later allows you to use

Since 0.7.0 Particle.publish() flags can be combined using a regular syntax with OR operator (|).

Is there something else I should add to your statement of "bResult" to make it v6.4 compatible?

I can’t answer that for sure without a deeper dive into the code. In the statement I copied, I was simply looking at the “flags” variable and figured you could hard-code the flags or something. However, now that I’m thinking of it, when you call the asyncqueue.publish(), you have to provide the flags in that call… So you might need to modify the .publish method parameters as well. Better let @rickkas7 be the authority on this one.

I’m pretty sure the flags are the only problem, but you’d have to try it and see. I didn’t want to have to deal with the difference and flags and testing on 0.6.x so I didn’t support it, but there’s really no reason it shouldn’t work once you get it to compile by changing the flags.

Hi @rickkas7 @ninjatill thanks for the advice! Being able to run on 6.4 would be tremendous!

For making that work I could use your help as I am not understanding what “update the flags variable” means.

I was checking the reference and don’t see what that means.

Could you clarify where to find more information on this? I appreciate your help, I feel like I am missing something obvious in terminology, which is keeping me from understanding the concept.

Thanks!

When trying to compile example 1 from the PubishQueueAsyncRK example in v6.4 I get many error when compiling of

4%20error

I think its related to this line in PublishQueueAsyncRK.cpp (line 232)

	PublishFlags flags(PublishFlag(data->flags));

Is there something specific about v7.0 and later that recognizes PublishFlag() as a function?

Turns out it’s actually more of a pain than I remembered to make it work. I don’t want to do it with #ifdefs because it makes the code horribly unwieldy. I might make a fork of it just for 0.6.x.

1 Like

Wow! Thank you @rickkas7! That would be a huge help to our project. That fork would be exactly what we need. Please let us know how we can assist.

There’s now a fork of the library that support 0.6.x. It’s here:

I didn’t publish a Particle community library because it would have replaced the 0.7.x one, and I didn’t want to create an entirely separate library. So you’ll just need to copy the PublishQueueAsyncRK.cpp and .h files into your project directly.

1 Like

Thank you @rickkas7 !

This fork is working with our 0.6.4 code.

Thank you very much for your support!

1 Like