I have a virtual machine that is supposed to be the host, which can receive and send data. The first picture is the error that I'm getting on my main machine (from which I'm trying to send data from). The second picture is the mosquitto log on my virtual machine. Also I'm using the default config, which as far as I know can't cause these problems, at least from what I have seen from other examples. I have very little understanding on how all of this works, so any help is appreciated.
What I have tried on the host machine:
Disabling Windows defender
Adding firewall rules for "mosquitto.exe"
Installing mosquitto on a linux machine
Starting with the release of Mosquitto version 2.0.0 (you are running v2.0.2) the default config will only bind to localhost as a move to a more secure default posture.
If you want to be able to access the broker from other machines you will need to explicitly edit the config files to either add a new listener that binds to the external IP address (or 0.0.0.0) or add a bind entry for the default listener.
By default it will also only allow anonymous connections (without username/password) from localhost, to allow anonymous from remote add:
allow_anonymous true
More details can be found in the 2.0 release notes here
You have to run with
mosquitto -c mosquitto.conf
mosquitto.conf, which exists in the folder same with execution file exists (C:\Program Files\mosquitto etc.), have to include following line.
listener 1883 ip_address_of_the_machine(192.168.1.1 etc.)
By default, the Mosquitto broker will only accept connections from clients on the local machine (the server hosting the broker).
Therefore, a custom configuration needs to be used with your instance of Mosquitto in order to accept connections from remote clients.
On your Windows machine, run a text editor as administrator and paste the following text:
listener 1883
allow_anonymous true
This creates a listener on port 1883 and allows anonymous connections. By default the number of connections is infinite. Save the file to "C:\Program Files\Mosquitto" using a file name with the ".conf" extension such as "your_conf_file.conf".
Open a terminal window and navigate to the mosquitto directory. Run the following command:
mosquitto -v -c your_conf_file.conf
where
-c : specify the broker config file.
-v : verbose mode - enable all logging types. This overrides
any logging options given in the config file.
I found I had to add, not only bind_address ip_address but also had to set allow_anonymous true before devices could connect successfully to MQTT. Of course I understand that a better option would be to set user and password on each device. But that's a next step after everything actually works in the minimum configuration.
For those who use mosquitto with homebrew on Mac.
Adding these two lines to /opt/homebrew/Cellar/mosquitto/2.0.15/etc/mosquitto/mosquitto.conf fixed my issue.
allow_anonymous true
listener 1883
you can run it with the included 'no-auth' config file like so:
mosquitto -c /mosquitto-no-auth.conf
I had the same problem while running it inside docker container (generated with docker-compose).
In docker-compose.yml file this is done with:
command: mosquitto -c /mosquitto-no-auth.conf
When I try to open a websocket connection to my FastAPI server, Uvicorn returns following error after I have updated it from version 0.13.4 (with this version I had no problems) to 0.15.0:
Error in opening handshake
...
websockets.legacy.handshake.check_request(headers)
AttributeError: module 'websockets' has no attribute 'legacy'
Does anyone know what this error exactly means and how to solve it?
when you update the version of unicorn then you need to update the version of websockets
in my case I upgrade unicorn 0.13.4 to 0.14.0 and in the websockets version was 8.1 so I change this 8.1 to 10.0 and it's work
check here for info
I have problem with using Websocket on MQTT by Mosquitto.
I'm using raspberry pi as a broker, and want to publish some information, subscribe on web.
Former method (in 1.4.10 version etc.) is to add those two lines
====================
listener 9001
protocol websockets
====================
in /etc/mosquitto/mosquitto.conf or /etc/mosquitto/conf.d/(certain .conf file)
and modify allowance about Websocket in config.mk to [yes]
but in 1.6.10 version, perticularly in raspberrypi, I can't find
the config.mk file so it doesn't works.
Can anybody tell me where's config.mk or if there's any other method to use Websocket on rasp.pi?
I have torquebox installed in my jruby on Rails application. And I am experimenting with using stomp + websockets. But I can't tell if the websocket server is even running? I am booting up torquebox in my console with: sudo torquebox run --clustered -b my.ip.address
I keep going through the output from torquebox booting up and the only relevant output I am seeing is this:
[org.torquebox.stomp.as] Initializing TorqueBox STOMP Subsystem
and
[org.projectodd.polyglot.stomp.as] Initializing Polyglot STOMP Subsystem
I don't see anything referencing port 8675, which according to the docs is the port it is supposed to run on. I tried telnet as well and received a 'connection refused' message.
Any help or references would be great. Thanks
Apologies for the dumb question. I just had a typo in my torquebox.yml file. I can now see the output in the bootup that specifies the websocket server is up and I can successfully telnet in.
I am trying to connect to my rabbitmq server.
I am using
require 'carrot'
#client = Carrot.new(:host => 10.xx.xx.xx, :port => 5672)
q = #client.queue("my_queue")
I am getting this error
"#<Carrot::AMQP::Server::ServerDown: Connection reset by peer>"
How do I check if my server is down? and how do I restart it?
rabbitmq-server
Can you help us to help you with some additional info?
What version of Ruby?
What version of RabbitMQ?
Where is your RabbitMQ broker running?
Do you have any kind of firewall preventing you from connecting to the RabbitMQ broker port?
Do you know whetherany security is enabled?
If you have access to the command line of the server where the broker is running, you should be able to see an Erlang process if you execute ps -ef | grep rabbitmq
To start the broker, run
rabbitmq-server
I am able to run your code OK against RabbitMQ 3.0.1 running on my local machine with latest Ruby and Carrot gem, the only correction was that the host IP address needed to be enclosed in double quotes.