Close
0%
0%

KNXduino

KNX-compatible device based on STM32 MCU with Arduino flavour

Similar projects worth following

Make DIY components for standard-based wired home automation / smart home. 

KNX/EIB = the only world-wide wired building automation bus standard.

You can easily mix DIY (KNXduino) components and profesional KNX bus components produced by ABB, Busch-Jaeger, Siemens, Loxone, etc.

  • Updater ("OTA") lightning fast

    Pavel Kriz02/14/2020 at 15:26 0 comments

    The tool to update KNXduino firmware Over-the-Air, well, Over-the-Wire actually, is called knxduino-updater. Until today, it supported the full image update only. It took 7 minutes to update full 25kB firmware 😞.

    Now the updater can perform "diff" update in case it has the old firmware that is currently in device. Only different bytes are sent over KNX bus thus the update is much faster when there are minor changes in the firmware eg. 30 seconds 😀. See the log below.

    java -jar knxduino-updater-1.0-SNAPSHOT-all.jar -nat 192.168.0.100 -fileName "/tmp/arduino_build_369255/KNXduinoBlinkOverKNX.ino.hex" -uid 05:B0:01:02:E9:80:AC:AE:E9:07:47:55 -device 15.15.208
    Restart device in programming mode...
    Unlock device... done (0).
    Hex file parsed: starting at 0x8008000, length 25984 bytes
    Old firmware's descriptor from MCU: startAddr=0x8008000 endAddr=0x800e580 crc=0x82a71ef8
    Olf firmware found in cache (switching to diff upload mode): /home/pavkriz/.cache/knxduino-updater/0.4/image-8008000-25984-82a71ef8.bin
    Sending application data (116 diff bytes) 
    ..........
    Program device next page diff, CRC32 0x55fcba92 ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0xe368b554 ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x538968ed ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x36258d52 ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x792de65c ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x4e2ea853 ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x1dd01214 ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x2d459147 ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x8d70ed87 ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x8793dcbc ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x92f7da61 ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x62fe847a ... done (0).
    Sending application data (5 diff bytes) 
    .
    Program device next page diff, CRC32 0x1e370c38 ... done (0).
    Compressed (diffed) stream length = 186
    Preparing boot descriptor with start address 0x8008000 end address 0x800e580 with CRC32 0x98fe67cd APP_VERSION pointer 0x0 ... 
    ..
    Update boot descriptor ... done (0).
    Restarting device ... 

  • Two Git repos are better than one

    Pavel Kriz07/11/2019 at 15:18 0 comments

    Today, I've split the code, docs , etc. into two Git repositories:

  • KNXduino board finally up and running

    Pavel Kriz07/10/2019 at 18:48 1 comment

    While I started my prototyping using a Nucleo-F303RE board, I switched to STM32G0 line recently and now have a working custom board based on STM32G071 :)

    All bells and whistles working:

    and ABB binary output understands very well to our commands:

    Leason learned today: Do not let a KNX+ wire hang around. 30 volts accidentally touching a GPIO will kill your STM32 in a millisecond.

  • Hooray, STM32 Arduino Core supports STM32G0 MCUs

    Pavel Kriz07/10/2019 at 15:59 0 comments

    While I started to design a KNXduino 1.0 board with a new hacker-friendly STM32G0 MCU, I waited for STM32 Arduino Core support. Now, the STM32G0 line is supported since version 1.6.0.

    Why we love STM32G0:

    • LQFP32 package - manually solderable
    • Fair amount of Flash and RAM while promising more in year 2020
    • Single power rail - ie. only two power pins, single decoupling capacitor needed (+1 for Reset pin), thus simpler PCB, fewer components and more IOs available
    • Accurate internal RC oscillator - no Xtal needed for many applications, thus simpler PCB, fewer components and more IOs available
    • In short - True replacement for 8-bit MCUs

View all 4 project logs

Enjoy this project?

Share

Discussions

Pavel Kriz wrote 01/03/2020 at 12:22 point

@dgajew The project currently requires an MCU with DAC (sets the voltage threshold for signal detection) and analog comparator (detects the bus signal) build-in. STM32F103 lacks both of them. I wanted to target the project to bluepill and it would be feasible but it would require too many compromises and the final solution would be suboptimal. It's better and easier to use STM32G0, ST sells cheap Nucleo boards if you want a dev board.

  Are you sure? yes | no

dgajew wrote 01/12/2020 at 17:10 point

Thank you Pavel for information, one more question about hardware: are elements D6 and L3 really necessary? 150 mH inductor is quite big and I don't understand function of diode D6. What type of transistor T1 did you use? I choosed MMBF170LT1G but voltage between gate and source in this type should be higher than 3,3 V to achieve on state..

  Are you sure? yes | no

Pavel Kriz wrote 01/13/2020 at 16:34 point

The transceiver part of the schematic is heavily inspired by selfbus / freebus projects. Here is a short description of one of the original circuits: https://www.freebus.org/content/freebus-grundschaltung

I'm quite beginner in analog circuitry, so here is my humble explanation. 

1) inductor "separates" the power supply from the bus and "filters" the signal (hi-speed changes on bus vs. stable power output on the other side), C4 charging should also not draw much current from the bus (which would may lead to false low "signal"). I think one could replace it with a resistor in case of really low power consumption of the device (did not try). 

2) D6 protects the receiver from reversed polarity (in case of human error during installation etc.) and is intentionally separated from power-supply reverse polarity protection (D11) in order not to discharge C4 and stress L3 while T1 pulls the bus low during transmission. 

3) I think I use DMN6140L as T1 now, which should be "quite well on" 😉 at 3,3V Vgs.

  Are you sure? yes | no

Pavel Kriz wrote 01/13/2020 at 16:49 point

The guy here https://guiott.com/KNX/C-Hardware/Hardware.htm uses no inductor at all, but I'm not sure it's a good idea. All selfbus / freebus  designs use an inductor.

  Are you sure? yes | no

dgajew wrote 01/02/2020 at 23:20 point

Hello, is it possible to use popular "bluepill" module with STM32F103 uC or I have to use STM32G071KBT6 uC? I found bluepill hardware example in the repository but there is no way to compile source code for boards other than "Nucleo G071RB"

  Are you sure? yes | no

renatocostaferreira wrote 10/13/2019 at 02:19 point

Hello Pavel

Great job.  How specification to RTC xtal 32768 kHz and load capacitor to STM32G071KB (LGQP32).

  Are you sure? yes | no

Pavel Kriz wrote 01/13/2020 at 16:01 point

Hello, I do not use xtal. The hi-speed (typically 8MHz) oscillator in the schematic is only "proposed" in case someone would need it. Actually it has to be integrated oscillator (not xtal) with output having logic levels. 32-pin STM32G0 does not have hi-speed xtal pins. OSC32_IN pin can be switch to hi-speed-oscillator input. 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates