jamesmunns / postcard-rpc

An RPC layer for postcard based protocols
Apache License 2.0
95 stars 22 forks source link

wire receive error on host #62

Open ple1n opened 2 days ago

ple1n commented 2 days ago

image

https://github.com/ple1n/meter/tree/postcard_rpc

ple1n commented 2 days ago

@jamesmunns

seems to be some problem with Tx on stm32 and Rx on host. I tried to trace it down to the source but its difficult

image

image

a while ago I used a postcard cobs over usb serial which worked. sorry im not familiar with embedded internals

ple1n commented 2 days ago

image

have to fork them to track it down

ple1n commented 2 days ago
``` openat(AT_FDCWD, "/sys/bus/usb/devices/1-7/speed", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "480\n", 4096) = 4 read(10, "", 4092) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/1-7/manufacturer", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/sys/bus/usb/devices/1-7/product", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "USB2.0 Hub\n", 4096) = 11 read(10, "", 4085) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/1-7/serial", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/sys/bus/usb/devices/1-7", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 10 fstat(10, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0 getdents64(10, 0x55791ef47370 /* 42 entries */, 32768) = 1392 openat(AT_FDCWD, "/sys/bus/usb/devices/1-7/1-7:1.0/bInterfaceNumber", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "00\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/1-7/1-7:1.0/bInterfaceClass", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "09\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/1-7/1-7:1.0/bInterfaceSubClass", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "00\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/1-7/1-7:1.0/bInterfaceProtocol", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "00\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/1-7/1-7:1.0/interface", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) getdents64(10, 0x55791ef47370 /* 0 entries */, 32768) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/busnum", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "1\n", 4096) = 2 read(10, "", 4094) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/devnum", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "1\n", 4096) = 2 read(10, "", 4094) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/idVendor", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "1d6b\n", 4096) = 5 read(10, "", 4091) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/idProduct", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "0002\n", 4096) = 5 read(10, "", 4091) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/bcdDevice", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "0611\n", 4096) = 5 read(10, "", 4091) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/bDeviceClass", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "09\n", 4096) = 3 read(10, "", 4093) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/bDeviceSubClass", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "00\n", 4096) = 3 read(10, "", 4093) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/bDeviceProtocol", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "01\n", 4096) = 3 read(10, "", 4093) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/speed", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "480\n", 4096) = 4 read(10, "", 4092) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/manufacturer", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "Linux 6.11.7-200.fc40.x86_64 xhc"..., 4096) = 38 read(10, "", 4058) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/product", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "xHCI Host Controller\n", 4096) = 21 read(10, "", 4075) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/serial", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "0000:01:00.0\n", 4096) = 13 read(10, "", 4083) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 10 fstat(10, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0 getdents64(10, 0x55791ef47370 /* 48 entries */, 32768) = 1576 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/1-0:1.0/bInterfaceNumber", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "00\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/1-0:1.0/bInterfaceClass", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "09\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/1-0:1.0/bInterfaceSubClass", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "00\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/1-0:1.0/bInterfaceProtocol", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "00\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/usb1/1-0:1.0/interface", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) getdents64(10, 0x55791ef47370 /* 0 entries */, 32768) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/1-8:1.1/busnum", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/sys/bus/usb/devices/1-6:1.0/busnum", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/sys/bus/usb/devices/3-0:1.0/busnum", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/busnum", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "5\n", 4096) = 2 read(10, "", 4094) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/devnum", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "47\n", 4096) = 3 read(10, "", 4093) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/idVendor", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "b1e1\n", 4096) = 5 read(10, "", 4091) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/idProduct", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "0001\n", 4096) = 5 read(10, "", 4091) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/bcdDevice", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "0010\n", 4096) = 5 read(10, "", 4091) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/bDeviceClass", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "ef\n", 4096) = 3 read(10, "", 4093) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/bDeviceSubClass", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "02\n", 4096) = 3 read(10, "", 4093) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/bDeviceProtocol", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "01\n", 4096) = 3 read(10, "", 4093) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/speed", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "12\n", 4096) = 3 read(10, "", 4093) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/manufacturer", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "Plein\n", 4096) = 6 read(10, "", 4090) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/product", O_RDONLY|O_CLOEXEC) = 10 statx(10, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(10, "meter\n", 4096) = 6 read(10, "", 4090) = 0 close(10) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/serial", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 10 fstat(10, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0 getdents64(10, 0x55791ef47370 /* 42 entries */, 32768) = 1384 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/5-1.3:1.0/bInterfaceNumber", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "00\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/5-1.3:1.0/bInterfaceClass", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "ff\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/5-1.3:1.0/bInterfaceSubClass", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "00\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/5-1.3:1.0/bInterfaceProtocol", O_RDONLY|O_CLOEXEC) = 11 statx(11, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=4096, ...}) = 0 read(11, "00\n", 4096) = 3 read(11, "", 4093) = 0 close(11) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/5-1.3:1.0/interface", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) getdents64(10, 0x55791ef47370 /* 0 entries */, 32768) = 0 close(10) = 0 close(9) = 0 openat(AT_FDCWD, "/sys/bus/usb/devices/5-1.3/bConfigurationValue", O_RDONLY|O_CLOEXEC) = 9 statx(9, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=4096, ...}) = 0 read(9, "1\n", 4096) = 2 read(9, "", 4094) = 0 close(9) = 0 open("/dev/bus/usb/005/047", O_RDWR|O_LARGEFILE|O_CLOEXEC) = 9 lseek(9, 0, SEEK_SET) = 0 statx(9, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFCHR|0664, stx_size=0, ...}) = 0 lseek(9, 0, SEEK_CUR) = 0 read(9, "\22\1\20\2\357\2\1@\341\261\1\0\20\0\1\2\0\1\t\2(\0\1\1\0\2002\10\v\0\1\377", 32) = 32 read(9, "\0\0\0\t\4\0\0\2\377\0\0\0\7\5\1\2@\0\0\7\5\202\2@\0\0", 32) = 26 read(9, "", 6) = 0 epoll_create1(EPOLL_CLOEXEC) = 10 mmap(NULL, 2101248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7fe86e9f5000 mprotect(0x7fe86e9f6000, 2097152, PROT_READ|PROT_WRITE) = 0 rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0 clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7fe86ebf5990, parent_tid=0x7fe86ebf5990, exit_signal=0, stack=0x7fe86e9f5000, stack_size=0x1ffdc0, tls=0x7fe86ebf56c0} => {parent_tid=[1320111]}, 88) = 1320111 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 epoll_ctl(10, EPOLL_CTL_ADD, 9, {events=EPOLLOUT, data={u32=0, u64=0}}) = 0 ioctl(9, USBDEVFS_CLAIMINTERFACE, 0x7ffd3638c9bc) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=403995526}) = 0 futex(0x7fe86edf6660, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x7fe8745b8ce0, FUTEX_WAIT_PRIVATE, 1, NULLerrno: No such file or directory (os error 2) 2024-11-27T12:42:04.548203Z ERROR postcard_rpc::host_client::raw_nusb: In Worker error: Cancelled, consecutive: 1 2024-11-27T12:42:04.548240Z ERROR postcard_rpc::host_client::raw_nusb: Giving up after 1 errors in a row, final error: Cancelled 2024-11-27T12:42:04.548249Z ERROR postcard_rpc::host_client::raw_nusb: Fatal Error, exiting 2024-11-27T12:42:04.548257Z WARN postcard_rpc::host_client::util: in_worker: wire receive error, exiting Transfer(Cancelled) ) = 0 write(2, "[src/bin/cli.rs:60:5] &rx = ", 28[src/bin/cli.rs:60:5] &rx = ) = 28 write(2, "Err", 3Err) = 3 write(2, "(\n", 2( ) = 2 write(2, " ", 4 ) = 4 write(2, "Closed", 6Closed) = 6 write(2, ",\n", 2, ) = 2 write(2, ")", 1)) = 1 write(2, "\n", 1 ) = 1 write(4, "\1\0\0\0\0\0\0\0", 8) = 8 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=404681316}) = 0 futex(0x7fe8743b6660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=404750391}) = 0 futex(0x7fe86ffff660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=404815764}) = 0 futex(0x7fe86fdfe660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=404883023}) = 0 futex(0x7fe86fbfd660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=404949165}) = 0 futex(0x7fe86f9fc660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=405031929}) = 0 futex(0x7fe86f7fb660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=405108687}) = 0 futex(0x7fe86f5fa660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=405179368}) = 0 futex(0x7fe86f3f9660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=405250957}) = 0 futex(0x7fe86f1f8660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=405321429}) = 0 futex(0x7fe86eff7660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=405391063}) = 0 futex(0x7fe86edf6660, FUTEX_WAKE_PRIVATE, 1) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=479380, tv_nsec=405463490}) = 0 futex(0x7fe86edf5108, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x7fe8745b7660, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0x7fe8745b8ce0, FUTEX_WAIT_PRIVATE, 1, NULL) = 0 futex(0x7fe86edf6990, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, 1320110, NULL, FUTEX_BITSET_MATCH_ANY) = -1 EAGAIN (Resource temporarily unavailable) sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0 munmap(0x7fe8748e3000, 12288) = 0 exit_group(0) ```
jamesmunns commented 2 days ago

