Comments (10)
Hi @gadekula1, could you run this command again but also capture the output of dbus-monitor --system
? For example:
# terminal window 1
dbus-monitor --system > dbus.log
# terminal window 2
dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 io.openthread.BorderRouter.AddExternalRoute array:byte:0x00,0x11 byte:0x01 uint16:byte:bool:bool:0x1111:0x01:0x00:0x00
I was able to get a crash on my setup, but it's a different signal. I'm curious to know if the data is being properly formatted. The dbus-monitor
command should print out the message format as it is processed. On my system, the dbus-send
call you provided did not match the introspect document. You may need to double check the syntax of the command or try sending the message in a different way to insure correct syntax. For example, python bindings could be used to quickly test something.
method call time=1698867030.467833 sender=:1.22 -> destination=io.openthread.BorderRouter.wpan0 serial=2 path=/io/openthread/BorderRouter/wpan0; interface=io.openthread.BorderRouter; member=AddExternalRoute
array of bytes [
00 11
]
byte 1
uint16 0
from ot-br-posix.
Thanks @jdswensen , for reply,
Please find below dbus monitor log and dbus command
dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 io.openth read.BorderRouter.AddExternalRoute array:byte:0x00,0x11 byte:0x01 uint16:byte:bool:bool:0x1111:0x01:0x00:0x00
Error org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
cat dbus.log
signal time=1698980780.789248 sender=org.freedesktop.DBus -> destination=:1.29 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.29"
signal time=1698980780.789338 sender=org.freedesktop.DBus -> destination=:1.29 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.29"
method call time=1698980784.969485 sender=:1.30 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1698980784.969528 sender=org.freedesktop.DBus -> destination=:1.30 serial=1 reply_serial=1
string ":1.30"
signal time=1698980784.969545 sender=org.freedesktop.DBus -> destination=(null destination) serial=10 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.30"
string ""
string ":1.30"
signal time=1698980784.969567 sender=org.freedesktop.DBus -> destination=:1.30 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.30"
method call time=1698980784.970229 sender=:1.30 -> destination=io.openthread.BorderRouter.wpan0 serial=2 path=/io/openthread/BorderRouter/wpan0; interface=io.openthread.BorderRouter; member=AddExternalRoute
array of bytes [
00 11
]
byte 1
uint16 0
signal time=1698980785.083220 sender=org.freedesktop.DBus -> destination=:1.28 serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string "io.openthread.BorderRouter.wpan0"
signal time=1698980785.083272 sender=org.freedesktop.DBus -> destination=(null destination) serial=11 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string "io.openthread.BorderRouter.wpan0"
string ":1.28"
string ""
signal time=1698980785.083609 sender=org.freedesktop.DBus -> destination=:1.28 serial=6 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.28"
signal time=1698980785.083644 sender=org.freedesktop.DBus -> destination=(null destination) serial=12 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.28"
string ":1.28"
string ""
error time=1698980785.083667 sender=org.freedesktop.DBus -> destination=:1.30 error_name=org.freedesktop.DBus.Error.NoReply reply_serial=2
string "Message recipient disconnected from message bus without replying"
signal time=1698980785.084110 sender=org.freedesktop.DBus -> destination=:1.27 serial=13 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.27"
signal time=1698980785.084145 sender=org.freedesktop.DBus -> destination=(null destination) serial=34 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.27"
string ":1.27"
string ""
signal time=1698980785.084550 sender=org.freedesktop.DBus -> destination=:1.30 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.30"
signal time=1698980785.084581 sender=org.freedesktop.DBus -> destination=(null destination) serial=35 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.30"
string ":1.30"
string ""
`
observation :
failing at dbus_message_iter_recurse(aIter, &sub);
while parsing aRoute.mPrefix
(gdb) p aRoute.mPrefix
$2 = {mPrefix = {<std::_Vector_base<unsigned char, std::allocator >> = {
M_impl = {<std::allocator> = {<__gnu_cxx::new_allocator> = {}, }, <std::_Vector_base<unsigned char, std::allocator >::_Vector_impl_data> = {M_start = 0x0, M_finish = 0x0, M_end_of_storage = 0x0}, }}, }, mLength = 0 '\000'}
can we get complete/working dbus send command for AddExternalRoute if possible?
from ot-br-posix.
now we are able to pass values correctly ((ayy)y(bbbbbbb)).
method call time=1672542658.774958 sender=:1.44 -> destination=io.openthread.BorderRouter.wpan0 serial=2 path=/io/openthread/BorderRouter/wpan0; interface=io.openthread.BorderRouter.wpan0; member=AddOnMeshPrefix
struct {
struct {
array of bytes [
fd 11 00 22 00 00 00 00
]
byte 64
}
byte 0
struct {
boolean true
boolean true
boolean false
boolean false
boolean true
boolean true
boolean true
}
}
error time=1672542658.775497 sender=:1.29 -> destination=:1.44 error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=2
string "Method "AddOnMeshPrefix" with signature "((ayy)y(bbbbbbb))" on interface "io.openthread.BorderRouter.wpan0" doesn't exist
"
still otbr-agent throwing error.
AddOnMeshPrefix method from Introspect
<!-- AddOnMeshPrefix: Add an on-mesh prefix to the network.
@prefix: The on-mesh prefix.
The on-mesh prefix structure is:
<literallayout>
struct {
struct {
uint8[] prefix_bytes
uint8 prefix_length
}
byte preference
struct {
boolean preferred
boolean slaac
boolean dhcp
boolean configure
boolean default_route
boolean on_mesh
boolean stable
}
}
</literallayout>
-->
<method name="AddOnMeshPrefix">
<arg name="prefix" type="((ayy)y(bbbbbbb))"/>
</method>
from ot-br-posix.
For the issue in #2079 (comment), I've sent #2126 which should be able to fix the issue. @gadekula1 could you cherry-pick it and have a try?
from ot-br-posix.
@superwhd
Thanks for patch, even we tried with introspect of OnMeshPrefixes get property.
Now calling OnMeshPrefixes method with c++ dbus code with below parameters
method call time=1672532690.284219 sender=:1.22 -> destination=io.openthread.BorderRouter.wpan0 serial=2 path=/io/openthread/BorderRouter/wpan0; interface=io.openthread.BorderRouter; member=AddOnMeshPrefix
struct {
struct {
array of bytes [
fd 12 00 23 00 00 00 00
]
byte 64
}
uint16 63489
byte 0
boolean true
boolean true
boolean false
boolean false
boolean true
boolean true
boolean true
boolean false
boolean false
}
method return time=1672532690.286115 sender=:1.19 -> destination=:1.22 serial=10 reply_serial=2
Result of OnMeshPrefixes get property
dbus_test# dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan
0 org.freedesktop.DBus.Properties.Get string:io.openthread.BorderRouter string:OnMeshPrefixes
method return time=1672533309.560068 sender=:1.19 -> destination=:1.25 serial=13 reply_serial=2
variant array [
struct {
struct {
array of bytes [
fd 97 bf 63 01 2d 00 01
]
byte 64
}
uint16 63488
byte 255
boolean true
boolean true
boolean false
boolean false
boolean false
boolean true
boolean true
boolean false
boolean false
}
struct {
struct {
array of bytes [
fd 12 00 23 00 00 00 00
]
byte 64
}
uint16 63488
byte 0
boolean false
boolean true
boolean false
boolean false
boolean true
boolean true
boolean true
boolean false
boolean false
}
]
Note we tried to call method with dbus-send command but otbr-agent crashing
dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan
0 io.openthread.BorderRouter.AddOnMeshPrefix array:byte:0xfd,0x11,0x00,0x22,0x00,0x00,0x00,0x00 byte:0x64 uint16:0x15360 byte:0x00 bo
olean:true boolean:true boolean:false boolean:false boolean:true boolean:true boolean:true boolean:false boolean:false
Error org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
logs of dbus monitor
method call time=1672533472.568218 sender=:1.29 -> destination=io.openthread.BorderRouter.wpan0 serial=2 path=/io/openthread/BorderRouter/wpan0; interface=io.openthread.BorderRouter; member=AddOnMeshPrefix
array of bytes [
fd 11 00 22 00 00 00 00
]
byte 100
uint16 21344
byte 0
boolean true
boolean true
boolean false
boolean false
boolean true
boolean true
boolean true
boolean false
boolean false
unable send parameters in structure format using dbus-send. can we know how to pass parameters properly using dbus-send command.
from ot-br-posix.
I reproduced the crash issue via dbus-send
command in #2079 (comment).
I'm not sure if the payload of dbus-send
is correct but otbr-agent
shouldn't crash even if the input is invalid. I'll take a look to fix it.
BTW, I was able to call this API using gdbus
:
gdbus call --system --dest io.openthread.BorderRouter.wpan0 --method=io.openthread.BorderRouter.AddOnMeshPrefix --object-path /io/openthread/BorderRouter/wpan0 "(([0xfd,0x11,0x12,0x13], 64),0x5343, 0x01, false,false,false,false,false,false,false,false,false)
from ot-br-posix.
@superwhd
similar crash for AddExternalRoute
dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 io.opent
hread.BorderRouter.AddExternalRoute array:byte:0x00,0x11 byte:0x01 uint16:byte:bool:bool:0x1111:0x01:0x00:0x00
Error org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
not implemented error for PermitUnsecureJoin
dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0 io.openth
read.BorderRouter.PermitUnsecureJoin uint16:0x01243 uint32:0x20
Error io.openthread.Error.NotImplemented: io.openthread.Error.NotImplemented
from ot-br-posix.
@gadekula1 I think your payload is different from the expected type. The prefix byte array (array:byte:0x00,0x11) and the prefix length (byte:0x01) should be wrapped into a struct. However, I'm not sure how to send a struct as argument via dbus-send
.
For your reference, here's how I called AddExternalRoute
via gdbus
$ sudo gdbus call --system --dest io.openthread.BorderRouter.wpan0 --method=io.openthread.BorderRouter.AddExternalRoute --object-path /io/openthread/BorderRouter/wpan0 "(([0xfd,0x11,0x12,0x13,0x13,0x14,0x15,0x16], 64),0x5343, 0x01, false,false)"
from ot-br-posix.
@superwhd, Thanks, applied #2128 locally, now no crash observed for AddExternalRoute and AddOnMeshPrefix methods
dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0
io.openthread.BorderRouter.AddExternalRoute array:byte:0x00,0x11 byte:0x01 uint16:byte:bool:bool:0x1111:0x01:0x00:0x00
Error io.openthread.Error.InvalidArgs: io.openthread.Error.InvalidArgs
dbus-send --system --print-reply --dest=io.openthread.BorderRouter.wpan0 /io/openthread/BorderRouter/wpan0
io.openthread.BorderRouter.AddOnMeshPrefix array:byte:0xfd,0x11,0x00,0x22,0x00,0x00,0x00,0x00 byte:0x64 uint16:0x15360 byte:0x00 boo
lean:true boolean:true boolean:false boolean:false boolean:true boolean:true boolean:true boolean:false boolean:false
Error io.openthread.Error.InvalidArgs: io.openthread.Error.InvalidArgs
from ot-br-posix.
Resolved by #2128
from ot-br-posix.
Related Issues (20)
- [trel-dnssd] trel platform selects first peer address instead of wider scope one HOT 2
- PC in LAN cannot access Thread node but OTBR can HOT 17
- BeagleBone Black not booting after following OTBR guide HOT 2
- Use Docker image on bridged or custom docker network
- [Dbus] Set and GetAll methods throwing Error io.openthread.Error.NotFound: io.openthread.Error.NotFound error HOT 4
- Can the open thread border router be ported to the Android platform? HOT 1
- otbr-agent restarting after linux pc coming out of sleep mode
- Protobuf compiler version 24.4 doesn't match library version 3.12.4 HOT 1
- `test_manual_maddress.py` is flaky
- is there a way to dynamically change interface of otbr-agent HOT 5
- Compile failed when use higher protobuf lib
- [SOLVED] Best Practices for accessing OpenThread Instance in OT-BR-POSIX project HOT 2
- Compiling Border Router with TCP support HOT 2
- docker: Couldn't load target OTBR_FORWARD_INGRESS and mDNSPlatformSendUdp error 99.
- openwrt: ubus list otbr Command failed: Not found HOT 1
- Crash at UnsubscribeService HOT 2
- otbr intermittently crashes when a thread sed tries to do a srv & txt query HOT 1
- Border router disappears randomly from home assistant thread network HOT 5
- Thread Devices Become Unreachable from RPI Over Time Despite Connectivity via ot-ctl HOT 2
- Need some features for "ip -6 rule add~~~" to port Thread to Android 12. HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ot-br-posix.