Hi,
I have a UniPi Neuron S103 (latest OpenSource OS available) and I want to connect it, via RS485 MODBUS RTU, to a SenseCAP ORCH S4 sensor.
The connection details for the ORCH S4 are specified here:
- baudrate 9600
- address 14
- no parity
- stop bit 1
- start bit 1
- bit count 8
On the s103 I've installed evok and it's working fine, but I don't get any values from the sensor. The connection between the s103 and the sensor is working because I was able to read the values via mbpoll
# mbpoll /dev/extcomm/0/0 -m rtu -a 14 -b 9600 -c 8 -P none
Protocol configuration: Modbus RTU
Slave configuration...: address = [14]
start reference = 1, count = 8
Communication.........: /dev/extcomm/0/0, 9600-8N1
t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table
-- Polling slave 14... Ctrl-C to stop)
[1]: 1629
[2]: 6752
[3]: 1
[4]: 34408 (-31128)
[5]: 151
[6]: 8299
[7]: 4
[8]: 2575
What am I doing wrong? I'm guessing it's something related to the modbus registry definitions, but I don't know how to fix it. Can someone point me in the right direction? thanks
Here's my /etc/evok.conf
[MAIN] ; !!! ALL MAIN SECTION OPTIONS ARE MANDATORY !!!
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
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) !!!
force_immediate_state_changes = False ; Outputs will return the value they are set to, rather than the value that the device is currently aware of
websocket_all_filtered = False ; 'All' WebSocket requests will be subject to the filtering set by 'filter'
[NEURON_1]
global_id = 1 ; Mandatory, REQUIRED TO BE UNIQUE
allow_register_access = False ; Optional, False default
scan_frequency = 10 ; Optional, 10 default, scanning frequency in [Hz]
scan_enabled = True ; Optional, True default
[EXTENSION_2]
global_id = 3
device_name = ORCHS4
modbus_uart_port = /dev/extcomm/0/0
allow_register_access = True
address = 14
parity = N
baud_rate = 9600
stop_bits = 1
and my /etc/hw_definitions/ORCHS4.yaml
type: ORCHS4
modbus_register_blocks:
- board_index : 1
start_reg : 0
count : 8
frequency : 50
modbus_features:
- type : REGISTER
major_group : 1
count : 1
start_reg : 0
- type : REGISTER
major_group : 1
count : 2
start_reg : 1
and here's the logs from evok execution
# /opt/evok/bin/python /opt/evok/lib/python2.7/site-packages/evok/evok.py
[I 221013 08:40:56 config:78] eprom: UniPi Neuron S103 version: 2.4 serial: 0xec
[I 221013 08:40:56 evok:1899] Starting using config file /etc/evok.conf
[I 221013 08:40:56 config:103] YAML Definition loaded: xS11.yaml, type: 3, definition count 0
[I 221013 08:40:56 config:103] YAML Definition loaded: IC-Light1P-1.yaml, type: 3, definition count 1
[I 221013 08:40:56 config:103] YAML Definition loaded: ORCHS4.yaml, type: 3, definition count 2
[I 221013 08:40:56 config:103] YAML Definition loaded: xS50.yaml, type: 3, definition count 3
[I 221013 08:40:56 config:103] YAML Definition loaded: xS10.yaml, type: 3, definition count 4
[I 221013 08:40:56 config:103] YAML Definition loaded: xS51.yaml, type: 3, definition count 5
[I 221013 08:40:56 config:103] YAML Definition loaded: CUSTOM_MODBUS_DEVICE.yaml, type: 3, definition count 6
[I 221013 08:40:56 config:103] YAML Definition loaded: IC-AiUC8-2.yaml, type: 3, definition count 7
[I 221013 08:40:56 config:103] YAML Definition loaded: xS30.yaml, type: 3, definition count 8
[I 221013 08:40:56 config:103] YAML Definition loaded: IC-DiS2Do2-1.yaml, type: 3, definition count 9
[I 221013 08:40:56 config:103] YAML Definition loaded: xS40.yaml, type: 3, definition count 10
[I 221013 08:40:56 config:103] YAML Definition loaded: xG18.yaml, type: 3, definition count 11
[I 221013 08:40:56 config:110] YAML Definition loaded: /etc/hw_definitions/BuiltIn/S103.yaml, type: UniPiBuiltIn
[I 221013 08:40:56 config:103] YAML Definition loaded: IAQ.yaml, type: 3, definition count 12
[I 221013 08:40:56 config:103] YAML Definition loaded: evok-alias.yaml, type: 2, definition count 0
[I 221013 08:40:56 evok:1969] HTTP server listening on port: 8080
[I 221013 08:40:56 modbusclient_tornado:134] TCP/Modbus client to 127.0.0.1:502 started
[I 221013 08:40:56 modbusclient_rs485:361] UART client started
[I 221013 08:40:56 neuron:325] Reading the Modbus board on Modbus address 14
[I 221013 08:40:56 neuron:215] Reading SPI boards
[I 221013 08:40:56 owclient:450] Entering OWW loop with PID 2087
[I 221013 08:40:56 neuron:230] No board on SPI 2
[I 221013 08:40:56 neuron:230] No board on SPI 3