Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mosquitto » How to send a variable with Mosquitto(Send the date with Mosquitto to another BeagleBone)
How to send a variable with Mosquitto [message #1794704] Wed, 05 September 2018 09:24 Go to next message
Daniel Usselmann is currently offline Daniel UsselmannFriend
Messages: 1
Registered: September 2018
Junior Member
I try to publish a message from a beaglebone black to another via mosquitto. I wrote a script that should send the date to the other beaglebone. The script is accessed with a crontab.

#!/bin/bash
d=$(date)
mosquitto_pub -t test -m $d
Re: How to send a variable with Mosquitto [message #1796401 is a reply to message #1794704] Fri, 12 October 2018 12:22 Go to previous message
Matthew Wawrzyniec is currently offline Matthew WawrzyniecFriend
Messages: 4
Registered: October 2018
Junior Member
Daniel Usselmann wrote on Wed, 05 September 2018 09:24
I try to publish a message from a beaglebone black to another via mosquitto. I wrote a script that should send the date to the other beaglebone. The script is accessed with a crontab.

#!/bin/bash
d=$(date)
mosquitto_pub -t test -m $d



Did you subscribe to the message on the other machine? And it may not be necessary but you may want to include the host in you script: mosquitto_pub -h 192.168.1.1 -t test -m $d

The easiest way to check the connection is to open a terminal on both machines
On the first machine run:
mosquitto_sub -h 192.168.1.1 -t test

On the send machine run:
mosquitto_pub -h 192.168.1.1 -t test -m "hello other beaglebone"

just make sure you're replacing the ip with the ip of your mqtt server
Previous Topic:Create message protocol for Wireless Push Notification transmitter
Next Topic:Mark all messages as retained
Goto Forum:
  


Current Time: Thu Apr 25 04:50:16 GMT 2024

Powered by FUDForum. Page generated in 0.02510 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top