High CPU usage when using serial adapter
j54n1n opened this issue · comments
Julian Sanin commented
Hello @jkandasa,
As mentioned in the forum post https://forum.mycontroller.org/post/2990 I file here the bug about the high CPU usage when using 2mqtt as serial adapter.
I get something like this with htop:
My environment was on a Raspberry Pi with latest Raspberry Pi OS based on Debian Buster and using Mosquitto 1.5.7 from apt-get.
The config file was set like this, where /dev/serial0
is a symlink to the actual PL011 UART /dev/ttyAMA0
connected to the MySensors serial gateway node:
logger:
mode: development
encoding: console
level: info
adapters:
- name: adapter1
enabled: true
reconnect_delay: 20s
provider: mysensors_v2
source:
type: serial
port: /dev/serial0
baud_rate: 115200
transmit_pre_delay: 10ms
mqtt:
broker: tcp://127.0.0.1:1883
insecure_skip_verify: false
username:
password:
subscribe: mysensors-in/#
publish: mysensors-out
qos: 0
transmit_pre_delay: 0s
reconnect_delay: 5s
- name: adapter2
enabled: false
reconnect_delay: 20s
provider: mysensors_v2
source:
type: ethernet
server: tcp://192.168.10.21:5003
transmit_pre_delay: 10ms
mqtt:
broker: tcp://192.168.10.21:1883
insecure_skip_verify: false
username:
password:
subscribe: in_nrf24/#
publish: out_nrf24
qos: 0
transmit_pre_delay: 0s
reconnect_delay: 5s
- name: adapter3
enabled: false
reconnect_delay: 20s
provider: raw
source:
type: serial
port: /dev/ttyUSB0
baud_rate: 115200
transmit_pre_delay: 10ms
message_splitter: 10
mqtt:
broker: tcp://192.168.10.21:1883
insecure_skip_verify: false
username:
password:
subscribe: in/my_topic
publish: out/my_topic
qos: 0
transmit_pre_delay: 0s
reconnect_delay: 5s
Thanks in advance.
Jeeva Kandasamy commented
@j54n1n I have fixed the issue, can you please verify it in the master build?
Julian Sanin commented
Yes with the commit b0f46c1 it seems to be fixed. I get now low CPU usage.
Thanks again.