🎁📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Please place all UPS 2 Day orders by 11am Monday, December 16 📦❄️📬🎁
0

MQTT PUBLISH rejected, only shared feeds may be published to
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

MQTT PUBLISH rejected, only shared feeds may be published to

by Psikic on Fri Nov 15, 2019 11:27 am

I'm getting the error message: "PUBLISH  rejected, only shared feeds may be published to" on every attempt to publish to new MQTT feeds created yesterday. I have set these feeds to public and it doesn't matter. AIO is completely unusable to me until this can be figured out. Please help!

My feed URLs seem to be fine, my AIO key and username are fine, however the feeds reject all publishes.

Psikic
 
Posts: 2
Joined: Thu Nov 14, 2019 5:10 pm

Re: MQTT PUBLISH rejected, only shared feeds may be publishe

by brubell on Mon Nov 18, 2019 11:40 am

Are you publishing to Adafruit IO with a different username than you authenticated with?

Could you post your code?

brubell
 
Posts: 649
Joined: Fri Jul 17, 2015 10:33 pm

Re: MQTT PUBLISH rejected, only shared feeds may be publishe

by Psikic on Mon Nov 18, 2019 11:46 am

brubell wrote:Are you publishing to Adafruit IO with a different username than you authenticated with?

Could you post your code?


I did find the problem over the weekend and I haven't yet had a chance to update this post until now. It was my fault, with me being in the managed code world for so long and having not written C++ in years, I made a stupid mistake. The c_str that represents the feed name being passed to the library's publish function was being returned from a different function, and since it is a pointer on the stack, it was no longer available and I was trying to publish to a garbage feed name. I was able to figure it out by enabling MQTT_DEBUG and seeing the packets being sent. It also made sense when I noticed sometimes the error message was "PUBLISH  rejected" and sometimes "PUBLISH [various garbage characters] rejected". Thanks!

Psikic
 
Posts: 2
Joined: Thu Nov 14, 2019 5:10 pm

Please be positive and constructive with your questions and comments.


cron