The TX error = 2 means "Timeout", it's possible that my timeout code here:

https://github.com/jamesmunns/postcard-rpc/blob/aa96e691ef66bea5a6eabad61dd11375af28aca2/source/postcard-rpc/src/server/impls/embassy_usb_v0_3.rs#L410-L413

Is slightly too aggressive.

Could you please confirm if you are running the firmware in --release mode? Also, do you know what core frequency you are setting the CPU to? If running in release doesn't work, could you please try increasing the timeout in the snippet above to something bigger, like:

    // Calculate an estimated timeout based on the number of frames we need to send
    // For now, we use 2ms/frame, rounded UP
    let frames = (out.len() + 63) / 64;
-   let timeout_ms = frames * 2;
+   let timeout_ms = frames * 50;

And maybe remove this line?

https://github.com/ple1n/meter/blob/163a4cc5ee919843a7c29bd25deb9f5c3827fe6f/device/src/main.rs#L196

I'm not sure why the host client isn't handling this well, but the timeout might be causing the transfer to be reported as "cancelled", causing the server to assume something has gone wrong.

ple1n commented 2 days ago

@jamesmunns

no its not timeout problem i have tried some large numbers hardcoded and it simply delays the error.

image

anyway here i forked all the things

ple1n commented 2 days ago

and why should that line be removed. isnt that async command supposed to be long running and only exit when critical errors happen.

ple1n commented 2 days ago

the source of error was,

image

here I printed the err code

image

ple1n commented 2 days ago

image

so what file is it trying to open, can you tell me where to possibly find the origin of the error

jamesmunns commented 2 days ago

so what file is it trying to open

I don't know. postcard-rpc itself does not try to open any files, I am guessing this error is caused somewhere in nusb, possibly due to the timeout on the embedded side.

I still see "tx error Timeout" errors on your embassy firmware. It's possible (I'm guessing here):

Just to confirm, can you please confirm:

kevinmehall commented 2 days ago

Errno 2 is ENOENT, which std::io::Error will display as No such file or directory because it assumes it's file IO, but if that is coming from a usbfs ioctl, means either "specified interface or endpoint does not exist or is not enabled" or "URB was synchronously unlinked" (canceled). The latter would be consistent with postcard-rpc cancelling the transfer after a timeout.

Your strace log doesn't show the relevant ioctl calls or errors from submitting or completing transfers though, so it's not fully clear where that error is coming from. If you're submitting transfers and reaching errno_to_transfer_error I'd expect to see USBDEVFS_SUBMITURB and USBDEVFS_REAPURB ioctls in strace, but I'm confused why there's nothing in your strace log beyond claiming the interface.

Can you get the nusb logs? If you have env_logger, set RUST_LOG=nusb=debug, maybe something similar with tracing_subscriber.

ple1n commented 1 day ago
➜  e_gui git:(33bc568) ✗ RUST_LOG=trace sudo -E   ./target/debug/cli
2024-11-28T09:46:28.940903Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/1-9:1.0")    
2024-11-28T09:46:28.940950Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9:1.0/busnum": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.940966Z DEBUG nusb::platform::linux_usbfs::enumeration: failed to probe, skipping: No such file or directory (os error 2)    
2024-11-28T09:46:28.940976Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/usb5")    
2024-11-28T09:46:28.941008Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/busnum": Ok("5\n")    
2024-11-28T09:46:28.941034Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/devnum": Ok("1\n")    
2024-11-28T09:46:28.941056Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/idVendor": Ok("1d6b\n")    
2024-11-28T09:46:28.941081Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/idProduct": Ok("0002\n")    
2024-11-28T09:46:28.941103Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/bcdDevice": Ok("0611\n")    
2024-11-28T09:46:28.941124Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/bDeviceClass": Ok("09\n")    
2024-11-28T09:46:28.941145Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/bDeviceSubClass": Ok("00\n")    
2024-11-28T09:46:28.941164Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/bDeviceProtocol": Ok("01\n")    
2024-11-28T09:46:28.941184Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/speed": Ok("480\n")    
2024-11-28T09:46:28.941204Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/manufacturer": Ok("Linux 6.11.7-200.fc40.x86_64 xhci-hcd\n")    
2024-11-28T09:46:28.941224Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/product": Ok("xHCI Host Controller\n")    
2024-11-28T09:46:28.941245Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/serial": Ok("0000:07:00.4\n")    
2024-11-28T09:46:28.941300Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/5-0:1.0/bInterfaceNumber": Ok("00\n")    
2024-11-28T09:46:28.941323Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/5-0:1.0/bInterfaceClass": Ok("09\n")    
2024-11-28T09:46:28.941344Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/5-0:1.0/bInterfaceSubClass": Ok("00\n")    
2024-11-28T09:46:28.941365Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/5-0:1.0/bInterfaceProtocol": Ok("00\n")    
2024-11-28T09:46:28.941380Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb5/5-0:1.0/interface": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.941398Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/5-1:1.0")    
2024-11-28T09:46:28.941417Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1:1.0/busnum": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.941426Z DEBUG nusb::platform::linux_usbfs::enumeration: failed to probe, skipping: No such file or directory (os error 2)    
2024-11-28T09:46:28.941434Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/6-0:1.0")    
2024-11-28T09:46:28.941451Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/6-0:1.0/busnum": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.941460Z DEBUG nusb::platform::linux_usbfs::enumeration: failed to probe, skipping: No such file or directory (os error 2)    
2024-11-28T09:46:28.941467Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/1-9")    
2024-11-28T09:46:28.941489Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/busnum": Ok("1\n")    
2024-11-28T09:46:28.941510Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/devnum": Ok("5\n")    
2024-11-28T09:46:28.941531Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/idVendor": Ok("048d\n")    
2024-11-28T09:46:28.941552Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/idProduct": Ok("5702\n")    
2024-11-28T09:46:28.941573Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/bcdDevice": Ok("0001\n")    
2024-11-28T09:46:28.941594Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/bDeviceClass": Ok("00\n")    
2024-11-28T09:46:28.941614Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/bDeviceSubClass": Ok("00\n")    
2024-11-28T09:46:28.941634Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/bDeviceProtocol": Ok("00\n")    
2024-11-28T09:46:28.941655Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/speed": Ok("12\n")    
2024-11-28T09:46:28.941676Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/manufacturer": Ok("ITE Tech. Inc.\n")    
2024-11-28T09:46:28.941696Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/product": Ok("ITE Device\n")    
2024-11-28T09:46:28.941711Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/serial": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.941758Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/1-9:1.0/bInterfaceNumber": Ok("00\n")    
2024-11-28T09:46:28.941780Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/1-9:1.0/bInterfaceClass": Ok("03\n")    
2024-11-28T09:46:28.941802Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/1-9:1.0/bInterfaceSubClass": Ok("00\n")    
2024-11-28T09:46:28.941823Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/1-9:1.0/bInterfaceProtocol": Ok("00\n")    
2024-11-28T09:46:28.941840Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-9/1-9:1.0/interface": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.941872Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/usb3")    
2024-11-28T09:46:28.941899Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/busnum": Ok("3\n")    
2024-11-28T09:46:28.941921Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/devnum": Ok("1\n")    
2024-11-28T09:46:28.941941Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/idVendor": Ok("1d6b\n")    
2024-11-28T09:46:28.941962Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/idProduct": Ok("0002\n")    
2024-11-28T09:46:28.941982Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/bcdDevice": Ok("0611\n")    
2024-11-28T09:46:28.942003Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/bDeviceClass": Ok("09\n")    
2024-11-28T09:46:28.942023Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/bDeviceSubClass": Ok("00\n")    
2024-11-28T09:46:28.942044Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/bDeviceProtocol": Ok("01\n")    
2024-11-28T09:46:28.942063Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/speed": Ok("480\n")    
2024-11-28T09:46:28.942084Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/manufacturer": Ok("Linux 6.11.7-200.fc40.x86_64 xhci-hcd\n")    
2024-11-28T09:46:28.942106Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/product": Ok("xHCI Host Controller\n")    
2024-11-28T09:46:28.942126Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/serial": Ok("0000:07:00.3\n")    
2024-11-28T09:46:28.942173Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/3-0:1.0/bInterfaceNumber": Ok("00\n")    
2024-11-28T09:46:28.942195Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/3-0:1.0/bInterfaceClass": Ok("09\n")    
2024-11-28T09:46:28.942216Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/3-0:1.0/bInterfaceSubClass": Ok("00\n")    
2024-11-28T09:46:28.942236Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/3-0:1.0/bInterfaceProtocol": Ok("00\n")    
2024-11-28T09:46:28.942252Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb3/3-0:1.0/interface": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.942269Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/5-1.3:1.0")    
2024-11-28T09:46:28.942296Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3:1.0/busnum": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.942305Z DEBUG nusb::platform::linux_usbfs::enumeration: failed to probe, skipping: No such file or directory (os error 2)    
2024-11-28T09:46:28.942312Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/1-7")    
2024-11-28T09:46:28.942337Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/busnum": Ok("1\n")    
2024-11-28T09:46:28.942359Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/devnum": Ok("3\n")    
2024-11-28T09:46:28.942380Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/idVendor": Ok("05e3\n")    
2024-11-28T09:46:28.942402Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/idProduct": Ok("0608\n")    
2024-11-28T09:46:28.942423Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/bcdDevice": Ok("8536\n")    
2024-11-28T09:46:28.942444Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/bDeviceClass": Ok("09\n")    
2024-11-28T09:46:28.942465Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/bDeviceSubClass": Ok("00\n")    
2024-11-28T09:46:28.942487Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/bDeviceProtocol": Ok("01\n")    
2024-11-28T09:46:28.942509Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/speed": Ok("480\n")    
2024-11-28T09:46:28.942524Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/manufacturer": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.942546Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/product": Ok("USB2.0 Hub\n")    
2024-11-28T09:46:28.942562Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/serial": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.942610Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/1-7:1.0/bInterfaceNumber": Ok("00\n")    
2024-11-28T09:46:28.942632Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/1-7:1.0/bInterfaceClass": Ok("09\n")    
2024-11-28T09:46:28.942653Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/1-7:1.0/bInterfaceSubClass": Ok("00\n")    
2024-11-28T09:46:28.942675Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/1-7:1.0/bInterfaceProtocol": Ok("00\n")    
2024-11-28T09:46:28.942692Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-7/1-7:1.0/interface": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.942706Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/usb1")    
2024-11-28T09:46:28.942729Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/busnum": Ok("1\n")    
2024-11-28T09:46:28.942751Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/devnum": Ok("1\n")    
2024-11-28T09:46:28.942771Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/idVendor": Ok("1d6b\n")    
2024-11-28T09:46:28.942792Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/idProduct": Ok("0002\n")    
2024-11-28T09:46:28.942812Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/bcdDevice": Ok("0611\n")    
2024-11-28T09:46:28.942833Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/bDeviceClass": Ok("09\n")    
2024-11-28T09:46:28.942862Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/bDeviceSubClass": Ok("00\n")    
2024-11-28T09:46:28.942887Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/bDeviceProtocol": Ok("01\n")    
2024-11-28T09:46:28.942907Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/speed": Ok("480\n")    
2024-11-28T09:46:28.942928Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/manufacturer": Ok("Linux 6.11.7-200.fc40.x86_64 xhci-hcd\n")    
2024-11-28T09:46:28.942951Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/product": Ok("xHCI Host Controller\n")    
2024-11-28T09:46:28.942972Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/serial": Ok("0000:01:00.0\n")    
2024-11-28T09:46:28.943020Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/1-0:1.0/bInterfaceNumber": Ok("00\n")    
2024-11-28T09:46:28.943042Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/1-0:1.0/bInterfaceClass": Ok("09\n")    
2024-11-28T09:46:28.943064Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/1-0:1.0/bInterfaceSubClass": Ok("00\n")    
2024-11-28T09:46:28.943085Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/1-0:1.0/bInterfaceProtocol": Ok("00\n")    
2024-11-28T09:46:28.943100Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/usb1/1-0:1.0/interface": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.943115Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/1-8:1.1")    
2024-11-28T09:46:28.943133Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-8:1.1/busnum": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.943142Z DEBUG nusb::platform::linux_usbfs::enumeration: failed to probe, skipping: No such file or directory (os error 2)    
2024-11-28T09:46:28.943150Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/1-6:1.0")    
2024-11-28T09:46:28.943169Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/1-6:1.0/busnum": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.943177Z DEBUG nusb::platform::linux_usbfs::enumeration: failed to probe, skipping: No such file or directory (os error 2)    
2024-11-28T09:46:28.943184Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/3-0:1.0")    
2024-11-28T09:46:28.943199Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/3-0:1.0/busnum": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.943207Z DEBUG nusb::platform::linux_usbfs::enumeration: failed to probe, skipping: No such file or directory (os error 2)    
2024-11-28T09:46:28.943214Z DEBUG nusb::platform::linux_usbfs::enumeration: probe device SysfsPath("/sys/bus/usb/devices/5-1.3")    
2024-11-28T09:46:28.943240Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/busnum": Ok("5\n")    
2024-11-28T09:46:28.943261Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/devnum": Ok("50\n")    
2024-11-28T09:46:28.943284Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/idVendor": Ok("b1e1\n")    
2024-11-28T09:46:28.943306Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/idProduct": Ok("0001\n")    
2024-11-28T09:46:28.943327Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/bcdDevice": Ok("0010\n")    
2024-11-28T09:46:28.943349Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/bDeviceClass": Ok("ef\n")    
2024-11-28T09:46:28.943371Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/bDeviceSubClass": Ok("02\n")    
2024-11-28T09:46:28.943393Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/bDeviceProtocol": Ok("01\n")    
2024-11-28T09:46:28.943414Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/speed": Ok("12\n")    
2024-11-28T09:46:28.943436Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/manufacturer": Ok("Plein\n")    
2024-11-28T09:46:28.943457Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/product": Ok("meter\n")    
2024-11-28T09:46:28.943472Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/serial": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.943519Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/5-1.3:1.0/bInterfaceNumber": Ok("00\n")    
2024-11-28T09:46:28.943541Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/5-1.3:1.0/bInterfaceClass": Ok("ff\n")    
2024-11-28T09:46:28.943563Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/5-1.3:1.0/bInterfaceSubClass": Ok("00\n")    
2024-11-28T09:46:28.943585Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/5-1.3:1.0/bInterfaceProtocol": Ok("00\n")    
2024-11-28T09:46:28.943604Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/5-1.3:1.0/interface": Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })    
2024-11-28T09:46:28.943647Z DEBUG nusb::platform::linux_usbfs::enumeration: sysfs read "/sys/bus/usb/devices/5-1.3/bConfigurationValue": Ok("1\n")    
2024-11-28T09:46:28.943659Z DEBUG nusb::platform::linux_usbfs::device: Opening usbfs device /dev/bus/usb/005/050    
2024-11-28T09:46:28.943774Z DEBUG nusb::platform::linux_usbfs::device: Opened device fd=9 with id 0    
2024-11-28T09:46:28.943785Z DEBUG nusb::platform::linux_usbfs::device: Opened device bus=5 addr=50    
2024-11-28T09:46:28.943813Z DEBUG nusb::platform::linux_usbfs::device: Claimed interface 0 on device id 0    
2024-11-28T09:46:28.943961Z DEBUG nusb::platform::linux_usbfs::device: Submitted URB 0x7f2218000cf0 on ep 1    
2024-11-28T09:46:28.943961Z DEBUG nusb::platform::linux_usbfs::device: Failed to submit URB 0x7f22200010e0 on ep 81: No such file or directory (os error 2) Urb { ep_type: 3, endpoint: 129, status: 0, flags: 0, buffer: 0x7f2220000cd0, buffer_length: 1024, actual_length: 0, start_frame: 0, number_of_packets_or_stream_id: 0, error_count: 0, signr: 0, usercontext: 0x7f2220001120 }    
2024-11-28T09:46:28.943986Z DEBUG nusb::platform::linux_usbfs::device: Failed to submit URB 0x7f2220001830 on ep 81: No such file or directory (os error 2) Urb { ep_type: 3, endpoint: 129, status: 0, flags: 0, buffer: 0x7f2220001420, buffer_length: 1024, actual_length: 0, start_frame: 0, number_of_packets_or_stream_id: 0, error_count: 0, signr: 0, usercontext: 0x7f22200018a0 }    
2024-11-28T09:46:28.943997Z DEBUG nusb::platform::linux_usbfs::device: Failed to submit URB 0x7f2220001d20 on ep 81: No such file or directory (os error 2) Urb { ep_type: 3, endpoint: 129, status: 0, flags: 0, buffer: 0x7f2220001910, buffer_length: 1024, actual_length: 0, start_frame: 0, number_of_packets_or_stream_id: 0, error_count: 0, signr: 0, usercontext: 0x7f2220001d60 }    
2024-11-28T09:46:28.944012Z DEBUG nusb::platform::linux_usbfs::device: Failed to submit URB 0x7f22200021e0 on ep 81: No such file or directory (os error 2) Urb { ep_type: 3, endpoint: 129, status: 0, flags: 0, buffer: 0x7f2220001dd0, buffer_length: 1024, actual_length: 0, start_frame: 0, number_of_packets_or_stream_id: 0, error_count: 0, signr: 0, usercontext: 0x7f2220002220 }    
errno: No such file or directory (os error 2)
2024-11-28T09:46:28.944032Z ERROR postcard_rpc::host_client::raw_nusb: In Worker error: Cancelled, consecutive: 1
2024-11-28T09:46:28.944028Z DEBUG nusb::platform::linux_usbfs::device: Handling events for device 0    
2024-11-28T09:46:28.944040Z ERROR postcard_rpc::host_client::raw_nusb: Giving up after 1 errors in a row, final error: Cancelled
2024-11-28T09:46:28.944047Z ERROR postcard_rpc::host_client::raw_nusb: Fatal Error, exiting
2024-11-28T09:46:28.944047Z DEBUG nusb::platform::linux_usbfs::device: URB 0x7f2218000cf0 for ep 1 completed, status=0 actual_length=11    
2024-11-28T09:46:28.944058Z  WARN postcard_rpc::host_client::util: in_worker: wire receive error, exiting Transfer(Cancelled)
[src/bin/cli.rs:57:5] &rx = Err(
    Closed,
)
2024-11-28T09:46:28.944113Z DEBUG nusb::platform::linux_usbfs::device: Released interface 0 on device 0: Ok(())    
2024-11-28T09:46:28.944130Z DEBUG nusb::platform::linux_usbfs::device: Closing device 0    
➜  e_gui git:(33bc568) ✗ 

@kevinmehall

kevinmehall commented 1 day ago

postcard-rpc is trying to submit transfers on endpoint 0x81, which does not exist. In the configuration descriptor extracted from your strace log, the device's endpoints are numbered 0x01 and 0x82.

ple1n commented 1 day ago

@jamesmunns i have that branch locally available tag me to test your code if u are interested. im using cobs over serial rn https://github.com/ple1n/egui_cobs

jamesmunns commented 1 day ago

@kevinmehall thanks for that catch! I'm actually pretty confused on how that ends up like that. I'll look into using https://docs.rs/nusb/latest/nusb/struct.Interface.html#method.descriptors to peek through the actual endpoints that are present. We recently added the ability to pick a specific Interface, so I should likely add a similar way of picking a specific endpoint.

Embassy USB numbers endpoints sequentially, though it seems that the RP2040 has a separate list for in/out (so you get 0x01/0x81 - both are the first entry), whereas the embassy-stm32 USB driver counts in a single list, which means you get 0x01 and 0x82 instead.

Postcard-rpc should be more robust about this, or at least allow you to pick your endpoint IDs instead of using hardcoded ones.

kevinmehall commented 1 day ago

USB device controllers have different constraints on what endpoint addresses can be used. Yes, to be compatible across devices, you want to look at the endpoint descriptors under the specified interface instead of hard-coding endpoint addresses.