• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to use RS485 with node-red

    UniPi Neuron Series
    2
    5
    3216
    Loading More Posts
    • 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.
    • M
      mikami last edited by

      Hello
      I bought M103.
      RS485 can be set with EVOK, but I do not know the data input / output method.
      Please tell me an example of description.

      Configuration
      http://127.0.0.1/rest/rs485/1_01
      parity_mode = None & speed_mode = 9600 bps & stopb_mode = One

      T 1 Reply Last reply Reply Quote 0
      • T
        tomas_hora administrators @mikami last edited by

        @mikami https://evok-4.api-docs.io/1.04/aggjmsqrwmypnmorz/extensions

        1 Reply Last reply Reply Quote 0
        • M
          mikami last edited by

          Thank you for answering.

          I completed using the Evok to set the baud rate.

          However, I do not know how to write the code.
          I want to do communication from the RS485 terminal of Neuron to the sensor.

          http://127.0.0.1/-/extension-devices
          Is this the correct answer?

          Data you want to send
          buf = [0x01, 0x03, 0x00, 0x00, 0x00, 0x02, 0xC4, 0x0B];

          Please tell me the example code for Neuron M103 case.

          I am sorry for being a beginner.

          If I can not understand, use the USB RS485 converter.

          T 1 Reply Last reply Reply Quote 0
          • T
            tomas_hora administrators @mikami last edited by

            @mikami Evok supports only Modbus RTU as communication protocol on the RS485. First you have to define the variables(registers) using the example https://github.com/UniPiTechnology/evok/blob/master/etc/hw_definitions/CUSTOM MODBUS DEVICE.yaml (also check the other definitions - you can access ti via registers or using the DO/RO/... objects of evok).

            Once that is done, you have to modify to add it to evok.conf restart it and then you will be able to access the device either using the registers (https://evok-4.api-docs.io/1.04/json/get-register-state-json) or using the DO/RO/.. objects if you define.

            It will be available e.g. http://127.0.0.1/UART_[UART_ADDRESS]_[DEVICE_ID]/json/register/{circuit}
            UART_ADDRESS and DEVICE_ID are the same as defined in evok.conf
            circuit is the register defined in your .yaml definition

            1 Reply Last reply Reply Quote 0
            • M
              mikami last edited by

              Thank you for answering. But the problem is not solved.

              What is [UART_ADDRESS]?
              What is [DEVICE_ID]?
              Where is it listed in evok.conf?

              [EXTENSION_1]
              global_id = 2                                                   ; Mandatory, REQUIRED TO BE UNIQUE
              device_name = xS10                                              ; Mandatory
              modbus_uart_port = /dev/extcomm/0/0     ; Mandatory
              neuron_uart_circuit = 1_01                              ; Optional, allows associating extensions with specific Neuron UART-over-Modbus ports (not possible for non-Modbus UART po$
              allow_register_access = True                    ; Optional, False default, is mandatory with third-party devices
              address = 15                                                    ; Optional, 15 default
              scan_frequency = 2                                      ; Optional, 1 default
              scan_enabled = True                                     ; Optional, True default
              baud_rate = 9600                                                ; Optional, NEEDS UNIPI IMAGE TO WORK! USE API TO CONFIGURE UART MANUALLY IF USING STANDARD RASPBIAN
              parity = N                                                              ; Optional, NEEDS UNIPI IMAGE TO WORK! USE API TO CONFIGURE UART MANUALLY IF USING STANDARD RASPBIAN
              stop_bits = 1                                                   ; Optional, NEEDS UNIPI IMAGE TO WORK! USE API TO CONFIGURE UART MANUALLY IF USING STANDARD RASPBIAN
              

              Please give me sample code of data transmission.
              Although it examined it considerably, I feel that there are few documents.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post