Unable to Send Commands to RFLink

Moderators: rtenklooster, Voyager, BertB, Stuntteam

Post Reply
Message
Author
RichieRogers1972
New user
Posts: 3
Joined: 09 May 2023, 18:06

Unable to Send Commands to RFLink

#1 Post by RichieRogers1972 » 09 May 2023, 18:15

Hi,
I've got an RFLink that can successfully send and receive signals for various 433MHz items in RFLinkLoader.
However, trying to use Python (a library python-rflink, I think) or pySerial I can receive signals, but send doesn't do anything (no error, but device not triggered - tried with blinds and a remote that sends to a different RF433 device plugged into my OpenHab system).
I've also tried on a Raspberry Pi running Ubuntu and get the same; working receive, not working send.
Can anyone suggest what I'm missing in trying to send direct to the "com" port?
I'm presuming some sort of formatting or CR/LF is missing, although I have tried adding various combinations of \n \r without success.

Thanks in advance for any help.

Richie

User avatar
Stuntteam
Site Beheer
Posts: 789
Joined: 27 Jan 2016, 16:46

Re: Unable to Send Commands to RFLink

#2 Post by Stuntteam » 09 May 2023, 19:20

It for sure needs cr/lf on commands..
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

RichieRogers1972
New user
Posts: 3
Joined: 09 May 2023, 18:06

Re: Unable to Send Commands to RFLink

#3 Post by RichieRogers1972 » 09 May 2023, 21:20

Hi,
Yeah, I thought as much, but not found a way to make it work in Python.
Have just had some success with miniterm:
miniterm [/dev/ttyUSB0] 57600 -e --eol CRLF
Pasting in any of these does work for one of my blinds:
10;BofuMotor;e20202;03;DOWN;
10;BofuMotor;e20202;03;UP;
10;BofuMotor;e20202;03;STOP;

So, I just need to work out how to get pySerial to do it.

Code: Select all

import serial
ser = serial.Serial("/dev/ttyUSB0",57600,timeout=2)
# none of these work
ser.write(b'10;BofuMotor;e20202;03;DOWN;')
ser.write(b'10;BofuMotor;e20202;03;DOWN;\n')
ser.write(b'10;BofuMotor;e20202;03;DOWN;\r\n')

ser.flush()
ser.close()
Any idea what else I can try?

Thanks,
Richie

RichieRogers1972
New user
Posts: 3
Joined: 09 May 2023, 18:06

Re: Unable to Send Commands to RFLink

#4 Post by RichieRogers1972 » 09 May 2023, 21:34

Hi,
After some "playing around" I've got it to work, but is a bit strange.
This works:

Code: Select all

import serial
ser = serial.Serial("/dev/ttyUSB0",57600,timeout=2)
ser.readline() # this just before the "write" makes it work
ser.write(b'10;BofuMotor;e20202;03;DOWN;\r\n')

ser.flush()
ser.close()
Is this how it's supposed to work?

Thanks,
Richie

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests