extensions wont communicate



  • hi,

    today i got 2 xS30 and one xS40 and connected them to my L203. put on the terminators on the L203 and the xS40.
    configured the first xS30:

    [EXTENSION_1]
    global_id = 2							; Mandatory, REQUIRED TO BE UNIQUE
    device_name = xS30						; Mandatory
    modbus_uart_port = /dev/extcomm/0/0 	; Mandatory
    neuron_uart_circuit = 1_01				; Optional, allows associating ...
    ;allow_register_access = True 			; Optional, False default, is mandatory with third-party devices
    address = 1 							; Optional, 1 default
    ;scan_frequency = 2 					; Optional, 1 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! ...
    ;parity = N								; Optional, NEEDS UNIPI IMAGE TO WORK! ...
    ;stop_bits = 1							; Optional, NEEDS UNIPI IMAGE TO WORK! ...
    

    xS30 Definition is there:

    root@drHouse:~# ls -la /etc/hw_definitions/xS30.yaml 
    -rw-r--r-- 1 root root 1507 Feb  3 17:43 /etc/hw_definitions/xS30.yaml
    

    as i found no documentation for setting the UART params i configured it via the EVOK webapp and hoped this would work.
    but no luck:

    2018-04-09 18:26:14,742 - evok - ERROR - No cached value of register 1034 on unit 1 - read error
    Traceback (most recent call last):
      File "/opt/evok/neuron.py", line 299, in readboards
        yield board.parse_definition(self.hw_dict, 1)
      File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1055, in run
        value = future.result()
      File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 238, in result
        raise_exc_info(self._exc_info)
      File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1069, in run
        yielded = self.gen.send(value)
      File "/opt/evok/neuron.py", line 531, in parse_definition
        stopb_modes=m_feature['stopb_modes'], legacy_mode=self.legacy_mode)
      File "/opt/evok/neuron.py", line 1469, in __init__
        parity_mode_val = (self.arm.neuron.modbus_cache_map.get_register(1, self.valreg, unit=self.arm.modbus_address)[0]) & self.parity_mask
      File "/opt/evok/neuron.py", line 64, in get_register
        raise Exception('No cached value of register %d on unit %d - read error' % (counter, unit))
    Exception: No cached value of register 1034 on unit 1 - read error
    

    is the serial port "1.01" the one that my L203 is using for communication or am i on a totally wrong track here ?

    tia,tja...


  • administrators

    The configuration looks correct to me. Do you see any communication between the parent unit and the extension (TX/RX leds)? If so what is the pattern the LEDs show?

    The hardware definition file should work, I have tested it only a few days ago - in fact I still have a working xS30 on my desk right now.

    Did you get your Evok from github or image?

    If from image you could try uncommenting the stop bit/parity/baud rate lines with appropriate values.



  • hi tomas,

    the tx led on the L203 blinks and the rx leds on the extensions are on all times:

    0_1523376143010_IMG_20180410_172449_small.jpg
    i've got evok on raspbian via github.

    tja@drHouse:~ $ cat /etc/debian_version 
    9.4
    
    

    is there some way i can check that the serial params are correct - or OTOH what is the default config of the L203 w. raspbian so that i can match that on the extensions ?

    tia,tja...


  • administrators

    That looks like the serial connection parameters are wrong in some way, at least based on the LED behaviour. The correct behaviour should be synchronized blinking of the TX and RX leds on the extension, with the default reading frequency once per second (this can be increased via the "scan_frequency" option in the configuration file).

    Have you set any of the dip switches on the extensions, and if so, could you take a photo of them? If not then it might be a good idea to hard set 19200 8N1 ('N' parity, 19.2 speed) as well as the address (1 for the xS30, different for the other two extensions [note that in general the addresses do have to be different for each device]).

    The dip switches are only read on power-cycling or soft reset, in order to prevent the communication from breaking accidentally during operation, and therefore the extensions need to be power-cycled (or soft reset via EVOK once connection is established).

    The error you get back from EVOK indicates that the communication isn't established as well, so I would look at the UART communication layer first.

    Edit: The default config is 19200 8N1 address 15, but due to address conflicts this will only work with a single device on the bus.



  • ho tomas,

    thx 4 ur help, i got it running now.
    setting the serial params via dip switches to 19200/8/N/1 and they started to communicate.

    strangly i got one error from unit 0 (the neuron itself i guess) in evok.log ...

    2018-04-11 13:04:37,501 - evok - ERROR - No cached value of register 1226 on unit 0 - read error
    Traceback (most recent call last):
      File "/opt/evok/neuron.py", line 185, in readboards
        yield board.parse_definition(self.hw_dict, i)
      File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1055, in run
        value = future.result()
      File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 238, in result
        raise_exc_info(self._exc_info)
      File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1069, in run
        yielded = self.gen.send(value)
      File "/opt/evok/neuron.py", line 605, in parse_definition
        regpolarity=m_feature['polar_reg'], legacy_mode=self.legacy_mode)
      File "/opt/evok/neuron.py", line 1325, in __init__
        curr_ds = self.arm.neuron.modbus_cache_map.get_register(1, self.regmode, unit=self.arm.modbus_address)[0]
      File "/opt/evok/neuron.py", line 64, in get_register
        raise Exception('No cached value of register %d on unit %d - read error' % (counter, unit))
    Exception: No cached value of register 1226 on unit 0 - read error
    

    but afterwards i see all the registers of the neuron and all extension modules in the evok web app.

    thx for helping,
    wbr,tja...


  • administrators

    That is slightly odd, if it causes issues you can try the latest version which should be better about it. Anyway glad to hear you got it working.

    Using other/speeds parity than 19.2/8.6 KBd is certainly possible, but it's somewhat difficult to set up. Higher speeds can also be less reliable.

    The full range of supported bitrates is 115.6 KBd to 2.4KBd, which is set to be expanded lower, all the way down to 0.1365 (a slightly odd but TERMIOS-standardised speed) KBd, in future firmware which is currently being tested.



  • hi tomas,

    the new version (2.05a) seems to be fixed regarding that strange message.

    thx for helping,
    wbr,tja...


Log in to reply
 

Looks like your connection to UniPi.technology Forum was lost, please wait while we try to reconnect.