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. Home Assistant
  4. Enable serial debugs from the RS485 GW in the log

Enable serial debugs from the RS485 GW in the log

Scheduled Pinned Locked Moved Home Assistant
17 Posts 2 Posters 4.5k Views 3 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.
  • BartB Offline
    BartB Offline
    Bart
    wrote on last edited by
    #5

    Hm, strange but I do not see any mysensors messages shown in the log. I am seeing:

    16-09-20 22:05:29 DEBUG (Thread-2) [homeassistant.components.mysensors] InputBinary1 1 69: value_type 2, value = 0
    

    and

    16-09-20 22:40:45 INFO (Thread-2) [mysensors.mysensors] Disconnecting from /dev/ttyACM0
    

    but how to observe what is being sent out on the console line?

    1 Reply Last reply
    0
    • martinhjelmareM Offline
      martinhjelmareM Offline
      martinhjelmare
      Plugin Developer
      wrote on last edited by
      #6

      Did you set debug to true in the configuration for mysensors component?

      BartB 1 Reply Last reply
      0
      • martinhjelmareM martinhjelmare

        Did you set debug to true in the configuration for mysensors component?

        BartB Offline
        BartB Offline
        Bart
        wrote on last edited by
        #7

        @martinhjelmare yup it is set to true.

        1 Reply Last reply
        0
        • martinhjelmareM Offline
          martinhjelmareM Offline
          martinhjelmare
          Plugin Developer
          wrote on last edited by
          #8

          Have you tested that you get the expected serial output from the gateway by connecting a serial monitor while having home assistant not connected?

          BartB 1 Reply Last reply
          0
          • martinhjelmareM martinhjelmare

            Have you tested that you get the expected serial output from the gateway by connecting a serial monitor while having home assistant not connected?

            BartB Offline
            BartB Offline
            Bart
            wrote on last edited by Bart
            #9

            @martinhjelmare Yes. It actually works for the switches. I have some issues with getting the lights being shown correctly (although sending the initial values, but that's off topic :) ).

            EDIT: to be sure I've copy/pasted these sections from your post. I see mysensors.mysensors debugs and the component debugs. Just no console print outs.

            EDIT2: I need to double check it - not sure IF I am seeing any mysensors.mysensors debugs. Will do that in the evening today.

            1 Reply Last reply
            0
            • martinhjelmareM Offline
              martinhjelmareM Offline
              martinhjelmare
              Plugin Developer
              wrote on last edited by
              #10

              Please post the serial log from the gateway and the debug log from home assistant. It will be from two different runs but that is OK. If you can post a parallel serial log from a node that would be great.

              BartB 2 Replies Last reply
              0
              • martinhjelmareM martinhjelmare

                Please post the serial log from the gateway and the debug log from home assistant. It will be from two different runs but that is OK. If you can post a parallel serial log from a node that would be great.

                BartB Offline
                BartB Offline
                Bart
                wrote on last edited by
                #11

                @martinhjelmare Thanks for the suggestions.

                1 Reply Last reply
                0
                • martinhjelmareM martinhjelmare

                  Please post the serial log from the gateway and the debug log from home assistant. It will be from two different runs but that is OK. If you can post a parallel serial log from a node that would be great.

                  BartB Offline
                  BartB Offline
                  Bart
                  wrote on last edited by
                  #12

                  @martinhjelmare So unfortunately haven't had much time to spend on getting these logs yet. But one thing is sure. The domoticz mysensors connection works flawlessly. I am able to see all the sensors, all of them are correctly updated in the domoticz on sketch start up, no events are lost (did same test doing quickly switch toggling from the GUI and from the sketch, same tests on HA were often missing the events). So there's got to be some problem with HA module.

                  So the bottom line - logs are needed :)

                  So do I understand correctly that with the above logs setting I should be able to see the serial transmissions in the HA log? I will try to obtain the serial port data with something like this: http://unix.stackexchange.com/questions/12359/how-can-i-monitor-serial-port-traffic but it would be ideal to figure out why these debugs are not there in the first place. Can I make some changes to the module and force the debug (in the python source file)?

                  1 Reply Last reply
                  0
                  • martinhjelmareM Offline
                    martinhjelmareM Offline
                    martinhjelmare
                    Plugin Developer
                    wrote on last edited by martinhjelmare
                    #13

                    I haven't tested the RS485 gateway so I can't say how much it prints to serial. I know that the regular serial gateway prints received messages to serial. The ethernet based gateways will not do this of course.

                    It's up to the controller how it implements the mysensors API, so each controller can have different requirements. You can't be sure that your setup works for all controllers just because it works for one. You could be experiencing a bug in home assistant or pymysensors, but it's hard to tell without further information. When we see the logs we will know more.

                    Edit:
                    Can't you use Arduino IDE and its serial monitor? First make a run without home assistant. Monitor both gateway and node at the same time with two IDE instances.

                    Then disconnect IDE from gateway and connect home assistant instead and do a second run.

                    1 Reply Last reply
                    0
                    • BartB Offline
                      BartB Offline
                      Bart
                      wrote on last edited by
                      #14

                      There's no difference between Serial GW and Serial GW with RS485 transport. It is just a matter of not using RF transport. So on the serial console side the communication is the same.

                      1 Reply Last reply
                      0
                      • BartB Offline
                        BartB Offline
                        Bart
                        wrote on last edited by Bart
                        #15

                        Just a FYI if anyone else will stuck trying to enable this. There's no debug print out for the serial connection in pymysensors as it appears. You need to add the debugs in the code on your own.

                        Here's the diff:

                        --- mysensors/mysensors.py.orig	2016-11-19 17:51:39.000000000 +0100
                        +++ mysensors/mysensors.py	2016-11-19 18:27:43.705631204 +0100
                        @@ -483,6 +483,7 @@
                                             'Error decoding message from gateway, '
                                             'probably received bad byte.')
                                         continue
                        +            _LOGGER.debug('Received %s', string.rstrip())
                                     self.fill_queue(self.logic, (string,))
                                 self.disconnect()  # Disconnect after stop event is set
                         
                        @@ -492,6 +493,7 @@
                                     return
                                 # Lock to make sure only one thread writes at a time to serial port.
                                 with self.lock:
                        +            _LOGGER.debug('Sending %s', message.rstrip())
                                     self.serial.write(message.encode())
                         
                         
                        
                        martinhjelmareM 1 Reply Last reply
                        0
                        • BartB Bart

                          Just a FYI if anyone else will stuck trying to enable this. There's no debug print out for the serial connection in pymysensors as it appears. You need to add the debugs in the code on your own.

                          Here's the diff:

                          --- mysensors/mysensors.py.orig	2016-11-19 17:51:39.000000000 +0100
                          +++ mysensors/mysensors.py	2016-11-19 18:27:43.705631204 +0100
                          @@ -483,6 +483,7 @@
                                               'Error decoding message from gateway, '
                                               'probably received bad byte.')
                                           continue
                          +            _LOGGER.debug('Received %s', string.rstrip())
                                       self.fill_queue(self.logic, (string,))
                                   self.disconnect()  # Disconnect after stop event is set
                           
                          @@ -492,6 +493,7 @@
                                       return
                                   # Lock to make sure only one thread writes at a time to serial port.
                                   with self.lock:
                          +            _LOGGER.debug('Sending %s', message.rstrip())
                                       self.serial.write(message.encode())
                           
                           
                          
                          martinhjelmareM Offline
                          martinhjelmareM Offline
                          martinhjelmare
                          Plugin Developer
                          wrote on last edited by
                          #16

                          @Bart

                          If you make a pull request we can add this to the upstream repo.

                          BartB 1 Reply Last reply
                          0
                          • martinhjelmareM martinhjelmare

                            @Bart

                            If you make a pull request we can add this to the upstream repo.

                            BartB Offline
                            BartB Offline
                            Bart
                            wrote on last edited by
                            #17

                            @martinhjelmare thanks. I am still not really good at git kung-fu to do it quickly. will try to do the PR when I have some spare time :)

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


                            11

                            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