📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Attention all domestic customers! Please place UPS Ground and USPS First Class & Priority orders by 11am ET Monday December 9, 2019 📬❄️📦 Attention all international customers! Please place all UPS WORLDWIDE EXPRESS; SAVER, and DHL EXPRESS WORLDWIDE orders by 11am ET Monday December 9, 2019 📬❄️📦
0

MQTT ERROR 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 ERROR rejected, only shared feeds may be published to

by jimk123 on Tue Oct 08, 2019 7:12 pm

try to follow the geofence guide here:
https://learn.adafruit.com/geofencing-w ... dafruit-io

in my code it defines the feed as:
const char LOCATION_FEED[] PROGMEM = AIO_USERNAME "/feeds/location/csv";
Adafruit_MQTT_Publish location_feed = Adafruit_MQTT_Publish(&mqtt, LOCATION_FEED)

it did not say anywhere in the guide to manually create the feed but I ended up creating one called 'location' after getting errors

in the serial window it says it successfully published the lat and lon values:
Publishing location: 0,41.898823,-72.676041,28.300001
Publish succeeded!

but when I look at https://io.adafruit.com under profile i see this error message pop up every 30 seconds ( I have a 30 second delay in the code):
MQTT ERROR: xxxxxxxxxxxxxxxxxx 172.58.238.198 PUBLISH ,,11,8,,,44,, OK -72.676067,29.200,0.17,269.1,1,,� rejected, only shared feeds may be published to

I have been using adafruit IO for a few weeks with some other boards publishing temp, humidity, etc but the feed name is always one value like 'temp' the one in the geofence code is called feeds/location/csv, not sure if I need to define something else in IO ?

jimk123
 
Posts: 195
Joined: Sun Dec 26, 2010 7:04 pm

Re: MQTT ERROR rejected, only shared feeds may be published

by jefish on Fri Nov 15, 2019 4:05 am

I'm having the same problem when running Adafruit's Treat Tracker project, but the mqtt_fona example works fine. Haven't yet figured out how they publish differently, but some tips from Adafruit would be welcome.

jefish
 
Posts: 44
Joined: Fri Sep 12, 2014 2:08 am

Re: MQTT ERROR rejected, only shared feeds may be published

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

The "only shared feeds may be published to" error message means IO didn't recognize the MQTT topic as being in the standard "{username}/{type}/{key}/{format}" pattern with "feeds" or "f" in the {type} slot and it didn't find the username you authenticated with in the {username} slot. For example, if I (abachman on IO) have a feed with the key "temperature", the topic I publish to would be "abachman/feeds/temperature/csv".

In the case of this example:
Code: Select all | TOGGLE FULL SIZE
const char LOCATION_FEED[] PROGMEM = AIO_USERNAME "/feeds/location/csv";
It may mean AIO_USERNAME is unset. It could also mean there's another publish event in the sketch that's using a different topic. Hard to tell without seeing source code.

Are you able to paste your sketch inside \[code\] tags with your IO key taken out?


- adam b.

abachman
 
Posts: 348
Joined: Mon Feb 01, 2010 12:48 pm

Re: MQTT ERROR rejected, only shared feeds may be published

by abachman on Mon Nov 18, 2019 11:51 am

Rereading the original error message, "PUBLISH ,,11,8,,,44,, OK -72.676067,29.200,0.17,269.1,1,,� rejected ..." means IO received ",,11,8,,,44,, OK -72.676067,29.200,0.17,269.1,1,,�" as the MQTT topic, which is not a valid MQTT topic.


- adam b

abachman
 
Posts: 348
Joined: Mon Feb 01, 2010 12:48 pm

Re: MQTT ERROR rejected, only shared feeds may be published

by jefish on Mon Nov 18, 2019 3:00 pm

For the treat tracker, I changed
Code: Select all | TOGGLE FULL SIZE
const char PATH_FEED[] PROGMEM = AIO_USERNAME "/feeds/" PATH_FEED_NAME "/csv";
Adafruit_MQTT_Publish path = Adafruit_MQTT_Publish(&mqtt, PATH_FEED);
const char GOOD_CANDY_FEED[] PROGMEM = AIO_USERNAME "/feeds/" GOOD_CANDY_FEED_NAME "/csv";
Adafruit_MQTT_Publish goodCandy = Adafruit_MQTT_Publish(&mqtt, GOOD_CANDY_FEED);


to
Code: Select all | TOGGLE FULL SIZE
Adafruit_MQTT_Publish path = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/treat-path/csv");
Adafruit_MQTT_Publish goodCandy = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/treat-good-candy/csv");

Essentially hardcoded the URL, which fixed my error.

Maybe you can adapt this to the geofence example.

jefish
 
Posts: 44
Joined: Fri Sep 12, 2014 2:08 am

Re: MQTT ERROR rejected, only shared feeds may be published

by brubell on Wed Nov 20, 2019 10:27 am

jefish,

Thanks for the update. I've patched the treat-tracker code.

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

Re: MQTT ERROR rejected, only shared feeds may be published

by jefish on Wed Nov 20, 2019 3:24 pm

Groovy.

Can you confirm that this change will also make the geofencing example work better for jimk123?

jefish
 
Posts: 44
Joined: Fri Sep 12, 2014 2:08 am

Re: MQTT ERROR rejected, only shared feeds may be published

by brubell on Tue Nov 26, 2019 11:24 am

jefish wrote:Groovy.

Can you confirm that this change will also make the geofencing example work better for jimk123?


It should - I don't currently have hardware to test it out.

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

Please be positive and constructive with your questions and comments.