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

    Multiple xS50 on a L513 (RS485)

    Official EVOK API
    5
    29
    5125
    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.
    • Martin Kudláček
      Martin Kudláček last edited by

      That seems to be OK. I will have to reproduce your setup, but I'm not sure, if I will be able to make it today. Tommorow morning for sure.

      M.

      1 Reply Last reply Reply Quote 0
      • Martin Kudláček
        Martin Kudláček last edited by Martin Kudláček

        OK, I partially reproduced your setup. I have:

        1. Neuron L503 with latest, up-to-date Raspbian (Linux raspberrypi 4.14.52-v7+ #1123 SMP Wed Jun 27 17:35:49 BST 2018 armv7l GNU/Linux), and EVOK 2.0.7. Serial line 1.1 configured with 19200bps, 8N1:

        0_1531146386123_05-uart-config.png

        1. One extension xS40 with address 3 (DIPs 3 and 4 are down):

        0_1531146511449_IMG_20180709_161809.jpg

        1. Another extension xS50 with address 2 (DIP 2 is up):

        0_1531146590709_IMG_20180709_161717.jpg

        1. Extensions and Neuron are connected with all RS485 "As" connected together and RS485 "Bs" connected together:

        0_1531146730331_IMG_20180709_161758.jpg

        1. The configuration in the evok.conf is this one:
        #!!! 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 match the JSON Schema; NOTE THAT THIS RESULTS IN A SIGNIFICANT INCREASE IN LATENCY AND SHOULD NOT BE USED EXCEPT FOR TESTING
        log_level = ERROR   					; Minimum severity of messages to be logged; one of INFO, DEBUG, WARNING, ERROR, CRITICAL
        log_file = /var/log/evok.log			; Log file to use; will be cleared on boot
        port = 8080								; !!! Internal API port - only change if you are certain you know what you are doing; FOR OUR WEB INTERFACE THE PORT SHOULD BE CHANGED IN "/etc/evok-nginx.conf" INSTEAD !!!
        webhook_enabled = False					; Enables webhook notification - see e.g. https://sendgrid.com/blog/whats-webhook/
        webhook_address = http://127.0.0.1:80   ; Put your server endpoint address here (e.g. http://123.123.123.123:/wh )
        webhook_device_mask = ["input","wd"]	; List of device types to notify on (written as a JSON list) - adding AI will generate a large amount of messages!
        webhook_complex_events = False			; EVOK will send POST requests with the same data as WebSocket, rather than an empty GET request
        wifi_control_enabled = False			; !!! REQUIRES THE UNIPIAP WIFI CONTROLLER TO BE INSTALLED !!! Will allow evok to control the internal Neuron wifi 
        soap_server_enabled = False				; Enables the simple SOAP server; use only if you need the functionality
        soap_server_port = 8081					; !!! IF SOAP SERVER IS ENABLED, THIS PORT NEEDS TO BE UNIQUE (i.e. different from the port setting above) !!!
        
        [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 while the second is a custom third-party device
        ; Devices sharing a port use the port settings of the first device on that port (baud rate, parity, stopbits)
        ; !!!Note that device_name has to match a filename in the /etc/hw_definitions directory!!! See /etc/hw_definitions/DOMAT MMIO.yaml for an example
        
        [EXTENSION_1]
        global_id = 2							; Mandatory, REQUIRED TO BE UNIQUE
        device_name = xS40						; 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 ports, e.g. /dev/ttyUSB0 or /dev/ttyS0)
        ;allow_register_access = True 			; Optional, False default, is mandatory with third-party devices
        address = 3							; 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. /dev/extcomm/0/0
        ;baud_rate = 19200						; 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
        
        [EXTENSION_2]
        global_id = 3							; Mandatory, REQUIRED TO BE UNIQUE
        device_name = xS50						; 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 ports, e.g. /dev/ttyUSB0 or /dev/ttyS0)
        ;allow_register_access = True 			; Optional, False default, is mandatory with third-party devices
        address = 2							; 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. /dev/extcomm/0/0
        ;baud_rate = 19200						; 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
        
        ;[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 with specific Neuron UART-over-Modbus ports (not possible for non-Modbus UART ports, e.g. /dev/ttyUSB0 or /dev/ttyS0)
        ;allow_register_access = True 			; Mandatory with third-party devices
        ;address = 1 							; Optional, 15 default
        ;scan_frequency = 2 					; Optional, 1 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 localhost:2122 or 'u' for USB dongle)
        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 interval is 15s
        ;
        ;[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_23]
        ;sensor = 2
        ;pin = 7
        
        1. After restarting the evok (service restart evok), the devices and their inputs/outputs were immediatelly available in the Web UI:

        0_1531147081348_FireShot Capture 1 - UniPi Control Panel - http___192.168.221.95_.png

        Can you check your setup against mine above? Try simplifying the extension's configuration as I did.

        M.

        1 Reply Last reply Reply Quote 0
        • S
          salorob last edited by salorob

          I wil have to check in a minute.
          As far as I can remember from testing yesterday; even if I connect just 1 module, which I give a fixed address with the dipswitch (say; dip 1 = up, makes address = 1 (right?)), and configure the evok.conf accordingly, it won't work.

          So in my opinion, setting an address manually by dip-switch, causes something to go wrong. Either I don't understand how the dip's represent an address, or something else goes haywire...

          however; I didn't check with the ;neuron_uart_circuit = 1_01 commented like in your example, wil check that in a minute.

          What does this option do anyway ?

          1 Reply Last reply Reply Quote 0
          • S
            salorob last edited by

            So; another quick test:

            • If I connect just 1 xS50, which I give a fixed address with the dipswitch (dip 1 = up, makes address = 1 (right?)), and configure the evok.conf accordingly, and configure the serial speed, it won't work.

            • All dip's down, on evok address 15, it works.

            1 Reply Last reply Reply Quote 0
            • Martin Kudláček
              Martin Kudláček last edited by

              Hi,
              this really seems to be an issue on our part, probably related to the firmware of the extensions. You are not the only one having the exactly same problem (see https://forum.unipi.technology/topic/652/how-to-add-xs40-to-neuron-l203-using-custom-software/42). We will investigate it a bit more and let you know as soon as possible.

              Thank you for your patience,
              Martin

              1 Reply Last reply Reply Quote 0
              • S
                salorob last edited by

                Ah.. okay. Well, at least I'm not crazy.
                Please let me know, I need to get this setup running asap.

                Thanks!

                1 Reply Last reply Reply Quote 0
                • Martin Kudláček
                  Martin Kudláček last edited by Martin Kudláček

                  Hi,
                  ok, to get your setup running ASAP - would it be possible to use Teamviewer or direct SSH to the controller so we can check what's happening? We will check the extension's firmware version and do the FW update if neccessary.

                  The best time would be between 12:00 and 20:00 CEST.

                  Thanks,
                  Martin

                  B 1 Reply Last reply Reply Quote 0
                  • S
                    salorob last edited by

                    I can give you ssh access ? please mail me at robert at ropesolutions.nl, I will supply you the details.

                    Martin Kudláček 1 Reply Last reply Reply Quote 0
                    • Martin Kudláček
                      Martin Kudláček @salorob last edited by

                      @salorob I just sent you the mail.

                      1 Reply Last reply Reply Quote 0
                      • B
                        bsc101 @Martin Kudláček last edited by

                        @martin-kudláček Just a quick question, since I also do have this problem with my xS50: Will there be some easy way to upgrade the firmware of the extension? What is the procedure of updating the firmware? Thanks for your answer!
                        Regards,
                        Boris

                        Martin Kudláček 1 Reply Last reply Reply Quote 0
                        • Martin Kudláček
                          Martin Kudláček @bsc101 last edited by

                          @bsc101 The way to check and update the firmware is fairly easy - just connect the extension via RS485 to the controller, ssh into the controller and run a program. I will write down a tutorial how to do so. We just want to be extra sure, that this problem is tied down to the extension's firmware. I do apologize for this incovenience.

                          B 1 Reply Last reply Reply Quote 0
                          • B
                            bsc101 @Martin Kudláček last edited by

                            @martin-kudláček Sounds good, thanks for your efforts!

                            Martin Kudláček 1 Reply Last reply Reply Quote 0
                            • Martin Kudláček
                              Martin Kudláček @bsc101 last edited by Martin Kudláček

                              Ok, the issue is definitely with the extension firmware 5.6. The current version is 5.18 and for some reason, both of you received extension units with the old firmware... We do apologize for this, if it is even possible.

                              The @salorob was able to flash the firmware by his own via our Windows application tool. Unfortunately, the tool is also long time waiting for the update, so the firmware version in this tool is only 5.9, instead of 5.18.

                              So the official hacker's tutorial is:

                              1. SSH into your controller, the user "pi", the password (if not changed) is "raspberry". If your image is Raspbian, you need to install additional packages:
                              pi@raspberrypi:~ $ sudo bash
                              root@raspberrypi:/home/pi# echo "deb https://files.unipi.technology/debian stretch main" > /etc/apt/sources.list.d/unipi.list
                              root@raspberrypi:/home/pi# wget -O - https://files.unipi.technology/debian/unipi_pub.gpg | apt-key add
                              root@raspberrypi:/home/pi# apt update
                              root@raspberrypi:/home/pi# apt install -y neuron-firmware neuron-modbus-tools
                              
                              1. Connect the extension to the controller over RS485. If you have multiple extensions, connect only one at a time. Right now, all of them thinks they have address 15, so you need to avoid collisions.

                              2. Confirm, you have a connection to extension

                              root@L503-sn101:/home/pi# /opt/neuron-bin/fwserial -p /dev/extcomm/0/0 
                              Boardset:     5 E-14Ro_P-11DiR485              (v1.0)
                              Baseboard:    2 E-14Ro                         (v1.0)
                              Firmware: v5.6
                              Modbus timeout set
                              
                              1. Flash the firmware
                              root@L503-sn101:/opt/fw# /opt/neuron-bin/fwserial -p /dev/extcomm/0/0 -PR
                              Boardset:     5 E-14Ro_P-11DiR485              (v1.0)
                              Baseboard:    2 E-14Ro                         (v1.0)
                              Firmware: v5.6
                              Modbus timeout set
                              Programming page 00 ...Finished programming chunk 0, ret: 64 err: 0
                              Finished programming chunk 1, ret: 64 err: 0
                              Finished programming chunk 2, ret: 64 err: 0
                              Finished programming chunk 3, ret: 64 err: 0
                              Finished programming chunk 4, ret: 64 err: 0
                              Finished programming chunk 5, ret: 64 err: 0
                              Finished programming chunk 6, ret: 64 err: 0
                              Finished programming chunk 7, ret: 64 err: 0
                              Page written OK.
                              
                              Programming page 01 ...Finished programming chunk 0, ret: 64 err: 0
                              ..........
                              
                              1. Verify the firmware. Since the flashed firmware now accepts address set by DIP switches, you need to specify the address in the parameter -u. My extension has address 3
                              root@L503-sn101:/opt/fw# /opt/neuron-bin/fwserial -p /dev/extcomm/0/0 -u 3
                              Boardset:     5 E-14Ro_P-11DiR485              (v1.0)
                              Baseboard:    2 E-14Ro                         (v1.0)
                              Firmware: v5.18
                              Modbus timeout set
                              
                              1. Repeat the process for all of the extensions

                              Let me know, how it worked. If you don't want to flash the firmware yourself, let me know and we can arrange some remote session with you.

                              Thanks,
                              Martin

                              B 1 Reply Last reply Reply Quote 0
                              • B
                                bsc101 @Martin Kudláček last edited by

                                @martin-kudláček Thanks a lot, it works now :) I can set another address than default now!
                                Firmware is now 5.9 (it was 5.6 as you said), is there any need to upgrade to 5.18?

                                Martin Kudláček 1 Reply Last reply Reply Quote 0
                                • Martin Kudláček
                                  Martin Kudláček @bsc101 last edited by

                                  @bsc101 So I guess you used the Windows firmware update tool as @salorob. There are definitely a bugfixes from version 5.9 with some new functionality as well. You have the tutorial above, so you can update it, if you find out you need it.

                                  B 2 Replies Last reply Reply Quote 0
                                  • B
                                    bsc101 @Martin Kudláček last edited by bsc101

                                    This post is deleted!
                                    1 Reply Last reply Reply Quote 0
                                    • B
                                      bsc101 @Martin Kudláček last edited by

                                      @martin-kudláček My fault, did not do step 1 in your decsription above since fwserial and firmware files were already present. It's 5.18 now, thank you!

                                      1 Reply Last reply Reply Quote 1
                                      • B
                                        Boy Lenssen last edited by Boy Lenssen

                                        Ok, took a while before I had time to do this, but now the downloads don't seem to work anymore, check below (btw, I'm using an own build image, not the Neuron image):

                                        root@L203-sn81:/home/pi# wget -O - https://files.unipi.technology/debian/unipi_pub.gpg | apt-key add\
                                        > ^C
                                        root@L203-sn81:/home/pi# wget -O - https://files.unipi.technology/debian/unipi_pub.gpg | apt-key add
                                        --2019-09-12 08:05:48--  https://files.unipi.technology/debian/unipi_pub.gpg
                                        Resolving files.unipi.technology (files.unipi.technology)... 86.49.170.141
                                        Connecting to files.unipi.technology (files.unipi.technology)|86.49.170.141|:443... connected.
                                        HTTP request sent, awaiting response... 302 Found
                                        Location: https://kb.unipi.technology/debian/unipi_pub.gpg [following]
                                        --2019-09-12 08:05:49--  https://kb.unipi.technology/debian/unipi_pub.gpg
                                        Resolving kb.unipi.technology (kb.unipi.technology)... 86.49.170.141
                                        Connecting to kb.unipi.technology (kb.unipi.technology)|86.49.170.141|:443... connected.
                                        HTTP request sent, awaiting response... 200 OK
                                        Length: unspecified [text/html]
                                        Saving to: 'STDOUT'
                                        
                                        -                                                     [ <=>                                                                                                       ]  13.43K  --.-KB/s    in 0.03s   
                                        
                                        2019-09-12 08:05:49 (385 KB/s) - written to stdout [13757]
                                        
                                        gpg: no valid OpenPGP data found.
                                        root@L203-sn81:/home/pi# apt update
                                        Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.4 kB]
                                        Get:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
                                        Get:3 http://raspbian.raspberrypi.org/raspbian stretch/contrib Sources [75.2 kB]      
                                        Get:5 http://raspbian.raspberrypi.org/raspbian stretch/non-free Sources [125 kB]                            
                                        Get:6 http://archive.raspberrypi.org/debian stretch/main armhf Packages [221 kB]                                                         
                                        Get:7 http://raspbian.raspberrypi.org/raspbian stretch/main Sources [9721 kB]                                                            
                                        Get:8 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [45.0 kB]
                                        Err:4 https://kb.unipi.technology/debian stretch InRelease  
                                          Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
                                        Get:9 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]
                                        Get:10 http://raspbian.raspberrypi.org/raspbian stretch/contrib armhf Packages [56.9 kB]                                                                                                            
                                        Get:11 http://raspbian.raspberrypi.org/raspbian stretch/non-free armhf Packages [95.5 kB]                                                                                                           
                                        Fetched 22.1 MB in 18s (1192 kB/s)                                                                                                                                                                  
                                        Reading package lists... Done
                                        E: Failed to fetch https://files.unipi.technology/debian/dists/stretch/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
                                        E: Some index files failed to download. They have been ignored, or old ones used instead.
                                        root@L203-sn81:/home/pi# apt install -y neuron-firmware neuron-modbus-tools
                                        Reading package lists... Done
                                        Building dependency tree       
                                        Reading state information... Done
                                        Note, selecting 'unipi-modbus-tools' instead of 'neuron-modbus-tools'
                                        E: Unable to locate package neuron-firmware
                                        root@L203-sn81:/home/pi# /opt/neuron-bin/fwserial -p /dev/extcomm/0/0 
                                        bash: /opt/neuron-bin/fwserial: No such file or directory
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • B
                                          Boy Lenssen last edited by Boy Lenssen

                                          So I tried with an official Unipian image, but still same problem. Some security issue (gpg: no valid OpenPGP data found). Please help @tomas_hora @Martin-Kudláček

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

                                            The files has been moved into a new repostirory: https://repo.unipi.technology/debian/ The FW tool for extension can be found here https://kb.unipi.technology/files:software:tools:00-start#extension_firmware_update_tool

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