How to Configure and Connect to Cumulocity IoT in Rasbery Pi?

If you installed thin-edge.io using the install script (as detailed in the getting started instructions), then it would have installed the mosquitto Debian package which runs the mosquitto broker as a service under the service manager (systemd, part of the operating systemd).

From your previous screenshot showing the mosquitto log output, it showed that you were starting mosquitto manually and not using the system service, because the screenshot showed you were calling mosquitto from the command line…this is not correct.

Also, you can’t have two mosquitto brokers running either as this can cause problem.

So I would try the following:

  1. Stop your manually started mosquitto broker

  2. Start the mosquitto service using:

    sudo systemctl stop mosquitto
    sudo systemctl enable mosquitto
    sudo systemctl start mosquitto
    

    Check that the mosquitto systemd service is actually running afterwards using:

    sudo systemctl status mosquitto
    

    If there are any errors shown (or the service is not running), then you will have to consult the mosquitto documentation or their project page. But just doing a google search of your mosquitto specific error should be enough to find some relevant information.

  3. Installing additional mosquitto clients (this installs the mosquitto_sub and mosquitto_pub cli commands)

    sudo apt-get update
    sudo apt-get install -y mosquitto-clients
    
  4. Try publishing to the broker (just to check that the broker is running)…the message could be anything, but you shouldn’t see any errors when running the command.

    mosquitto_pub -t 'dummy/topic' -m ''
    
  5. Then try to reconnect the thin-edge.io mapper.

    sudo tedge disconnect c8y
    sudo tedge connect c8y
    

If this still does not work, then you need to provide some more information about your setup, as all systems are not the same, so without knowing more specifics then it is a bit difficult to assist.

  • What hardware are you using (Raspberry Pi 3/4 ?)
  • What operating system version are you using: cat /etc/os*
  • What system architecture are you using: uname -a
  • What version of thin-edge.io are you using: tedge --version

Though I suspect if you still feel out of depth, then maybe a more hands on meeting would be appropriate, however this would depend on support contracts etc.

1 Like