How do I turn on/off relay through the Serial Monitor?

Do you have a question on how to do something.
Ask in here.

Posts: 10
Joined: Mon Aug 22, 2011 7:40 pm
PostPosted: Thu Jul 19, 2018 1:29 pm
Hi, I was just wondering how to use the commands posted here viewtopic.php?f=7&t=1541&p=23677

I have the original 1st Gen RA with no wifi module and was wondering how do I send commands through the Serial Monitor to do things like turn off relays.

So far the only thing I've been able to do is simple GET commands like "GET /sr " or "GET /v " to retrieve data but im not sure how to send commands.

According to the forum post the command for turning on/off a relay is

/rxy - override relay where
x=relay
y=0 - mask off
y=1 - mask on
y=2 - auto


I've tried things like "POST /r11 " or "PUT /r11 " to turn on Relay 1 but it doesn't work. Anyone know what the proper command is?

Posts: 12306
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Jul 19, 2018 8:45 pm
GET /r11
Roberto.

Posts: 5
Joined: Wed Jan 25, 2017 5:17 am
PostPosted: Mon Jul 23, 2018 10:16 pm
Hi Im2Nelson4u,

Sorry I can't send private messages apparently.

Your message:
"Hi, I just bought a NodeMCU esp8266 module and was wondering how to wire it to the reefangel ? Do i need a converter to go from the reef angels 5v to 3.3v or can i use the VIN on the NodeMCU?"

You can't exactly use the RA to power the NodeMCU because it gets power from the microusb on the board. It's design for plug-and-play. For what you want to do I would probably get one of the other ESP8266s that need 3.3V and use a converter between the RA power and the ESP. I powered mine from the bottom pins on the RA where you'd also find the Serial In/Out pins. If you want to use the NodeMCU, just power it externally and only connect the Serial In/Out from the RA to it.

Posts: 5
Joined: Wed Jan 25, 2017 5:17 am
PostPosted: Mon Jul 23, 2018 10:39 pm
This is what I used for my wiring. Don't ask why pin 7 was 5v I don't know. Also the colours of the cables were just what I had. Note, 4 is RX and 5 is TX and this is starting from the Right Hand side as pin 1. So in your case:

NodeMCU's "TX" to RA's Pin 4 "RX"

and

NodeMCU's "RX" to RA's Pin 5 "TX"

The wiring to connect the RA to the Ethernet add-on is as follows:

RA Pin 1 (on RHS of controller) - GND (Black Cable) – to Arduino GND
RA Pin 4 - RX (Blue Cable) – to Arduino TX (Digital Pin 1)
RA Pin 5 – TX (Yellow Cable) – to Arduino RX (Digital Pin 0)
RA Pin 7 - 5V (Red Cable) – to Arduino 5V

And yes, use a microUSB cable connected to the NodeMCU to provide power. Just remember so still connect GND from the RA to the NodeMCU. One always needs a common GND with these things.

EDIT: Sorry, you may actually be able to power the NodeMCU straight form the RA using the VIN as you suggested. I take no responsibility though :)

Posts: 10
Joined: Mon Aug 22, 2011 7:40 pm
PostPosted: Tue Jul 24, 2018 12:58 am
v01d wrote:This is what I used for my wiring. Don't ask why pin 7 was 5v I don't know. Also the colours of the cables were just what I had. Note, 4 is RX and 5 is TX and this is starting from the Right Hand side as pin 1. So in your case:

NodeMCU's "TX" to RA's Pin 4 "RX"

and

NodeMCU's "RX" to RA's Pin 5 "TX"

The wiring to connect the RA to the Ethernet add-on is as follows:

RA Pin 1 (on RHS of controller) - GND (Black Cable) – to Arduino GND
RA Pin 4 - RX (Blue Cable) – to Arduino TX (Digital Pin 1)
RA Pin 5 – TX (Yellow Cable) – to Arduino RX (Digital Pin 0)
RA Pin 7 - 5V (Red Cable) – to Arduino 5V

And yes, use a microUSB cable connected to the NodeMCU to provide power. Just remember so still connect GND from the RA to the NodeMCU. One always needs a common GND with these things.

EDIT: Sorry, you may actually be able to power the NodeMCU straight form the RA using the VIN as you suggested. I take no responsibility though :)


dude your amazing everything works and is awesome, my 1st gen RA is working great with your code and the NodeMCU and i dont even need to power it thru the microusb

Posts: 5
Joined: Wed Jan 25, 2017 5:17 am
PostPosted: Wed Jul 25, 2018 3:43 pm
Awesome, glad I could help. I don't maintain that code at the moment. Hopefully someone will pick it up when it needs enhancement.

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 2 guests

cron