Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non group address commands do not work #256

Open
jgrosseo opened this issue May 6, 2017 · 6 comments
Open

Non group address commands do not work #256

jgrosseo opened this issue May 6, 2017 · 6 comments

Comments

@jgrosseo
Copy link

jgrosseo commented May 6, 2017

Hi,
I am currently on knxd 0.12 with an MDT USB SCN-USBR.01
I start knxd with -e 0.0.1 -E 0.0.2:8 -u /tmp/eib -b usb -t 0xffc -f 9

vbusmonitor1 and on/off commands through knxtool work well.

However, anything using a bus address fails. E.g.:
$ knxtool maskver local:/tmp/eib 1.1.41
Read failed: Connection reset by peer
$ knxtool progmodestatus local:/tmp/eib 1.1.41
Set failed: Connection reset by peer

Any idea what I am missing?

I tried also with v0.14 without success.

Many thanks!
Jan

@smurfix
Copy link
Member

smurfix commented May 6, 2017

Removed when transitioning to libev, not yet re-implemented.

@jgrosseo
Copy link
Author

jgrosseo commented May 6, 2017

Does that include MemoryWrite (mwrite)? This is what I actually want to do: to trigger the "device LED" if you try to find a device in the KNX tree (for that one needs to write to 0x81 to memory address 0x60). Could I help reimplementing this?

@smurfix
Copy link
Member

smurfix commented May 7, 2017

Yes, currently that includes all messages that go to physical=individual addresses.

The code is still part of the archive (src/libserver/management.* and …/layer7.*). The problem is that most of these requests are not stateless. Thus you need either a thread/subprocess, or rewrite the code using events. Both isn't exactly trivial.

The way forward is to separate the routing (and group address caching) functions of knxd from the API. Each connection using knxd's API (i.e. the part that knxtool talks to) should create a pipe into the router, but otherwise be a separate process. Work to do that separation has not yet started. I'd also like to use that refactoring to switch to a common protocol like JSON (or one of its binary equivalents), because that would make knxd's auto-generated client code obsolete – it's mostly non-idiomatic and nobody really uses it.

@jgrosseo
Copy link
Author

jgrosseo commented Jun 4, 2017

I started digging through the code to go in this direction. It is of not much use to directly develop on the pi, so I set up everything on my ubuntu system and ran into a compilation issue which I did not manage to solve for a while now:

In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/x86intrin.h:30:0,
                 from /usr/include/x86_64-linux-gnu/c++/4.8/bits/opt_random.h:33,
                 from /usr/include/c++/4.8/random:51,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from /home/jgrosseo/knxd/libfmt/fmt/printf.h:13,
                 from ../../src/libserver/trace.h:33,
                 from ../../src/libserver/common.h:82,
                 from ../../src/libserver/link.h:23,
                 from ../../src/libserver/router.h:25,
                 from knxd.cpp:30:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/mmintrin.h: In function ‘__m64 _mm_cvtsi32_si64(int)’:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/mmintrin.h:61:54: error: can’t convert between vector values of different size
   return (__m64) __builtin_ia32_vec_init_v2si (__i, 0);
                                                      ^
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/mmintrin.h: In function ‘int _mm_cvtsi64_si32(__m64)’:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/mmintrin.h:104:53: error: cannot convert ‘__m64 {aka int}’ to ‘__vector(2) int’ for argument ‘1’ to ‘int __builtin_ia32_vec_ext_v2si(__vector(2) int, int)’
   return __builtin_ia32_vec_ext_v2si ((__v2si)__i, 0);

I tried adding -mmmx and -msse compiler flags but no success. This is a x86_64 system.

Any quick fix which you have in mind?

@smurfix
Copy link
Member

smurfix commented Jun 4, 2017

GCC 4.8 has problems with that code. Known gcc bug. Please upgrade.

@4d4mu
Copy link

4d4mu commented Nov 10, 2017

I also need mwrite/mread commands to communicate with my own device. So far only solution is to switch back to v0.10 and pthsem, correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants