KNX with micropython

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
dschwert
Posts: 12
Joined: Mon Sep 11, 2017 4:30 pm

Re: KNX with micropython

Post by dschwert » Sun Oct 28, 2018 9:04 pm

henfri wrote:
Sun Oct 28, 2018 8:25 pm
Yes, I want to use and ESP8266 and directly read/write to the bus.
What dou you mean with "direct"? You always need a physical layer interface. The easiest is a TPUART like NCN5120.
Or do you plan for something like selfbus?

bmx
Posts: 1
Joined: Mon Oct 29, 2018 10:25 am

Re: KNX with micropython

Post by bmx » Mon Oct 29, 2018 10:28 am

@henfri is writing about ESP8266 so he might want to send and receive via WiFi to KNX on an IP Router or knxd operated Raspi...

dschwert
Posts: 12
Joined: Mon Sep 11, 2017 4:30 pm

Re: KNX with micropython

Post by dschwert » Mon Oct 29, 2018 5:59 pm

Well, IMHO that's about the opposite of "direct".

I have never used KNXd. Isn't it backwards compatible to eibd?

Using a normal IP Router is probably not the most clever idea, as these usually have a very limited number of concurrent connections.
When I started with KNX five years ago, I had the impression that in the DIY community there were more eibds than IP routers.

henfri
Posts: 4
Joined: Sun Oct 28, 2018 1:20 pm

Re: KNX with micropython

Post by henfri » Wed Oct 31, 2018 8:41 pm

Hello,

yes, with directly connecting to KNX I mean without and KNXd/eibd via multicast (port 3671). This is only requires a KNX Router(*), nothing else. Every ESP8266 in the same network can -without further hardware- communicate with KNX this way.

When communicating via TCP/port 6720, one needs a knxd/eibd. This is what your second library does, isn't it?
When I started with KNX five years ago, I had the impression that in the DIY community there were more eibds than IP routers.
I do have one today. But I don't want to rely on it. Maybe in 10 years I prefer not being a sysadmin of my home anymore and buy a true knx-router. That's why I am hesitant of using the communication.
What dou you mean with "direct"? You always need a physical layer interface.
Yes, and that would be Wifi -builtin into the ESP.
Well, IMHO that's about the opposite of "direct".
What? Let's be precise:
3671/multicast is direct and KNX standard
6720/TCP is not
Do you agree?
I have never used KNXd. Isn't it backwards compatible to eibd?
I know of nothing that does not work with KNXd but did work with eibd. But the confguration is different.
Using a normal IP Router is probably not the most clever idea, as these usually have a very limited number of concurrent connections.
You need to distinguish:
There are "KNX/IP Routers" (=routing=multicast) and "KNX/IP Interfaces" (=tunneling=unicast). Some Routers also offer tunnels as well thus acting as interface.

Port 3671 ist multicast and has no limitation of connections.

(*)If -and only if- no KNX router (but just a KNX IP-Interface or an KNX-Serial Interface or whatever) is available, one can turn this into a KNX router with knxd/eibd

dschwert
Posts: 12
Joined: Mon Sep 11, 2017 4:30 pm

Re: KNX with micropython

Post by dschwert » Wed Oct 31, 2018 9:18 pm

henfri wrote:
Wed Oct 31, 2018 8:41 pm
When communicating via TCP/port 6720, one needs a knxd/eibd. This is what your second library does, isn't it?
Correct.

Personally, I don't find the Wifi approach very attractive. I would not want to have more than one or two devices connected via Wifi. E.g. I would not want to replace my 1-Wire and window contact interfaces with ESP modules and their power supplies. For more complex things, I'm fine with running Python on the Raspberry as there I have the usual infrastructure including debugger.

When looking at the libraries you have listed, it should be doable to port one to Micropython or have a look at them to learn for your own implementation. As I don't have an ESP, I don't know whether uasyncio supports networking and could directly replace asyncio.

Regards,
Dietmar

Post Reply