Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Updating sketch for power plug RF
#1
Hi!!
I want to use a 5 ports power plug RF .

I test the library Rc-Swicth and i can turn on and off every plug with out problems.

Here's library: https://github.com/sui77/rc-switch

The problem its when i try to update the robo tank Controller sketch with the RF sketch.

Only when i add this 2 lines , before void setup , crash

#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();

This its the error that arduino Ide show...
Code:
Arduino:1.6.5 (Windows 8.1), TD: 1.41, Placa:"Arduino Due (Programming Port)"

Controller:104: error: variable or field 'SendOKpage2' declared void
Controller:104: error: 'EthernetClient' was not declared in this scope
Controller:104: error: 'client' was not declared in this scope
Controller:105: error: variable or field 'SendAuthentificationpage' declared void
Controller:105: error: 'EthernetClient' was not declared in this scope
Controller:105: error: 'client' was not declared in this scope
Controller:106: error: variable or field 'XML_response' declared void
Controller:106: error: 'EthernetClient' was not declared in this scope
Controller.ino: In function 'void loop()':
Controller:1402: error: 'SendOKpage2' was not declared in this scope
Controller:1409: error: 'SendAuthentificationpage' was not declared in this scope
Controller.ino: In function 'void SendOKpage2(EthernetClient&)':
Controller:3264: error: 'XML_response' was not declared in this scope
variable or field 'SendOKpage2' declared void
Its very strange because lines 104, 105, 106 are:
DHT dht1(sensor2Pin, DHTTYPE);
DHT dht2(sensor4Pin, DHTTYPE);
DHT dht3(sensor5Pin, DHTTYPE);
DHT dht4(sensor6Pin, DHTTYPE);

I trry to check it some days....but i cant solve it!!!

I hope somebody can help me!!
Thanks!!
Reply to top
#2
Hi jmcadsl, if you verified the relays work with the code you're using and tested that on the controller Arduino it should work. Those errors are a little odd, not sure why you get that. Try putting those 2 lines of code you added at line 80 in controller sketch.

Also not sure what sketches you're using, in v4.1 you should have

DHT dht1(sensor2Pin, DHTTYPE);
DHT dht2(sensor4Pin, DHTTYPE);
DHT dht3(sensor5Pin, DHTTYPE);
DHT dht4(sensor6Pin, DHTTYPE);
DHT dht5(sensor7Pin, DHTTYPE);

on lines 101 - 105.
Reply to top
#3
OH MY GOD!! Its running!! jajajaja
I don't know why not asked before spend 3 days of crashing my head jajaja
Thank you very much Rob, writing lines at line 80 its compiling without errors!!

Now i need to find one Pin free, must be a normal output, not amplified.
Maybe you have a list of the complete ports used ?? Or which one its not used ?
I must assign one pin for output data RF.

Thanks again!!!
Reply to top
#4
Glad to hear that worked and it's your lucky day as there is one pin remaining, it's Analog A11. You can access it on the ATO float port, if you have Rev-G board the port is marked "Plug 12". On the board it'll say "Spare" behind the pin. If you connect using the external port there is a voltage divider inline to drop 5v input to 3.3v. If you don't need that you can try connecting directly to the pin on Arduino but I think the voltage divider will still affect it so you might have to remove a resistor. Let me know if you need more info.
Reply to top
#5
Hi Rob!!
Thanks for all!!
Its completely working !!
I remove both resistor from the voltaje divider and runs perfectly!
I think the Power Plug RF its a easy and clean solution!!!

Thanks!
Reply to top
#6
could be a good start on RF addons? just saying
Reply to top
#7
(03-19-2018, 08:58 AM)jmcadsl Wrote: Hi Rob!!
Thanks for all!!
Its completely working !!
I remove both resistor from the voltaje divider and runs perfectly!
I think the Power Plug RF its a easy and clean solution!!!

Thanks!

Great glad to hear, now if you could only make the AC side wireless. ;)

What RF module are you using, is it part of the relay module? How far does it communicate?

(03-19-2018, 11:21 AM)rott Wrote: could be a good start on RF addons? just saying

Wireless will be coming in a couple months, I'm starting with an 8 port I/O expander. Waiting on new boards to do some testing.
Reply to top
#8
Hello!
Im using FS1000A module.
The power bar this link

https://djmania.es/cf/enchufes-de-regleta/ibiza-light

Relays and receiver RF its inside the power bar.

Its running very good .
Thanks
Reply to top
#9
Thanks, glad to hear its running good.
Reply to top


Possibly Related Threads…
Thread Author Replies Views Last Post
  Power Bar question Gordon Lehmann 1 2,917 02-28-2019, 02:49 PM
Last Post: Rob F

Forum Jump:

Current time: 03-29-2024, 02:28 AM