Object Model Sniffer
-
My goal is to have a 2nd device that polls the object model with
M409 F"d99F"
I have a 2nd RPI connected to my Duet 3 with + RPI as SBC.
GPIO14TX > IO_0.in
GPIO15RX > IO_0.out
GND > GNDI'm using
cat /dev/ttyS0 & cat > /dev/ttyS0
which basically turns terminal into a chatroom.
From DWC I can sendM118 P0 S"Hello Logfile and DWC" L1
Terminal shows
{"seq":3,"resp":"Hello Logfile and DWC\n"}
From DWC if I send
M118 P2 S"Hello Logfile and DWC" L1
Terminal responds with
Hello Logfile and DWC
Terminal does not respond when DWC sends P1, P3, P4 and P5.
So to me it seems like terminal was able to communicate with DSF.
When I try to send any of the following it doesn't respond with anything.
M409 M409 \n M409 F"d994" M409 F"d994"\n "M409 F"d994"\n" "M409" "M409\n"
It's clear I'm missing something. Does anyone have any idea?
-
@dhusolo How have you connected the second RPi to the Duet?
-
@dhusolo In SBC mode you can listen to object model updates either using a WebSocket connection or using the ModelObserver utility that comes with the preinstalled
duettools
package (invoke it via/opt/dsf/bin/ModelObserver
). If you don't want a network connection between both boards, I suggest you start the ModelObserver utility with a filter string and redirect the output to your UART device. -
@dc42
The 2nd RPI is connected to my Duet 3 IO_0.
GPIO14TX > IO_0.in
GPIO15RX > IO_0.out
GND > GND -
@chrishamm That sounds like it might be easier. I don't see how I can redirect the filtered data to /dev/ttyS0
-
@dhusolo AFAIR
/dev/ttyS0
is a main display TTY to be selected using Ctrl+Alt+F1 but that might vary per device.AFAIR you could set up the UART device using the
stty
command and then redirect everything of interest to it using a simple redirect statement:stty -F /dev/ttyAMA0 115200 /opt/dsf/bin/ModelObserver -q -f "heat/**|tools/**" > /dev/ttyAMA0
This example would send updates from the heat and tools keys over the first UART port.
-
@chrishamm Got it thanks. I'll try it out when I get home.
-
@chrishamm I wasn't really thinking. I don't have a USB to serial converter I can attach to the Duet's RPI. Is there a way to output the data to the duet's IO port or do I need a USB adapter?
-
@chrishamm I found an old USB to TTL adapter. I connect the USB to the Duet's RPI USB port.
I've got the it connected by
TTY RX to Pi TX
TTY TX to Pi RX
TTY GND to Pi GNDI have the jumper on the tty in the 3.3v setting
On the pi listening I ran terminal with
cat /dev/ttyS0
On the duet pi I ran
stty -F /dev/ttyUSB0 115200 /opt/dsf/bin/ModelObserver -q -f "heat/**|tools/**" > /dev/ttyUSB0
This is the output