Ankündigung

Einklappen
Keine Ankündigung bisher.

bobaos - js library for Weinzierl BAOS 838 kBerry

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    KNX/EIB bobaos - js library for Weinzierl BAOS 838 kBerry

    Hello.

    Have made JavaScript library for Weinzierl BAOS Module 838 kBerry that allows to use features of ObjectServer protocol (https://www.weinzierl.de/images/down...rotocol_v2.pdf)

    It is written in pure js an uses "serialport" npm package to communicate with UART.

    Usage is simple and documentation could be found at my repo:
    https://github.com/shabunin/bobaos

    Also, you can take a loot at command-line interface
    https://github.com/shabunin/bobaos-cli

    Thank
    bobaos - JavaScript implementation of KNX ObjectServer Protocol for KNX BAOS Module 838 kBerry.

    #2
    Added new npm package bobaos-datapoint-sdk. The main advantage is that you can operate with datapoint values without manual conversion between JS and KNX datapoint types. So, the idea is that you configure 838 module from ETS, download application and it stores all datapoints information including length, type, config flags. After connecting from JS app it gets information, creates datapoint objects and you are able to operate with from js from this moment.

    You can check it out on github as well
    bobaos-datapoint-sdk - JS Datapoint sdk for Weinzierl BAOS 838 module kBerry

    Kommentar


      #3
      There was a big update that I was promoting on L+B in Frankfurt.

      bobaos project still in active developement and there was major changes since my last post.

      First of all, it's github page now https://github.com/bobaos.

      Second, now there is small page with instructions how to download image for Raspberry Pi, write it to micro SD card, run bobaos.
      You can find it by following link: https://bobaos.github.io

      Also, bobaos-cli, bobaos-datapoint-sdk is deprecated since bdsd.sock appears. Instead, you use bdsd.sock as a core service, bdsd-cli for terminal access, bdsd.client to access from your own scripts.

      Good luck!

      Kommentar


        #4
        Now, I'm launching homebridge-bobaos plugin for HomeKit support. This module is in the beginning of it's path, so supported services at this moment are Lightbulb(On/Brightness), Switch(On), Fan(On).

        All instructions can be found at https://github.com/bobaos/homebridge-bobaos

        Kommentar


          #5
          Updating this thread.

          recent changes:

          1. bdsd-cli now can highlight selected datapoints. So, if you are debugging your app and there is a bunch of bus events output in terminal, you can use "watch" command to highlight only datapoints you needed.

          Code:
          bobaos> watch -s 100 -c green
          bobaos> watch -s 101 -c underline
          2. DBAD license. http://dbad-license.org/
          3. PayPal button in github repos to support me in developing project.

          Kommentar


            #6
            Hi vladimir,
            so cool, that somebody has developed this. I wouldn't have been able to do this myself, but now I have the chance to use it :-)

            By the way, how do you track changes to the datapoints from the bus-side? Do you have to poll the datapoints regularly or is the a "subscribe" function?

            Guess I'll have to play around with it a little, to understand better.

            Regards, Rolf

            Kommentar


              #7
              Hi, Rolf

              I have developed this module after years of working with other TP/UART solutions. Some was so expensive, some has lack of features.

              There is official baos sdk written in C++ and also available in open source. Take look at this too. https://github.com/weinzierl-engineering/baos

              To your question. There is DatapointValue.Ind service implemented in BAOS Binary protocol. So, everytime datapoint value changes no bus(e.g. you push button), BAOS module sends data via UART, bobaos module parses incoming binary data and in the end, EventEmitter does the rest. Also it is possible to send read requests but datapoints should have checked "Update" flag in BAOS module parameters.

              You may checkout latest version of bobaos module. More info and quick start guide can be found at https://bobaoskit.github.io/quickstart.html

              Kommentar


                #8
                Hi Vladimir,
                in the past, I've only worked with the Weinzierl interfaces as knx-tunnel/router. So things where "easy", but if you want to build real interaction with the tp-bus, building your own knx-device, then this is definitly a good way. I know the official sdk, but the effort of building a c++ application was to much to me :-)

                I've installed bobaos using "npm install --save bobaos" and was wondering, that there where 200 modules installed. Found the package-lock.json file and there are all these packages referenced. Could it be, that there are to many dependencies?
                I'll try to write my first node using your one today :-)

                Regards, Rolf

                Kommentar


                  #9
                  Hi, Rolf.

                  "bobaos" package itself only has one dependency: "serialport" to communicate over UART and all of those other 200 dependencies are belonging to "serialport" package.

                  Also, I want to clarify that "bobaos" package is a core layer that implements BAOS services over UART. If you use it in your apps you will need take care of value conversion since bobaos will return you values as a raw bytes in a Buffer instance. Also, you should keep in mind that there may be only one serialport connection to your device /dev/ttyAMA0. Due of those two points I have developed "bdsd.sock"/"bdsd.client" packages and recently has rewritten it to "bobaos.pub"/"bobaos.sub" packages.

                  So, more details on bobaos.pub:

                  1. It uses bobaos package to communicate over UART with BAOS. So, you will not need to "npm install bobaos", instead "npm install bobaos.sub".
                  2. It gets all datapoints info from BAOS and stores it in array. So, for example, bobaos.pub knows that datapoint #1 has dpt9 type and when you request datapoint value you will get both converted to float 20.7 and raw bytes: [ 0x0C, 0x0B ]. For conversion I use knx-dpts-baos package.
                  3. It uses UNIX sockets to inter process communication. So, you can connect as much as you want nodes to it. Just use "bobaos.sub" package to it.

                  Step-by-step tutorial can be found here: https://bobaoskit.github.io/quickstart.html

                  PS. if you are interested in development I may propose to implement knx media player.

                  Take a look at following two links:

                  1. https://www.npmjs.com/package/mympvspawn
                  2. https://www.npmjs.com/package/mympvclient

                  First will launch mpv player with exposed unix socket for IPC. Second one is a basic client. There is a lot of other options, so may take a look at them too.

                  I had an idea to use mpv to play media streams (e.g. radio stations or static media files), and control it from KNX but couldn't find enough time to implement it.

                  Thanks.

                  Kommentar


                    #10
                    Hi Vladimir,

                    I've written a wrapper for your bobaos package that will add a bobaos node into node-red.
                    So I'm able to "wire" up a logic module without or nearly without further code-writing.
                    One thing would be nice, if you could implement a "close" function, that'll properly release and close the serial port.

                    The thing is that node-red doesn't restart node-js when you "redeploy" but all variables and objects will be destroyed. So I need to create a new instance of your class, but the old instance still holds the serialport connection. So I get a "Error Resource temporarily unavailable Cannot lock port".
                    Other node-js developments using "serialport" have an implementation of the close funtion, so that you are able to reconnect.
                    It would be great if you could add this.

                    I didn't wanted to use the socket service, because I think the more layers you got, there more chance is for something going wrong.

                    Once it is tested enough I'll publish it to npm as well, so that other people can benefit from this as well.

                    Thanks and regards, Rolf
                    Zuletzt geändert von RolfMu; 17.10.2018, 14:08.

                    Kommentar


                      #11
                      Have published 2.0.10 with openSerialPort/closeSerialPort methods. Thanks for feedback.

                      More you do, more errors you will get. But you have time to debug. Unix Sockets are great IPC mechanism and they are supported by native nodejs "net" module.

                      As a bad example(in my opinion) I can say Crestron touch panels. They have great hardware, running Windows CE. They have features like great SIP support. But if you touch a button on a screen it sends signal to crestron controller over TCP/IP. If you need to switch digital join(e.g. switch subpage or make element visible) you implement it in your controller(MC3 for example) application and it sends join change to panel. If you need to make http request to get radio list for example then you implement it again in your controller app. Still, it works and a lot of people use Crestron.

                      Kommentar


                        #12
                        Thank you, works perfect now... Will test it and then publish it.

                        Funny, just talked about the bad integration with tuchpanels and controllers in crestron environment some days ago. This is realy horrible. Other funny thing about crestron, I've seen TP's that look like they have pages, but in fact the programmer worked with overlaying buttons and switched visibility. This may be easier to program, but if you have to maintain it, you get sick...

                        Kommentar


                          #13
                          Indeed, more layers brings more troubles. So, I have moved away from mypubsub(publish/subscribe service written in nodejs), deprecated it and now use Redis with Bee-Queue as a job manager and redis publish/subscribe to broadcast events. So, updated docs are located at https://bobaoskit.github.io/.

                          Now it is more stable and has more features.

                          First, I removed unnecessary methods in protocol. No more "read values". Now it depends on payload type. For multiple "get/set/read value" methods payload should be array of items.

                          Second, it has support for get server item/parameter byte methods.

                          Third, implemented algorithm for getting value of multiple datapoints. So, if you ask to get value for array of datapoints, e.g. [1, 2, 3, 5, 6, 10, 101, 102, 103, 105, 500, 530] it will send only three requests to BAOS via UART. First, for 1 and max number depending on current buffer length (probably around 40 datapoints if buffer len is 250) 1-40, second request for 100-140, and third for 500-540.

                          Kommentar


                            #14
                            Good news, everyone.

                            I'm working on accessory system and mobile application written in flutter. This project is inspired by Apple HomeKit. I used it for a while but there is no Android implementation and accessory specification is poor. To take thermostat for example. It allows you only to control thermostat mode and setpoint. You can't see devices status, like air conditioner/fancoil state, error code in case of error, etc.

                            Demo and some commentary on code:
                            https://www.youtube.com/watch?v=C7Fogh08ICc

                            All documentation can be found at:
                            https://bobaoskit.github.io/

                            Since all sources are open, there is no any specification for accessories. I implemented only switch, radio player, temperature sensor and thermostat as an example.

                            This project is in the beginning of it's path, so, if you feel able to help by any contribution, including feedback - welcome.

                            Kommentar

                            Lädt...
                            X