Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. pimatic
  4. pimatic-mysensors controller plugin

pimatic-mysensors controller plugin

Scheduled Pinned Locked Moved pimatic
controllernode idnrf24l01+mysensorsrasp
92 Posts 23 Posters 56.0k Views 11 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fredrik Carlsson
    wrote on last edited by Fredrik Carlsson
    #49

    @funky81
    Hello. I have had a hard time testing this. Is the future for the pulsesensor implemented in 0.8.17 official plugin?

    If not, how get the latest commit in to pimatic? Have tried to git clone the plugin and then npm install inside the folder, but then none of the sensors shows up in pimatic (the plugin is not active)

    With official 0.8.17 the arduino sketch just come in to an endless loop where it wants the latest pulsecount = no answer from pimatic

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Panos
      wrote on last edited by
      #50

      Hello,

      Very nice plugin.

      Is there any chance in the future to support the ethernet gateway?

      It would be great if we could connected simultaneously to a serial and ethernet gateway from the same pimatic server.
      so we could cover remote places..!!!!

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dheeraj
        Plugin Developer
        wrote on last edited by
        #51

        New version of plugin available. 0.8.21.

        and a video to showcase its capability..

        https://www.youtube.com/watch?v=ZZXAKitvAdA

        OitzuO 1 Reply Last reply
        1
        • D Dheeraj

          New version of plugin available. 0.8.21.

          and a video to showcase its capability..

          https://www.youtube.com/watch?v=ZZXAKitvAdA

          OitzuO Offline
          OitzuO Offline
          Oitzu
          wrote on last edited by
          #52

          @Dheeraj
          Nice! One question: Could you maybe disconnect your repository from pimatic-plugin-template?
          http://stackoverflow.com/questions/16052477/delete-fork-dependency-of-a-github-repository

          With the fork connected its hard to fork. ;)

          D 1 Reply Last reply
          0
          • OitzuO Oitzu

            @Dheeraj
            Nice! One question: Could you maybe disconnect your repository from pimatic-plugin-template?
            http://stackoverflow.com/questions/16052477/delete-fork-dependency-of-a-github-repository

            With the fork connected its hard to fork. ;)

            D Offline
            D Offline
            Dheeraj
            Plugin Developer
            wrote on last edited by
            #53

            @Oitzu sure will do it need some time..

            1 Reply Last reply
            0
            • karl261K Offline
              karl261K Offline
              karl261
              wrote on last edited by karl261
              #54

              Hi, I am using the mysensors-pimatic system and it works great. Now, I am using an optocoupler to simulate some buttons being pressend, and at the moment I am using the relay sketch for that. That works great, but it gives me on/off switches in pimatic. However, I only press the button momentarily. So I would need more a momentary button in pimatic. Something that does not switch but I still can press. So three questions:

              1. Is there a way to have an "ordinary" button in pimatic (not on/off)? Something I press only? This on/off switch works (everytime I switch on or off it simulates on button pressed on my optocoupler), but it is not really what I am looking for.
              2. Is there some code for a momentary button in mysensors? The relay code I am using works great. I adapted in a way that it swtiches the optocoupler on and 50ms later automatically off. Works great, but I was wondering if there was a more elegant way to do it.
              3. If there is no code for a momentary button for pimatic, where would I start looking if I'd want to contribute code?

              Cheers!

              D 1 Reply Last reply
              0
              • OitzuO Offline
                OitzuO Offline
                Oitzu
                wrote on last edited by
                #55

                Hey karl261,

                1.) Yes there is a ordinary button in pimatic. The base-class is called "ButtonsDevice" if i remember correctly.
                2.) The MySensors Plugin also seems to implement this.
                See: https://github.com/DheerajKhajuria/pimatic-mysensors
                Search for: Binary Button
                3.) Depends at which point you want to contribute code.
                For the mysensors plugin: https://github.com/DheerajKhajuria/pimatic-mysensors
                For the Pimatic framework: https://github.com/pimatic/pimatic
                Make also sure to read the howto @ www.pimatic.org and visit the forum forum.pimatic.org.

                1 Reply Last reply
                0
                • karl261K karl261

                  Hi, I am using the mysensors-pimatic system and it works great. Now, I am using an optocoupler to simulate some buttons being pressend, and at the moment I am using the relay sketch for that. That works great, but it gives me on/off switches in pimatic. However, I only press the button momentarily. So I would need more a momentary button in pimatic. Something that does not switch but I still can press. So three questions:

                  1. Is there a way to have an "ordinary" button in pimatic (not on/off)? Something I press only? This on/off switch works (everytime I switch on or off it simulates on button pressed on my optocoupler), but it is not really what I am looking for.
                  2. Is there some code for a momentary button in mysensors? The relay code I am using works great. I adapted in a way that it swtiches the optocoupler on and 50ms later automatically off. Works great, but I was wondering if there was a more elegant way to do it.
                  3. If there is no code for a momentary button for pimatic, where would I start looking if I'd want to contribute code?

                  Cheers!

                  D Offline
                  D Offline
                  Dheeraj
                  Plugin Developer
                  wrote on last edited by
                  #56

                  @karl261 using ButtonsDevice as mentioned by Oitzu, you can achieve the point no. 1 . non off/on switch..

                  upload-9622ca50-7f41-488d-b9db-64391bbf0479

                  
                  {
                        "id": "mode",
                        "name": "TV Mode",
                        "class": "ButtonsDevice",
                        "buttons": [
                          {
                            "id": "PVR",
                           "text": "PVR"
                          },
                          {
                            "id": "HTPC",
                            "text": "HTPC"
                          },
                          {
                            "id": "Chromecast",
                            "text": "Chromecast"
                          },
                          {
                            "id": "testing",
                            "text": "RainBowCycle"
                          },
                        ]
                      },
                  
                  
                  
                  

                  for point no. 2 you can use pimatic IFTTT rules to control (*hidden * relay switch button) moreover you can switch off optocoupler after 50 ms using rules.

                  1. if you have some special requirement you are welcome to contribute..
                  1 Reply Last reply
                  0
                  • karl261K Offline
                    karl261K Offline
                    karl261
                    wrote on last edited by
                    #57

                    Hi guys. Thanks for the replies. This seems to work. I created a button and made a rule "if button XY pressed then toggle AB". So I suppose I leave the relay device as is, just remove it from my pimatic page (out of sight) and move in the button instead. IS that right?

                    Very cool indeed!

                    1 Reply Last reply
                    0
                    • karl261K Offline
                      karl261K Offline
                      karl261
                      wrote on last edited by
                      #58

                      Hi there, I have problem that appears recently. I hope somebody can point me in the right direction.

                      I had my setup running for the past two weeks without any problems. No changes in hardware. Now the following happened:

                      Suddenly out of nowhere pimatic stop transmitting/receiving. Just like this. No error message. Pimatic frontend working finde. But no data going out to or coming in from the serial gateway.

                      I checked all logs: Nothing. I re-started pimatic: No success. All logs normal. I restarted the pi2: Nothing. All logs normal. I unplugged/replugged the arduino nano: Nothing. No success.

                      Then I shutdown the pi2, I pulled the power cable, I put it back in and voila: Everything worked normally. Still nothing in any logs. Unfortunately, now about 24h later, the same issue.

                      What is happening there? How can I debug that? I also tried resetting the usb:

                      echo 0 > /sys/bus/usb/devices/1-1.5/authorized
                      echo 1 > /sys/bus/usb/devices/1-1.5/authorized
                      Nothing.

                      What can I do? Why was it running perfectly for two weeks?

                      I changed back to a super simple pimatic config with just one device, but still the same issues.

                      What to do? Please advice!

                      1 Reply Last reply
                      0
                      • OitzuO Offline
                        OitzuO Offline
                        Oitzu
                        wrote on last edited by
                        #59

                        @karl261 said:

                        I checked all logs: Nothing. I re-started pimatic: No success. All logs normal. I restarted the pi2: Nothing. All logs normal. I unplugged/replugged the arduino nano: Nothing. No success.

                        What can I do? Why was it running perfectly for two weeks?

                        What to do? Please advice!

                        Hi there! Spontaneously i have no idea what could be going wrong, only chance is to narrow down the problem.
                        Based on your writing i assume you are using the serial gateway to interface with the mysensors network?
                        Did you try to enable the debug output in pimatic?
                        You could try to stop pimatic, detach usb, attach usb and look directly with screen on the serial device what the gateway is doing.

                        screen <device>
                        
                        1 Reply Last reply
                        0
                        • karl261K Offline
                          karl261K Offline
                          karl261
                          wrote on last edited by
                          #60

                          This is the only thing I see in the screen

                          0;0;3;0;9;gateway started, id=0, parent=0, distance=0
                          0;0;3;0;14;Gateway startup complete.
                          

                          Then nothing else. No signal recieved, even if I now my sensors are sending, but also, when I am sending something via pimatic, no send message.

                          1 Reply Last reply
                          0
                          • OitzuO Offline
                            OitzuO Offline
                            Oitzu
                            wrote on last edited by
                            #61

                            @karl261 maybe a defect nrf24 module? The serial connection to the nano seems to work and should normaly show received messages.
                            Do you have any spare modules laying arround?

                            1 Reply Last reply
                            0
                            • karl261K Offline
                              karl261K Offline
                              karl261
                              wrote on last edited by
                              #62

                              @Oitzu that is possible. And also weird. It was working for three weeks without problem. Is there no way to get an error message from the nrf24? Why does it work after unplugging the pi? Why does it not help to reset the sub bus, which should power cycle the nano and the radio module?
                              I have some nrf24 around, but the installation is in a remote place which I can only access from time to time. That's why I installed mysensors and piratical in the first place. To remote control some things. So three weeks before I can try another radio. I hoped I could reset the system somehow to be able to use my system in the meantime...

                              OitzuO 1 Reply Last reply
                              0
                              • karl261K karl261

                                @Oitzu that is possible. And also weird. It was working for three weeks without problem. Is there no way to get an error message from the nrf24? Why does it work after unplugging the pi? Why does it not help to reset the sub bus, which should power cycle the nano and the radio module?
                                I have some nrf24 around, but the installation is in a remote place which I can only access from time to time. That's why I installed mysensors and piratical in the first place. To remote control some things. So three weeks before I can try another radio. I hoped I could reset the system somehow to be able to use my system in the meantime...

                                OitzuO Offline
                                OitzuO Offline
                                Oitzu
                                wrote on last edited by
                                #63

                                @karl261 said:

                                @Oitzu that is possible. And also weird. It was working for three weeks without problem. Is there no way to get an error message from the nrf24? Why does it work after unplugging the pi? Why does it not help to reset the sub bus, which should power cycle the nano and the radio module?
                                I have some nrf24 around, but the installation is in a remote place which I can only access from time to time. That's why I installed mysensors and piratical in the first place. To remote control some things. So three weeks before I can

                                Well i can only guess whats the problem or whats the reason to it.
                                A faulty device can fail at the first day or just after 3 weeks.
                                The mysensors libs will check at start time the communication with the nrf24 module. If the communication don't work it will give out a "check wires" instead of the "Gateway startup complete.".

                                Maybe the difference between the full power cycle and the nano power cycle is the duration of the power cycle?
                                I can guess that the full power cycle left the nrf24 module for a longer time without power?
                                A longer power down of the nano would result in more time for the caps to discharge?

                                1 Reply Last reply
                                0
                                • karl261K Offline
                                  karl261K Offline
                                  karl261
                                  wrote on last edited by karl261
                                  #64

                                  @Oitzu thanks a lot for your help. I appreciate it.

                                  Some more observations:

                                  • If I reboot the pi, I get
                                  0;0;3;0;9;gateway started, id=0, parent=0, distance=0
                                  0;0;3;0;14;Gateway startup complete.
                                  

                                  in the screen session.

                                  • However, if I do
                                  echo '1-1.5' > /sys/bus/usb/drivers/usb/unbind
                                  echo '1-1.5' > /sys/bus/usb/drivers/usb/bind
                                  

                                  which should power cycle the usb device I do not see anything in the screen session. Which means that the arduino nano was not power cycled.

                                  However I do see that something happened in the log file:

                                  Nov 12 17:31:40 raspberrypi kernel: [  300.831131] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
                                  Nov 12 17:31:40 raspberrypi kernel: [  300.839881] ftdi_sio 1-1.5:1.0: device disconnected
                                  Nov 12 17:31:46 raspberrypi kernel: [  306.271337] ftdi_sio 1-1.5:1.0: FTDI USB Serial Device converter detected
                                  Nov 12 17:31:46 raspberrypi kernel: [  306.278553] usb 1-1.5: Detected FT232RL
                                  Nov 12 17:31:46 raspberrypi kernel: [  306.283631] usb 1-1.5: FTDI USB Serial Device converter now attached to ttyUSB0
                                  

                                  So, what does it mean? I don't understand. Maybe there is something wrong with the pi's USB hub? Which is only reset when I pull the plug? But then the wifi should also not work, because it is sitting on the same USB hub.

                                  /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
                                      |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
                                          |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
                                          |__ Port 4: Dev 4, If 0, Class=Vendor Specific Class, Driver=rtl8192cu, 480M
                                          |__ Port 5: Dev 5, If 0, Class=Vendor Specific Class, Driver=ftdi_sio, 12M
                                  

                                  I really don't like that there is no error message nowhere...

                                  Is there any other place I could ask for help?

                                  1 Reply Last reply
                                  0
                                  • karl261K Offline
                                    karl261K Offline
                                    karl261
                                    wrote on last edited by
                                    #65

                                    Ok, so I found a way to reset the usb bus using hub-ctrl.c. There is interesting information here:
                                    https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=93463
                                    https://github.com/codazoda/hub-ctrl.c
                                    https://www.raspberrypi.org/forums/viewtopic.php?t=71044&p=513908
                                    http://raspberrypi.stackexchange.com/questions/27903/usb-power-cycling-problem
                                    So, in my case I can issue the command

                                    ./hub-ctrl -h 0 -P 5 -p 0 ; sleep 3; ./hub-ctrl  -h 0 -P 5 -p 1
                                    

                                    and it does indeed reset the right port, because if I open now the screen sessoin I get the usual

                                    0;0;3;0;9;gateway started, id=0, parent=0, distance=0
                                    0;0;3;0;14;Gateway startup complete.
                                    

                                    BUT: Still the thing is not sending receiving anything. WHY?

                                    1 Reply Last reply
                                    0
                                    • OitzuO Offline
                                      OitzuO Offline
                                      Oitzu
                                      wrote on last edited by
                                      #66

                                      Tried to extend the sleep between power down and up?

                                      1 Reply Last reply
                                      0
                                      • karl261K Offline
                                        karl261K Offline
                                        karl261
                                        wrote on last edited by
                                        #67

                                        Yes, I also tried with 30 seconds. Longer?

                                        1 Reply Last reply
                                        0
                                        • OitzuO Offline
                                          OitzuO Offline
                                          Oitzu
                                          wrote on last edited by
                                          #68

                                          Well.. i think you can't lose anything. :D
                                          Will be hard to debug after that without access to the actual hardware.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          14

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular