• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. DSurname
    D
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 14
    • Best 0
    • Controversial 0
    • Groups 0

    DSurname

    @DSurname

    0
    Reputation
    380
    Profile views
    14
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    DSurname Unfollow Follow

    Latest posts made by DSurname

    • Manage Digital Input/Output of unipi neuron m103

      Hi, i want to switch on a light in digital output 1.1. How can I do it?
      I'm using nodejs server over modbus-rtu.

      My settings are:

      this.client.connectRTUBuffered(Configuration.modbus.port, {
                      baudRate: 38400,
                      dataBits: 8,
                      parity: 'none',
                      stopBits: 1
                  }, async () => {
                      this._logger.info('Modbus: connected!');
                      resolve();
       });
      

      Normally via rtu if I need to query a slave I just put slaveId and the register. But if I need to query slaveId of unipi and query the register of digital output how can i manage this?

      I Try with:

      this.client.setId(15) // Default address of Unipi??
      this.client.writeRegister(1,1) // Registers from group 1
      

      But nothing happens, can you help me? I can just use gpio?
      I have installed evok too, if can help

      posted in Official EVOK API
      D
      DSurname
    • RE: Can't use /dev/extcomm/0 ports

      I don't know why all my settings reseted after reboot, i don't think i have evok that use te same port

      #!!! Do not use '#' for comments !!!
      
      [MAIN]
      config_version = 2.5                                    ; Configuration file version, DO NOT CHANGE!
      use_schema_verification = False                 ; Enabling this will deny any requests that do not m$
      log_level = ERROR                                       ; Minimum severity of messages to be logged;$
      log_file = /var/log/evok.log                    ; Log file to use; will be cleared on boot
      port = 8080                                                             ; !!! Internal API port - on$
      webhook_enabled = False                                 ; Enables webhook notification - see e.g. ht$
      webhook_address = http://127.0.0.1:80   ; Put your server endpoint address here (e.g. http://123.123$
      webhook_device_mask = ["input","wd"]    ; List of device types to notify on (written as a JSON list)$
      webhook_complex_events = False                  ; EVOK will send POST requests with the same data as$
      wifi_control_enabled = False                    ; !!! REQUIRES THE UNIPIAP WIFI CONTROLLER TO BE INS$
      soap_server_enabled = False                             ; Enables the simple SOAP server; use only i$
      soap_server_port = 8081                                 ; !!! IF SOAP SERVER IS ENABLED, THIS PORT N$
      
      [NEURON_1]
      global_id = 1                                                   ; Mandatory, REQUIRED TO BE UNIQUE
      allow_register_access = False                   ; Optional, False default
      scan_frequency = 10                                             ; Optional, 10 default
      scan_enabled = True                                     ; Optional, True default
      
      ; Below you can find examples for connecting devices over UART; first example is a Neuron extension $
      ; Devices sharing a port use the port settings of the first device on that port (baud rate, parity, $
      ; !!!Note that device_name has to match a filename in the /etc/hw_definitions directory!!! See /etc/$
      
      ;[EXTENSION_1]
      global_id = 2                                                   ; Mandatory, REQUIRED TO BE UNIQUE
      device_name = xM103                                             ; Mandatory
      modbus_uart_port = /dev/extcomm/0/0     ; Mandatory
      ;neuron_uart_circuit = 1_01                             ; Optional, allows associating extensions wi$
      ;allow_register_access = True                   ; Optional, False default, is mandatory with third-p$
      ;address = 1                                                    ; Optional, 1 default
      ;scan_frequency = 10                                    ; Optional, 10 default
      ;scan_enabled = True                                    ; Optional, True default
      ; Note that the following settings will be inherited by other devices sharing the same port, i.e. /d$
      baud_rate = 38400                                               ; Optional, NEEDS UNIPI IMAGE TO WOR$
      parity = N                                                              ; Optional, NEEDS UNIPI IMAG$
      stop_bits = 1                                                   ; Optional, NEEDS UNIPI IMAGE TO WOR$
      
      ;[EXTENSION_2]
      ;global_id = 3                                                  ; Mandatory, REQUIRED TO BE UNIQUE
      ;device_name = CUSTOM MODBUS DEVICE             ; Mandatory
      ;modbus_uart_port = /dev/extcomm/0/0    ; Mandatory
      ;neuron_uart_circuit = 1_01                             ; Optional, allows associating extensions wi$
      ;allow_register_access = True                   ; Mandatory with third-party devices
      ;address = 1                                                    ; Optional, 15 default
      ;scan_enabled = True                                    ; Optional, True default
      
      [OWBUS_1]
      owbus = /dev/i2c-1 --i2c=/dev/i2c-1:ALL                 ; Scanned bus (--i2c=/dev/i2c-1:ALL or local$
      interval = 3                                            ; [s] Default sensor reading
      scan_interval = 300                                     ; [s] How often is scanning done
      
      ;Example of 1W-4R/4DI extension module, 1W-8R is almost the same, only with inputs instead of relays
      ;
      ; - Map a new 1Wire sensor with the appropriate address, type and interval
      ; - The syntax can be either SENSOR or 1WDEVICE
      ; - Setting the correct reading interval is crucial to achieve ideal performance; the default interv$
      ;
      ;[1WDEVICE_2]
      ;bus = 1
      ;address = 29F39A17000000BC
      ;type = DS2408
      ;interval = 1
      ;
      ;[1WRELAY_10]
      ;sensor = 2
      ;pin = 0
      ;
      ;[1WRELAY_11]
      ;sensor = 2
      ;pin = 1
      ;
      ;[1WRELAY_12]
      ;sensor = 2
      ;pin = 2
      ;
      ;[1WRELAY_13]
      ;sensor = 2
      ;pin = 3
      ;
      ;[1WINPUT_20]
      ;sensor = 2
      ;pin = 4
      ;
      ;[1WINPUT_21]
      ;sensor = 2
      ;pin = 5
      ;
      ;[1WINPUT_22]
      ;sensor = 2
      ;pin = 6
      ;
      ;[1WINPUT_22]
      ;sensor = 2
      ;pin = 6
      ;
      ;[1WINPUT_23]
      ;sensor = 2
      ;pin = 7
      

      This is my evok file

      posted in UniPi Neuron Series
      D
      DSurname
    • RE: Can't use /dev/extcomm/0 ports

      Baud rate of thermostats was 38400 so i modify my script. Still i'm not enable to read from them, but when i try to read from device id n.3 something is written in minicom console:

      ¼ÖּÖּÖּÖּÖּ                                                      üÖ
      

      Little update: Everything, finally, work now!!!
      But when i restart unipi, everything will be reseted, and I need to reconfigure serial port on minicom, configure permissions on /dev/extcomm and so on. Have you a solution for this problem?

      posted in UniPi Neuron Series
      D
      DSurname
    • RE: Can't use /dev/extcomm/0 ports

      Ok i have some questions now.
      First, how can i make persistence settings and not lost them when i restart PLC?
      Second, i don't understand well this part: "Or maybe you use it correctly, but you use wrong serial port settings. Remember, you have to use the same settings as you have on all devices on your RS485 bus." In my configuration on the node js server i use 9600bps, 8 databits no parity and 1 stop bit. You intend the speed that thermostats accept?

      This is the serial configuration of thermostats:
      Serial Line:
      RS485

      Baud rate:
      300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400

      Data bits:
      8 bit

      Parity:
      nessuna, pari o dispari

      Stop bit:
      1

      It's seems the same. Regarding modbus library is the same i used in a raspberry pi, when i change into unipi neuron i've change configuration using /dev/extcomm/0/0 instead of /dev/ttyMAM0

      alt text
      alt text

      I not sure if i cabled correctly the A and B

      posted in UniPi Neuron Series
      D
      DSurname
    • RE: Can't use /dev/extcomm/0 ports

      When i run: minicom -b 9600 -o -D /dev/extcomm/0/1 nothing happends.
      When i run: minicom -b 9600 -o -D /dev/extcomm/0/0 opens a console but i cant write anything but the Tx leds blinking!

      When i press Ctrl-A Z and quit without reset somehow when i run my node.js and try to connect with /dev/extcomm/0/0 something now happends, still can't receive data from thermostats but now the Tx led blinking when i try to call the slave.

      I don't know what happened but is better than before.
      I don't know is this will help but the led 1.2 of digital outputs is always on now.

      posted in UniPi Neuron Series
      D
      DSurname
    • RE: Can't use /dev/extcomm/0 ports

      I'm sorry but i'm very novice, can you show me a guide or something else to do that?

      Does modbus only access with tcp? I can't figured out how to connect with /dev/extcomm ports...

      posted in UniPi Neuron Series
      D
      DSurname
    • RE: Can't use /dev/extcomm/0 ports

      Can i use raspbian stretch lite instead?
      Btw i installed evok 2.0.7 and when i run python script i received same error:

      Traceback (most recent call last):
        File "testmodbus.py", line 12, in <module>
          value = client.read_input_registers(256,4, unit=0x01)
        File "/home/pi/.local/lib/python3.5/site-packages/pymodbus/client/common.py", line 125, in read_input_registers
          return self.execute(request)
        File "/home/pi/.local/lib/python3.5/site-packages/pymodbus/client/sync.py", line 106, in execute
          raise ConnectionException("Failed to connect[%s]" % (self.__str__()))
      pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusSerialClient(rtu baud[9200])]
      

      I think is still enable to communicate with and I don't know the reason behind

      posted in UniPi Neuron Series
      D
      DSurname
    • RE: Can't use /dev/extcomm/0 ports

      Where i can download it?

      posted in UniPi Neuron Series
      D
      DSurname
    • RE: Can't use /dev/extcomm/0 ports

      Configuration:

      this.client.connectRTUBuffered(Configuration.modbus.port, {
                      baudRate: 38400,
                      dataBits: 8,
                      parity: 'none',
                      stopBits: 1
                  }, async () => {
                      this._logger.info('Modbus: connected!');
                      resolve();
                  });
      

      TX/RX are not blinking..

      posted in UniPi Neuron Series
      D
      DSurname
    • Can't use /dev/extcomm/0 ports

      I've installed unipi and insert linux image. I've running a server in node.js that will comunicate with thermostats and another devices with modbus rtu RS485. But seems that i can't still communicate with this devices. I have neuron M103 and i use modbus-serial npm package. I use /dev/exctcomm/0 ports and i try /dev/serial0 /dev/serial1 /dev/serialttyAMA0 but nothing. I Followed tutorials that modify the /boot/config.txt file /boot/cmdline.txt but still nothing. When i run the following code in python i receive:

      #!/usr/bin/python3
      from pymodbus.client.sync import ModbusSerialClient as ModbusClient
      from pymodbus.register_read_message import ReadInputRegistersResponse
      
      port = '/dev/extcomm/0/1'
      client = ModbusClient(method='rtu', port=port, stopbits=1, bytesize=8, parity='N', baudrate=9600, timeout=0.3)
      connection=client.connect()
      
      print(port)
      print(connection)
      
      value = client.read_input_registers(256,4, unit=0x01)
      
      print(value)
      

      The error is:

      False
      Traceback (most recent call last):
        File "testmodbus.py", line 12, in <module>
          value = client.read_input_registers(256,4, unit=0x01)
        File "/home/pi/.local/lib/python3.5/site-packages/pymodbus/client/common.py", line 125, in read_input_registers
          return self.execute(request)
        File "/home/pi/.local/lib/python3.5/site-packages/pymodbus/client/sync.py", line 106, in execute
          raise ConnectionException("Failed to connect[%s]" % (self.__str__()))
      pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusSerialClient(rtu baud[9600])]
      

      Config.txt file:

      # For more options and information see
      # http://rpf.io/configtxt
      # Some settings may impact device functionality. See link above for details
      
      # uncomment if you get no picture on HDMI for a default "safe" mode
      #hdmi_safe=1
      
      # uncomment this if your display has a black border of unused pixels visible
      # and your display can output without overscan
      #disable_overscan=1
      
      # uncomment the following to adjust overscan. Use positive numbers if console
      # goes off screen, and negative if there is too much border
      #overscan_left=16
      #overscan_right=16
      #overscan_top=16
      #overscan_bottom=16
      
      # uncomment to force a console size. By default it will be display's size minus
      # overscan.
      #framebuffer_width=1280
      #framebuffer_height=720
      
      # uncomment if hdmi display is not detected and composite is being output
      #hdmi_force_hotplug=1
      
      # uncomment to force a specific HDMI mode (this will force VGA)
      #hdmi_group=1
      #hdmi_mode=1
      
      # uncomment to force a HDMI mode rather than DVI. This can make audio work in
      # DMT (computer monitor) modes
      #hdmi_drive=2
      
      # uncomment to increase signal to HDMI, if you have interference, blanking, or
      # no display
      #config_hdmi_boost=4
      
      # uncomment for composite PAL
      #sdtv_mode=2
      
      #uncomment to overclock the arm. 700 MHz is the default.
      #arm_freq=800
      
      # Uncomment some or all of these to enable the optional hardware interfaces
      #dtparam=i2c_arm=on
      #dtparam=i2s=on
      # For more options and information see
      # http://rpf.io/configtxt
      # Some settings may impact device functionality. See link above for details
      
      # uncomment if you get no picture on HDMI for a default "safe" mode
      #hdmi_safe=1
      
      # uncomment this if your display has a black border of unused pixels visible
      # and your display can output without overscan
      #disable_overscan=1
      
      # uncomment the following to adjust overscan. Use positive numbers if console
      # goes off screen, and negative if there is too much border
      #overscan_left=16
      #overscan_right=16
      #overscan_top=16
      #overscan_bottom=16
      
      # uncomment to force a console size. By default it will be display's size minus
      # overscan.
      #framebuffer_width=1280
      #framebuffer_height=720
      
      # uncomment if hdmi display is not detected and composite is being output
      #hdmi_force_hotplug=1
      
      # uncomment to force a specific HDMI mode (this will force VGA)
      #hdmi_group=1
      #hdmi_mode=1
      
      # uncomment to force a HDMI mode rather than DVI. This can make audio work in
      # DMT (computer monitor) modes
      #hdmi_drive=2
      
      # uncomment to increase signal to HDMI, if you have interference, blanking, or
      # no display
      #config_hdmi_boost=4
      
      # uncomment for composite PAL
      #sdtv_mode=2
      
      #uncomment to overclock the arm. 700 MHz is the default.
      #arm_freq=800
      
      # Uncomment some or all of these to enable the optional hardware interfaces
      #dtparam=i2c_arm=on
      #dtparam=i2s=on
      dtoverlay=lirc-rpi
       dtparam=audio=on
      dtoverlay=neuron-spi
      enable_uart=1
      device_tree_param=i2c1=on
      

      cmdline.txt

      dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=167bb82f-02 rootfstype=ext4 elevator=deadline $fsck.repair=yes rootwait
      

      Can someone help me figured out this situation?

      posted in UniPi Neuron Series
      D
      DSurname