please help , rs485 and NO REPLY error

  • hi friends
    i promise if i found a solution for this problem so i will not put any topic and sad you 😞
    please help . i have problem with wireless network and can not solve , so i buy rs485 module until change my network to wiring. this is last my hope please help
    now i use a raspberrypi 3 and domoticz and build a serial rs485 gateway (connect with usb cable) this is wiring:

    A for module1 = A for module 2
    B for module1 = B for module 2
    GND for module1 = GND for module 2 (for test)
    sketch for gateway :

    * The MySensors Arduino library handles the wireless radio link and protocol
    * between your home built sensors/actuators and HA controller of choice.
    * The sensors forms a self healing radio network with optional repeaters. Each
    * repeater and gateway builds a routing tables in EEPROM which keeps track of the
    * network topology allowing messages to be routed to nodes.
    * Created by Henrik Ekblad <>
    * Copyright (C) 2013-2015 Sensnology AB
    * Full contributor list:
    * Documentation:
    * Support Forum:
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * version 2 as published by the Free Software Foundation.
    * The RS485 Gateway prints data received from sensors on the serial link.
    * The gateway accepts input on seral which will be sent out on
    * the RS485 link.
    * Wire connections (OPTIONAL):
    * - Inclusion button should be connected between digital pin 3 and GND
    * - RX/TX/ERR leds need to be connected between +5V (anode) and digital pin 6/5/4 with resistor 270-330R in a series
    * LEDs (OPTIONAL):
    * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
    * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
    * - ERR (red) - fast blink on error during transmission error or recieve crc error
    * If your Arduino board has additional serial ports
    * you can use to connect the RS485 module.
    * Otherwise, the gateway uses AltSoftSerial to handle two serial
    * links on one Arduino. Use the following pins for RS485 link
    *  Board          Transmit  Receive   PWM Unusable
    * -----          --------  -------   ------------
    * Teensy 3.0 & 3.1  21        20         22
    * Teensy 2.0         9        10       (none)
    * Teensy++ 2.0      25         4       26, 27
    * Arduino Uno        9         8         10
    * Arduino Leonardo   5        13       (none)
    * Arduino Mega      46        48       44, 45
    * Wiring-S           5         6          4
    * Sanguino          13        14         12
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    // Enable RS485 transport layer
    #define MY_RS485
    #define MY_NODE_ID 0 //for test
    // Define this to enables DE-pin management on defined pin
    #define MY_RS485_DE_PIN 2
    // Set RS485 baud rate to use
    #define MY_RS485_BAUD_RATE 9600
    // Enable this if RS485 is connected to a hardware serial port
    //#define MY_RS485_HWSERIAL Serial1
    // Enable serial gateway
    // Enable inclusion mode
    // Enable Inclusion mode button on gateway
    // Set inclusion mode duration (in seconds)
    // Digital pin used for inclusion mode button
    // Set blinking period
    // Flash leds on rx/tx/err
    #define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
    #define MY_DEFAULT_RX_LED_PIN  5  // Receive led pin
    #define MY_DEFAULT_TX_LED_PIN  6  // the PCB, on board LED
    #include <MySensors.h>
    void setup()
    	// Setup locally attached sensors
    void presentation()
    	// Present locally attached sensors
    void loop()
    	// Send locally attached sensor data here

    and for nodes add this line:

    #define MY_RS485
    #define MY_NODE_ID   X
    #define MY_RS485_DE_PIN 2
    #define MY_RS485_BAUD_RATE 9600

    now my problem:
    most time i have this error and any nodes can not connect to gateway.

    3 TSM:INIT
    4 TSF:WUR:MS=0
    9 TSF:SID:OK,ID=1
    10 TSM:FPAR
    28 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2037 TSM:FPAR
    2055 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4065 TSM:FPAR
    4082 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6092 TSM:FPAR
    6110 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8118 !TSM:FPAR:FAIL
    8119 TSM:FAIL:CNT=1
    8121 TSM:FAIL:PDT

    but with many reset (nodes and gateway) and power off/on and change adapter , some time suddenly nodes connect to gateway. very test it , once this was very good and connect and all command send and ack . but very time command can not send or send and can not ack.
    i test this :
    change adapter - connect gnd module1 to gnd module2 - use node id static for gateway(0) and other nodes - change wiring (long and short wire) - remove incloution mode from gateway.
    please help . please 😞

  • i can not understand why some time suddenly node can connect to gateway .
    perhaps this is related to synchronize ! 😞

  • some time after detect nodes and relay , work perfect and all command send and ack very fast . also when send quick command any command dont fail... but some time after detect or can not detect nodes and connection or after detect more command is fail.... please help me

  • Mod

    Are you sure it's not a cable issue? Like type of the cable, termination, shield grounding if present... Did you make test with short cables?

  • @gohan
    yes i test with other wire and modules...
    this is strange !! with long wire can not work never. with 15cm wire work on some controller well . some time work well on laptop ! some time work well on raspberry

    for example yesterday work well on labtop and dont work well on raspberry, i turn off/on and today test again ! and i see new dont work on laptop and work well on rasberry!

  • Mod

    Just to clarify, what kind of cable are you using? Did you terminate the cable with resistor?

  • @gohan use 3 type of cable. 30meter "cat 6" . 1 meter "Two strings twisted" and 15cm "jumper"
    i test with 1k ohm in terminate but effectless.
    there is several problem. one about about different controller.
    now i test ! on raspberry . gate way now work on this . but first command can not action(gateway and node after 2 blink turn on light ! so i remove gateway from controller and disconnect this and connect again and define for controller and add again relay. so i see now work with one command ( one blink) !
    again disconnect from raspberry and before connect to laptop , remove gateway from laptop ! then connect gateway to labtop and add this to controller then add relay but relay can not added to gateway and i see NO REPLAY ....
    so again disconnect from laptop and connect to raspberry then i see work again well !

  • i am testing this on 4 model of controller ! ( 2 raspberry - 1orangepi -1 laptop)
    i test with same arduino same wire same max485 module and same sketch and same usb serial cable

Log in to reply

Suggested Topics

  • 3
  • 2
  • 4
  • 2
  • 2
  • 24