Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT over QUIC #1

Closed
sohanpatil1 opened this issue Oct 26, 2022 · 15 comments
Closed

MQTT over QUIC #1

sohanpatil1 opened this issue Oct 26, 2022 · 15 comments

Comments

@sohanpatil1
Copy link

sohanpatil1 commented Oct 26, 2022

Hello,

I am trying to send payload from a publisher to a subscriber implemented in python. How do I set it up such that it works with MQTT over QUIC? The README says it is capable of running with EMQX v5.

I have access to macOS M1 and Ubuntu 22.04 and I am open to working on either depending on what you recommend for this package.

Anything helps,
Thanks

@wanghaEMQ
Copy link
Owner

Yes! It works with EMQX v5.x!
I will update the readme and provide a simple tutorial about installation and its requirement later.

@wanghaEMQ
Copy link
Owner

You may need to modify the MQTT server address in examples/mqttpub.py and examples/mqttsub.py. And the msgs sent or received are on QUIC protocol by default.

@sohanpatil1
Copy link
Author

sohanpatil1 commented Oct 27, 2022

Thanks for the quick response and offering the instructions for setting it up.
I had two concerns,

  • mkdir -f build is one of the commands for installing msquic to the system. Is this correct? What should it be instead?
  • When I try pip3 install -e . in the pynng-mqqt directory, I see this error
    GithubIssue
  • When I tried sudo apt install libssl, Linux was unable to locate package libssl. I added libssl3 instead. Please let me know if this needs to be corrected

How do I fix this? I searched online but couldn't figure it out.
Thanks,
Sohan

@wanghaEMQ
Copy link
Owner

mkdir -f build is one of the commands for installing msquic to the system. Is this correct? What should it be instead?

I am sorry for my mistake. The command should be mkdir -p build.

When I try pip3 install -e . in the pynng-mqqt directory, I see this error

Maybe a version mismatch happened on cffi. cffi-1.15.1 is requires. But only cffi-1.15.0 be found on your system.

When I tried sudo apt install libssl, Linux was unable to locate package libssl. I added libssl3 instead. Please let me know if this needs to be corrected

Is there are libssl-dev package found?

@sohanpatil1
Copy link
Author

sohanpatil1 commented Oct 28, 2022

I checked my cffi installation version, it is 1.15.1. I checked it with 'pip show cffi'.
Yes there is a libssl-dev package and I have added it. However, still getting the same error.
image

I am using python 3.10.6

@wanghaEMQ
Copy link
Owner

Try to downgrade cffi to 1.15.0

sudo pip3 install cffi==1.15.0

Better if you remove it first

@sohanpatil1
Copy link
Author

sohanpatil1 commented Nov 1, 2022

I downgraded cffi to 1.15.0. I am following this website for assistance.
I ran these commands to make it work. I used sudo when I realized there were permission issues. However I am still stuck.
image

I have printed my console below:

image
image

@wanghaEMQ
Copy link
Owner

Your local installation (/home/ubuntu/.local/lib/python3.10/...) failed. When you try to run the mqttsub.py.
It finds the pynng in your local installation first. But not your global success one (/usr/local/lib/python3.10/...).

Perhaps you could run with sudo. Or remove the local failed one. :)

@sohanpatil1
Copy link
Author

sohanpatil1 commented Nov 1, 2022

I believe I have safely removed the local one. When I run the 2 python files (mqttsub.py and mqttpub.py), they both stop at async-await on line 22/24 and no connection message is sent. I have reviewed the files to see where the issue maybe, but no luck. Is it because of the mqtt server address?
Any help would be greatly appreciated!

EDIT : I searched on EMQX's website and I noticed "mqtt-quic:127.0.0.1:14567" for QUIC and looks like it is correct. What's causing the issue?

@wanghaEMQ
Copy link
Owner

Did you forget to start your emqx broker? or the option in the configuration which enables QUIC?
You could check if there are any processes listening 14567

sudo lsof -i:14567

@sohanpatil1
Copy link
Author

sohanpatil1 commented Nov 3, 2022

Yes you were right. I did not have EMQX installed on the Ubuntu22.04 instance.
I am now working on Ubuntu 20.04. All my progress so far was for the 22.04 installation. My question now, is for the new installation on Ubuntu 20.04

On running 'pip install -e .' I get a response that says pynng is successfully installed. However I don't see it in pip list or pip list --user.
This is my pip list
image

@wanghaEMQ
Copy link
Owner

Plz also show yoursudo pip list

@sohanpatil1
Copy link
Author

image

@wanghaEMQ
Copy link
Owner

Do you want to import pynng to your project?

pip install -e . will install pynng in an editable mode (something like debug mode).
If you want to install pynng to your ubuntu20.04 instance and import it to your project.
pip install . should works. Then you can find it in pip list.

@sohanpatil1
Copy link
Author

Thanks! It worked, and I am able to use it as expected for Ubuntu20.04!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants