Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Arduino + USB + Raspberry + MQTT

Arduino + USB + Raspberry + MQTT

Scheduled Pinned Locked Moved General Discussion
usb
4 Posts 3 Posters 52 Views 3 Watching
  • 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.
  • J Offline
    J Offline
    jaraics
    wrote on last edited by
    #1

    Short version:

    I need to connect two arduinos to a raspberry pi, over USB, and than have the raspberry act as a gateway over MQTT.
    How can I do this? How can I connect the arduinos to the raspberry over USB? I could not find any option for the nodes to communicate with the gateway over USB.

    (diagram of what I need to accomplish)
    HomeAssistant <-MQTT-> Raspberry <- USB -> 2x Arduino <-GPIO> Switch

    Long version:
    I'm building a new house, and have every light switch wired to a central location (they are low voltage swithces, connected to the controller of the house, and I have separate controls that actually control the lights). Now there are more switches than GPIO pins on a raspberry, and I'm using two arduinos to connect all the switches.
    I'm running HomeAssistant on a raspberry pi, and I'll be using that to keep track of the switch states, and turn on/off lights accordingly.
    I thought I could use MySensors to read the GPIO pins on the arduino, and send updates to the raspberry, that would in turn publish those to an MQTT broker. But I can't seem to find any example that uses USB communication between an arduino node and a raspberry gateway.

    Can someone help me?
    Thanks!

    V 1 Reply Last reply
    0
    • J jaraics

      Short version:

      I need to connect two arduinos to a raspberry pi, over USB, and than have the raspberry act as a gateway over MQTT.
      How can I do this? How can I connect the arduinos to the raspberry over USB? I could not find any option for the nodes to communicate with the gateway over USB.

      (diagram of what I need to accomplish)
      HomeAssistant <-MQTT-> Raspberry <- USB -> 2x Arduino <-GPIO> Switch

      Long version:
      I'm building a new house, and have every light switch wired to a central location (they are low voltage swithces, connected to the controller of the house, and I have separate controls that actually control the lights). Now there are more switches than GPIO pins on a raspberry, and I'm using two arduinos to connect all the switches.
      I'm running HomeAssistant on a raspberry pi, and I'll be using that to keep track of the switch states, and turn on/off lights accordingly.
      I thought I could use MySensors to read the GPIO pins on the arduino, and send updates to the raspberry, that would in turn publish those to an MQTT broker. But I can't seem to find any example that uses USB communication between an arduino node and a raspberry gateway.

      Can someone help me?
      Thanks!

      V Offline
      V Offline
      virtualmkr
      wrote on last edited by
      #2

      @jaraics MySensors supports multiple communication physics between the MySensors Gateway and the node Arduinos. Best supported are the wireless ones, but you can also use wires with RS485 (two wire) or the new added PJON driver which only needs one wire (plus ground).
      One other option is to use only one Arduino with many IO pins like the Arduino Mega as a gateway arduino-mega-2560-rev3. This board has 54 IO pins. There are also cheap China clones available.

      One issue for this way: I have never tried to use the Arduino Mega by myself.
      Maybe someone else can give feedback to tell if a Mega will work as a gateway?

      1 Reply Last reply
      0
      • OldSurferDudeO Offline
        OldSurferDudeO Offline
        OldSurferDude
        wrote on last edited by OldSurferDude
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • OldSurferDudeO Offline
          OldSurferDudeO Offline
          OldSurferDude
          wrote on last edited by
          #4

          I've been using processing.org to capture data from Arduinos. I haven't tried with an RPi yet, but the link here is dedicated to just that.

          Processing is more geared for doing really fancy graphics, but its ability to capture data and put it to a file is great, and, of course, send data to the Arduino.

          I am inexperienced in interprocess communication, but, apparently processing can put the data out to MQTT check this link

          Let me know how that works out for you!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          19

          Online

          11.7k

          Users

          11.2k

          Topics

          113.1k

          Posts


          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • MySensors
          • OpenHardware.io
          • Categories
          • Recent
          • Tags
          • Popular