Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    MQTT library conflict with pybytes

    Scheduled Pinned Locked Moved Support & Troubleshooting
    5 Posts 3 Posters 96 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L Offline
      Laurens van Raay
      last edited by

      Re: Pybytes: MQTT ERROR! function got multiple values for argument 'user'

      Any updates on the MQTT error?
      Seems to be a conflict between the use of pybytes and the MQTT library.

      1 Reply Last reply Reply Quote 0
      • L Offline
        Laurens van Raay
        last edited by

        If anyone else has the same problem, here is a solution.

        Problem:
        Pybytes does not start when the mqtt.py library is installed on the device.
        The device throws the following error during boot:

        WiFi connection established
        MQTT Protocol
        MQTT ERROR! function got multiple values for argument 'user'
        ERROR! Could not connect to Pybytes!
        Pybytes configuration read from /flash/pybytes_config.json
        

        This occurs during boot, so even if main.py and boot.py on the device are empty files. Probably pybytes is using the MQTTClient class in the mqtt library in the lib folder when it shouldn't.

        Rename the class in mqtt.py:

        class MQTTClient_lib:
        

        Rewrite your code for the name change or use an alias where the library is included to keep the source unmodified:

        from mqtt import MQTTClient_lib as MQTTClient
        

        This solved the issue for me.

        1 Reply Last reply Reply Quote 3
        • G Offline
          Gijs
          last edited by

          Hi,
          I really like your solution,
          If it is okay with you, I'll post it to the docs!

          Gijs

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            Laurens van Raay @Gijs
            last edited by

            @Gijs
            Hi Gijs,
            Sure, that's okay with me.

            1 Reply Last reply Reply Quote 0
            • C Offline
              Clyde Bess
              last edited by

              I will also give this a try thanks for sharing!
              I am new to python and micopython, if stuck in such a problem for days...
              I changed firmwares over and over. Even got me an Windows PC (Mac User..)

              Again - thanks for sharing :)

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom