element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
In the Air Design Challenge
  • Challenges & Projects
  • Design Challenges
  • In the Air Design Challenge
  • More
  • Cancel
In the Air Design Challenge
Forum Subscription to AirVantage MQTT topic
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 20 replies
  • Answers 2 answers
  • Subscribers 5 subscribers
  • Views 2686 views
  • Users 0 members are here
  • airvantage
  • in_the_air
Related

Subscription to AirVantage MQTT topic

tomaja
tomaja over 10 years ago

Hello people!

 

I'm having difficulties with MQTT.

Did anyone manage to "subscribe" to AirVantage MQTT server?

I never used a MQTT so I'm getting some difficulties when I try to get notifications when new data is published to AirVantage. Maybe I'm missing the point here? Should I get the updated values if I subscribe to some topic?

I call subscribe with MQTTLens or Paho test client but nothing happens after I publish new data (subscription to <SERIAL>/tasks/json appears to be successful). And I'm sure data is being published because I can see new values on Monitor -> Systems page in AirVantage control panel.

 

Hope someone can help.

Dragan

  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 10 years ago in reply to tomaja +1 suggested
    No, the REST API to access AirVantage is decoupled from the device protocols: you can send data to the Cloud with MQTT or REST, to access the data you must use REST.
  • fvan
    0 fvan over 10 years ago

    Hi Dragan,

     

    I hope to be able to send some MQTT data to AirVantage this weekend. Will update you once I figure it out image

     

    Frederick

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • amgalbu
    0 amgalbu over 10 years ago

    Hi Dragan

    Which pattern do you use to subscribe? Try with '#' only just to be sure that you are subscribed to everything and see what happens

     

    Ambrogio

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tomaja
    0 tomaja over 10 years ago in reply to fvan

    OK, thanks.

    For me, sending data is not a problem, the problem is notifying remote clients when new data is published.

    I will post a solution as soon as I resolve it.

     

    Dragan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tomaja
    0 tomaja over 10 years ago in reply to amgalbu

    Thanks Ambrogio!

     

    I was trying to subscribe to <SERIAL>/tasks/json and that does not work (subscription is successful but callbacks are never being called). Apparently, that topic is used to issue commands to clients.

    I also tried to subscribe to <SERIAL>/messages/json (the same topic that I publish data to) but that subscription fails.

     

    Do you think I should try subscribing to "<SERIAL>/tasks/json/#" of just "#"?

     

    Dragan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • amgalbu
    0 amgalbu over 10 years ago in reply to tomaja

    I would subscribe to just '#', publish a message and see the topic received in the notification

     

    Ambrogio

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tomaja
    0 tomaja over 10 years ago in reply to amgalbu

    I tried with just "#" but still got no result.

    Also tried with <SERIAL>/# but again, no message was received.

    I must have done something wrong during the AirVantage setup...

     

    Dragan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to tomaja

    AirVantage MQTT is not acting as MQTT broker.

     

    The first topic messages/json  to send data  (<SERIAL>/messages/json)

    the data are sent in the payload in json like this: { "machine.temperature": 23.2, "machine.humidity": 70 }

     

    If you want to receive data from AirVantage, you can subscribe to the second topic <SERIAL>/tasks/json.

     

    Didier

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tomaja
    0 tomaja over 10 years ago in reply to Former Member

    Thanks! I'm pretty sure I tried that but I'll check again and let you know the result.

     

    Dragan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • tomaja
    0 tomaja over 10 years ago in reply to Former Member

    Here's what I tried (serial is blurred but it's always the same):

    image

     

    Values are being properly published, I see it when I use the AirVantage monitor.

     

    Am I doing something wrong here?

     

    Thanks,

    Dragan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to tomaja

    what are you trying to achieve?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube