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. Troubleshooting
  3. Beginner concept question for serial communication

Beginner concept question for serial communication

Scheduled Pinned Locked Moved Troubleshooting
4 Posts 3 Posters 57 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.
  • H Offline
    H Offline
    hubertus
    wrote on last edited by
    #1

    Hello,

    I am a complete beginner. I want to integrate a 3 probe temperature arduino (one-wire) with displays into my home assistant setup (on a pi 0).

    The arduino nano clone has 3 Dallas temperature probes connected with onewire, and a Serial adapter on pins 00 and 1. The serial port is connected to a Moxa Nport serial server for the local LAN.

    My idea was to have a mysensors gateway on a Raspberry Pi 1b which connects to the virtual serial port (Nport) to exchange with the arduino. The gateway would further connect to the home assistant controller on the pi0. I also plan to make a node-red connection to influxDB and grafana.

    Most exemples are for radio communication, which I would not use for the moment (extension possible in the future).

    Is this a reasonable approach ? For the moment I cannot figure out the sketch for the arduino with serial only communication. I compiled the mysensors gateway on the pi1b as ethernet and configured also the serialport. It fails to initiate as there is no node active yet.

    Thank you for your help,

    Hubertus

    OldSurferDudeO 1 Reply Last reply
    0
    • H hubertus

      Hello,

      I am a complete beginner. I want to integrate a 3 probe temperature arduino (one-wire) with displays into my home assistant setup (on a pi 0).

      The arduino nano clone has 3 Dallas temperature probes connected with onewire, and a Serial adapter on pins 00 and 1. The serial port is connected to a Moxa Nport serial server for the local LAN.

      My idea was to have a mysensors gateway on a Raspberry Pi 1b which connects to the virtual serial port (Nport) to exchange with the arduino. The gateway would further connect to the home assistant controller on the pi0. I also plan to make a node-red connection to influxDB and grafana.

      Most exemples are for radio communication, which I would not use for the moment (extension possible in the future).

      Is this a reasonable approach ? For the moment I cannot figure out the sketch for the arduino with serial only communication. I compiled the mysensors gateway on the pi1b as ethernet and configured also the serialport. It fails to initiate as there is no node active yet.

      Thank you for your help,

      Hubertus

      OldSurferDudeO Offline
      OldSurferDudeO Offline
      OldSurferDude
      wrote on last edited by
      #2

      @hubertus I'm not getting the description of you setup. Perhaps a sketch would be good?

      Wen I need serial communication, with the Arduino, I use SoftwareSerial on two other I/O lines. That way I can debug real time, SoftwareSerial is slower but you're only doing temperature so 9600BAUD would be fin

      Also, don't try to do too much at once. Break the task down into small, manageable sections. You have a lot of different things going on, get one thing going at a time.

      OSD

      1 Reply Last reply
      2
      • tony1tfT Offline
        tony1tfT Offline
        tony1tf
        wrote on last edited by
        #3

        You can enable direct one-wire input on the Raspberry Pi itself. Here's some python code that I use in my domestic heating monitoring. It uses an 'OpenPi' which was an early kickstarter project using a 1st generation R Pi compute board, but any Pi has the one-wire libraries available.
        Tony

        find all the active one-wire sensors

        base_dir = '/sys/bus/w1/devices/'
        device_files = []
        for n in range(0,3):
        try:
        device_folder = glob.glob(base_dir + '28*')[n]

        print device_folder

        	device_file =  device_folder + '/w1_slave'
        	device_files.append (device_file)		
        

        print device_file

        except: 
        	print n
        	nend = n
        

        print device_files

        #data logging of my OpenPi DS18B20 sensor

        def read_temp_raw(n):

        print n,device_files[n]

        f = open(device_files[n], 'r')
        lines = f.readlines()
        f.close()
        

        print lines

        return lines
        
        1 Reply Last reply
        0
        • H Offline
          H Offline
          hubertus
          wrote on last edited by
          #4

          Hi there and thank you for your help. The answers came later than I expected (never mind) and during a period as I am away from my arduinos and raspberry.
          I will try to make a sketch to show you the set up. But I am not interested to connect the sensor directly to raspberry pi by one-wire. The set up is like this

          Arduino with Dallas Temperature <> Serial interface <Serial cable> Moxa Serial to IP <Ethernet / virtual serial port> Raspberry pi as gateway with virtual serial port <Ethernet> Home assistant

          I will try to use SoftwareSerial, which is what I used already without mysensors on pin 00 et 1. What I am struggling with is the mysensors configuration for serial port and the gateway on raspberry with the virtual serial port.

          Keep you updated.

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


          11

          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