Page 1 of 1

mysensors live raw data debug

Posted: Thursday 06 April 2017 11:24
by haaxema
Hi all,

I have build a USB gateway (connected to a linux machine) with 2 local attatched sensors (Gasmeter-pulse and kWh pulse)
All is working wel BUT I'd like to see the raw (serial) data so I can verify the reading of the sensors. (just to be sure)

Used hardware:
- Arduino nano
- reed sensor (gas pulse)
- LDR (kWh pulse)
- Mysensors 2.2.1
- Domoticz 3.5877
- NRF24L01 (work in progress, just local sensors right now)

Is is possible to save/show the raw serial messages in a 'live' system?

Martin

Re: mysensors live raw data debug

Posted: Wednesday 12 April 2017 19:53
by RidingTheFlow
Try strace, e.g.:

Code: Select all

sudo strace -s 1000 -e trace=writev,readv -fp "`pidof domoticz`"
You will see serial calls among others and can narrow down to specific file descriptor that corresponds to interested serial port device.

Re: mysensors live raw data debug

Posted: Sunday 15 December 2019 2:22
by dmonty
Here is a way to make the output compatible with mysensors parser

Code: Select all

strace -s 1000 -e trace=writev,readv -fp "`pidof domoticz`" -o output.txt
Then in another tab/window

Code: Select all

cat output.txt | awk -F '"' '{print $2}' | tr -d "\n" | sed 's/\\n/\n/g'
Copy and the output into
https://www.mysensors.org/build/parser

NOTE: For some reason I could not pipe the strace into sed. So it is done in 2 steps.