Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Bart
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Bart

    @Bart

    2
    Reputation
    36
    Posts
    799
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Bart Follow

    Best posts made by Bart

    • RE: RS485/RS232/Serial transport class for mysensors.org

      @hek
      I will do the schematic once I solve all issues as I am still losing events while connected to Home Assistant. Need to check whether it is because of pymysensors library (Home Assistant side) or if there is still some GW <-> Sensors problem. At this moment my Sensors board has around 48 binary states one can set/read from the controller and at the same time they are changeable via input pins (falling edge toggles the switch).

      To give a quick overview of my setup:

      2 x (MEGA 2560 + RS485 module)
      alt text

      I have the following connections for each mega+rs485 module:

      • +5/GND connected to respective pins on rs485 module
      • D2 connected to RE/DE
      • D18 <-> RO
      • D19 <-> DI

      The A and B lines are connected to each other. (A-A, B-B). And most importantly I am using the above mentioned minor change in the MyTransportRS485.cpp to replace altSoftSerial with Serial1 (https://forum.mysensors.org/topic/1947/rs485-rs232-serial-transport-class-for-mysensors-org/99)

      and just if anyone would like to try it here's the config I am using:

      // Gateway:
      #define MY_RS485
      #define MY_RS485_DE_PIN 2
      #define MY_RS485_BAUD_RATE 9600
      #define MY_GATEWAY_SERIAL
      // below not official for getting the Serial1
      #define MY_RS485_SERIAL Serial1
      
      // Sensor node
      #define MY_DEBUG
      #define MY_RS485
      #define MY_RS485_DE_PIN 2
      #define MY_RS485_BAUD_RATE 9600
      // below not official for getting the Serial1
      #define MY_RS485_SERIAL Serial1
      
      posted in Development
      Bart
      Bart
    • RE: Enable serial debugs from the RS485 GW in the log

      @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 🙂

      posted in Home Assistant
      Bart
      Bart

    Latest posts made by Bart

    • RE: Sensor naming problem

      @nick-willis I have the same problem.

      Up till now I was doing a simple hack that changed the naming of the sensors to the description field. Would be good to have an option to use just the description for sensors that have them meaningful and usable. I guess that would be a good topic for HA forum of this extension...

      posted in Home Assistant
      Bart
      Bart
    • RE: Enable serial debugs from the RS485 GW in the log

      @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 🙂

      posted in Home Assistant
      Bart
      Bart
    • RE: Enable serial debugs from the RS485 GW in the log

      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())
       
       
      
      posted in Home Assistant
      Bart
      Bart
    • RE: 💬 MYSController

      Is it possible to use this app when using RS485 transport? I have one of these usb (ftdi based) adapters connected with 2 Arduino MEGA on a RS485 bus:

      http://www.banggood.com/USB-To-RS485-TTL-Serial-Converter-Adapter-FTDI-Interface-FT232RL-75176-p-961537.html

      Tried it but I don't see any messages. Connecting serial monitor does show a traffic.

      posted in Announcements
      Bart
      Bart
    • RE: RS485/RS232/Serial transport class for mysensors.org

      @hek ok. all good now - the ping pong example working. I forgot about the gateway flag.

      BTW, checked to see if the GW has any issues without PR 599 but it seems it is still working OK. I have not changed the HW connections so must be some other change.

      posted in Development
      Bart
      Bart
    • RE: RS485/RS232/Serial transport class for mysensors.org

      I am wondering if a node-2-node communication should be working. I have compiled the ping/pong example for RS485 but it appears the nodes are not communicating.

      posted in Development
      Bart
      Bart
    • RE: RS485/RS232/Serial transport class for mysensors.org

      @hek I will try to check if this change did it.

      posted in Development
      Bart
      Bart
    • RE: RS485/RS232/Serial transport class for mysensors.org

      @hek Looks like something has been fixed in regards to altSoftSerial. Today I've pulled latest development and everything works fine. The gateway has no problem finding nodes and all messages reach their destinations.

      posted in Development
      Bart
      Bart
    • RE: RS485/RS232/Serial transport class for mysensors.org

      @karlheinz2000 Are any of your boards using AltSoftSerial instead of HW serial? I was not able to get a reliable connection with software serial library....

      posted in Development
      Bart
      Bart
    • RE: RS485/RS232/Serial transport class for mysensors.org

      @karlheinz2000
      Yes. Got it working with this patch. Although not reliably when other board was using the altsoftserial.

      posted in Development
      Bart
      Bart