Send CMD For RFlink+Mega2560

Moderators: rtenklooster, Voyager, BertB, Stuntteam

Post Reply
Message
Author
bluemoon39
New user
Posts: 2
Joined: 22 Jan 2018, 17:21

Send CMD For RFlink+Mega2560

#1 Post by bluemoon39 » 22 Jan 2018, 17:34

Hi, I am new to RFlink and also Arduino. I am trying to use Mega2560 to listen to a specific Infrared signal and then send an pre-assigned RF 433mhz signal. My problem is the RF portion.

1. I managed to learn the RF 433mhz signal using "RFLink Loader.exe" (20;29;BrelMotor;ID=770518;SWITCH=21;CMD=STOP;) on my PC.
2. I am able to send this command (10;BrelMotor;770518;21;STOP;) using "RFLink Loader.exe" and the equipment works.

Now I need to hardcode this inside my Mega2560 and I am not sure how to SEND the (10;BrelMotor;770518;21;STOP;) using Mega2560. Any kind soul can guide me please? Thanks.

aciim
New user
Posts: 5
Joined: 21 Jan 2018, 15:02

Re: Send CMD For RFlink+Mega2560

#2 Post by aciim » 24 Jan 2018, 08:20

AFAIK RFLink is a tool to be used from outside using its own protocol http://www.rflink.nl/blog2/protref. As it says on that page:
"Data is send serial (via USB) as "text" at a speed of 57600 baud (N,8,1) It is sufficient for a server to open a port and listen to the RFLink data. Each incoming text line contains information about data that has been received via RF signals. In order to talk back to RFLink to issue RF commands or to make changes to settings, a text line has to be send that is terminated with CR/LF."
So attach your Mega to Raspberry Pi running Domoticz or Home Assistant or any other automation tool. (Search for "Supported Automation software" at http://www.rflink.nl/blog2/faq) Or you can send those serial commands straight to Megas port as all those automation softwares actually do...

OR you can also use RFLink through network http://www.rflink.nl/blog2/faq#Network

bluemoon39
New user
Posts: 2
Joined: 22 Jan 2018, 17:21

Re: Send CMD For RFlink+Mega2560

#3 Post by bluemoon39 » 24 Jan 2018, 13:41

Thanks alot for the reply. The RFLink Loader has a "send command" function where i can send my (10;BrelMotor;770518;21;STOP;). Now instead of using RFLink Loader, I wish to know how to send this message in arduino? using command line like digitalwrite()? serial.write()?

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: Send CMD For RFlink+Mega2560

#4 Post by wim16 » 24 Jan 2018, 17:44

Well, that's just what the Rflink firmware on the Arduino is doing for you. Arduino can not do it on it's own.

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

Re: Send CMD For RFlink+Mega2560

#5 Post by Stuntteam » 25 Jan 2018, 00:09

If you have a second Mega that connects to the Arduino you can send such commands though..
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

aciim
New user
Posts: 5
Joined: 21 Jan 2018, 15:02

Re: Send CMD For RFlink+Mega2560

#6 Post by aciim » 29 Jan 2018, 08:32

So to call RFLink yourself directly use any serial port terminal as it says in http://www.rflink.nl/blog2/development

Here is how (one way).

0. Install Python and PIP if somehow it is not already in your system

https://www.python.org/downloads/
https://pip.pypa.io/en/stable/installing/

1. Install miniterm.py (PySerial)

Code: Select all

python -m pip install pyserial
2. Then attach Arduino to your USB-port and connect to it calling

Code: Select all

miniterm.py [YOUR/USB-DEVICE] 57600 -e --eol CRLF
As in my Mac having Ceecreit Arduino Mega (Not a genuine, so it uses Virtual Com Port drivers from http://www.ftdichip.com/Drivers/VCP.htm

then the command line is

Code: Select all

miniterm.py /dev/cu.usbmodem1461 57600 -e --eol CRLF
3. Send your command as you did...

4. Close the connection by pressing CTRL-[ (And it is by the layout not char. So ex. in scandinavian keyboard it is ctrl-å)

https://superuser.com/questions/398/how ... x-terminal

**
To use all this automatically: program your own client to do what ever you like RFLink to do OR you can use home automation softwares to do all the heavy lifting.
**

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests