@ThomasDecock No I wasn't, I was able to get the standard dallas temperature working(because I thought the sensors no longer work), but unfortunately my time on this is pretty limited. I hoped I got it working until I go on vacation, but probably will look into it after.
I would appreciate if someone could help with it, I think everyone would.
Posts made by CaptainZap
-
RE: Door, Motion and Temperature Sensor
-
RE: Door, Motion and Temperature Sensor
@Moshe-Livne That's not the problem... The previous code had the same pir sensor working, it has a couple of seconds timeout.
At this time I'll take another look at my very first sketch, and remove the repeating part, maybe I can get somewhere...
Looking back 1 year ago this was a nice idea, however I've put more time than I would have hoped for into it and I still don't have something that I can call reliable. I know this is a labor of love, and not perfect in any way, I just expected it to be a bit easier to do... -
RE: Door, Motion and Temperature Sensor
@BulldogLowell I just managed to test this and I have some questions :
- Motion doesn't seem to work that great - meaning that it takes at least one minute after being untripped to be tripped again
- Door/window doesn't seem to work - I think I have to add this part, but I'm a bit overwhelmed
- Temperature starts with temperature of -127C and doesn't update at all (I held my finger on it for 2 minutes) plus I think I need something to avoid -127 temps, like :
if (lastTemperature != tempC && tempC != -127.00)
For your info I used these pins to connect my sensors :
const int PIR_PIN = 3; - PIR sensor const int INTERRUPT = 4; - Door/Window const int DALLAS_PIN = 5; - Temperature sensor [...] unsigned long readTempInterval = 1 * 60 * 1000UL; - modified read interval to 1 minute for testing purposes
Also I get this output of the serial monitor once I compile and upload the sketch to my nano after 2 minutes and multiple tries to trip PIR sensor :
sensor started, id 2 send: 2-2-0-0 s=255,c=0,t=17,pt=0,l=5,st=ok:1.4.1 send: 2-2-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0 send: 2-2-0-0 s=255,c=3,t=11,pt=0,l=12,st=ok:Multi-Sensor send: 2-2-0-0 s=255,c=3,t=12,pt=0,l=8,st=ok:1.0alpha send: 2-2-0-0 s=1,c=0,t=1,pt=0,l=0,st=ok: send: 2-2-0-0 s=2,c=0,t=6,pt=0,l=0,st=ok: send: 2-2-0-0 s=2,c=1,t=0,pt=2,l=2,st=ok:-127 Tripped send: 2-2-0-0 s=1,c=1,t=16,pt=2,l=2,st=ok:1 Not Tripped send: 2-2-0-0 s=1,c=1,t=16,pt=2,l=2,st=ok:0 Tripped send: 2-2-0-0 s=1,c=1,t=16,pt=2,l=2,st=ok:1
I would appreciate any help I can get to get this started... this project has been on hold for at least 1 year and I would like to implement it now since I have all the parts I need, including 5 cases for the motion detectors (I will need to have at least two variations for them). My focus right now is getting a working sketch, with repeating functions or not, I can place repeaters if needed that is not a problem.
-
RE: Door, Motion and Temperature Sensor
@BulldogLowell Thanks, I'll try it tonight once I get home.
-
RE: Door, Motion and Temperature Sensor
@BulldogLowell Temperature isn't working, and is never updated on the Vera interface
-
RE: Door, Motion and Temperature Sensor
@petoulachi @BulldogLowell Glad to hear there is some progress, in regards to my issue and hopefully this is step in the right direction. I'm positive that we're not alone in our need to create multisensors, both powered and battery operated, as arduinos offer too many possibilities to limit yourself to just a single type of device
-
RE: Door, Motion and Temperature Sensor
@Moshe-Livne @m26872 : I did clear the eprom, I've tried everything I could think of... I'm not quite sure if the repeater works, so far everything is at the breadboard state, so I was pretty much prototyping.
-
RE: Door, Motion and Temperature Sensor
Well since nobody knew what the problem is I thought I would re-flash my first sketch which was working properly... however after doing it it no longer works... this is blowing my mind away. I don't understand why that would be, as the only changes I've done are listed in this thread, major one was that I upgraded lib to 1.4.1 from 1.4. Anyone has any ideas cause this is driving me crazy now
-
RE: Door, Motion and Temperature Sensor
@Dwalt said:
@CaptainZap It your sketch you have this line:
#define ONE_WIRE_BUS 14What pin is your Dallas sensor connected to?
One sensor is connected to A0(14) the other is connected to D5 as it can be seen in my last sketch. Temperature reporting worked on, in my original sketch, however the sketch wasn't perfect so I improved it based on feedback.
@m26872 The sensor is on a breadboard 5cm from the gateway, and I'm not sure about the repeater part...
-
RE: Door, Motion and Temperature Sensor
@Dwalt @m26872 Thanks for the feedback, I did do that on the Vera unit. I've even removed the plugin files and re-did everything. I even, and this is a bit extreme, cleared the eprom on the gateway and reflashed it. None of it worked, I really have no clue what to do next. I'm open to every suggestion
-
RE: Door, Motion and Temperature Sensor
Can anyone share their thoughts ? I've been running two identical nodes, with no temperature output for a few days now
-
RE: Door, Motion and Temperature Sensor
Just uploaded the new sketch to my nodes, one built on a pro mini, and one built on a nano (got one to view serial output), however both nodes have the same behavior when added to the Vera unit... the repeater node doesn't show up (is this somehow related to UI7 ?), and the weird thing is that temperature value is never populated.
Regarding the repeater, looking into the user_data output I can see that a repeater node is created, but it's not used as a parent device for the sensors... as all sensors have as parent the gateway. I'm using this version of the plugin :
https://github.com/mysensors/Vera/tree/UI7This is the serial monitor output from the nano :
repeater started, id 13 send: 13-13-1-0 s=255,c=0,t=18,pt=0,l=5,st=ok:1.4.1 send: 13-13-1-0 s=255,c=3,t=6,pt=1,l=1,st=ok:1 send: 13-13-1-0 s=255,c=3,t=11,pt=0,l=12,st=ok:Multi Sensor send: 13-13-1-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.1 send: 13-13-1-0 s=1,c=0,t=0,pt=0,l=0,st=ok: send: 13-13-1-0 s=3,c=0,t=6,pt=0,l=0,st=ok: send: 13-13-1-0 s=2,c=0,t=1,pt=0,l=0,st=ok: send: 13-13-1-0 s=1,c=1,t=16,pt=2,l=2,st=ok:0
This is the updated sketch:
//This sketch is for Door & Motion & Temp Sensor //rev3 - changed temp pin to 5 & temperature logic re-worked #include <MySensor.h> #include <SPI.h> #include <DallasTemperature.h> #include <OneWire.h> #include <Bounce2.h> #define CLIENT_ID AUTO // Sets MYSensors client id #define RADIO_CH 76 // Sets MYSensors to use Radio Channel #define TRIGGER 3 // used to connect motion sensor #define BUTTON_PIN 4 // used to connect door/window sensor //Temp Sensor bits #define ONE_WIRE_BUS 5 // Pin where dallas sensor is connected - on Rboard this is A0(D14) OneWire oneWire(ONE_WIRE_BUS); DallasTemperature DallasSensors(&oneWire); float lastTemperature ; #define CHILD_ID_T1 3 //CHILD ID for temp //Door/Window bits #define CHILD_ID_D1 1 //CHILD ID for door/window //Trigger Sensor Bits #define CHILD_ID_S1 2 //CHILD ID for Motion sensor boolean lastTripped = 0; unsigned long SLEEP_TIME = 30000; // Sleep time between reports (in milliseconds) unsigned long lastRefreshTime = 0; MySensor gw; Bounce debouncer = Bounce(); int oldValue=-1; // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(CHILD_ID_D1,V_TRIPPED); MyMessage triggerMsg(CHILD_ID_S1,V_TRIPPED); MyMessage tempMsg(CHILD_ID_T1,V_TEMP); void setup() { // Startup OneWire Temp Sensors DallasSensors.begin(); DallasSensors.setWaitForConversion(false); // Initialize library and add callback for incoming messages gw.begin(NULL, AUTO, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Multi Sensor", "1.1"); // Register all sensors to gw (they will be created as child devices) gw.present(CHILD_ID_D1, S_DOOR); gw.present(CHILD_ID_T1, S_TEMP); gw.present(CHILD_ID_S1, S_MOTION); // Setup the button pinMode(BUTTON_PIN,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN,HIGH); // After setting up the button, setup debouncer debouncer.attach(BUTTON_PIN); debouncer.interval(5); // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. } void loop() { // Alway process incoming messages whenever possible gw.process(); // Check for motion change value boolean tripped = digitalRead(TRIGGER) == HIGH; if (lastTripped != tripped ) { gw.send(triggerMsg.set(tripped?"1":"0")); // Send new state and request ack back Serial.println("Tripped"); lastTripped=tripped; } // Check if digital input has changed and send in new value debouncer.update(); // Get the update value int value = debouncer.read(); if (value != oldValue) { // Send in the new value gw.send(msg.set(value==HIGH ? 1 : 0)); oldValue = value; } gw.wait(100); boolean bNeedRefresh = (millis() - lastRefreshTime) > SLEEP_TIME; if (bNeedRefresh) { lastRefreshTime = millis(); DallasSensors.requestTemperatures(); gw.wait(750); float tempC = DallasSensors.getTempCByIndex(1); float difference = lastTemperature - tempC; if (tempC != -127.00 && abs(difference) > 0.5) { // Send in the new temperature gw.send(tempMsg.set(tempC, 1)); lastTemperature = tempC; } } }
Any feedback will be appreciated. Thanks.
-
RE: Door, Motion and Temperature Sensor
@robosensor Thanks so much, I highly appreciate your comments. Will test this tomorrow, and hopefully, soon share my hardware designs
-
RE: Door, Motion and Temperature Sensor
@m26872 If you have time, could you please tell me how to do that, I know you've posted a link a few post back but I didn't do much with it
-
RE: Door, Motion and Temperature Sensor
@BulldogLowell Unfortunately I don't have a way to test that yet... I'm uploading the sketch using an arduino uno, and I have no idea how to do that with it. I do have an FTDI serial adapter but is not picked up by the IDE, it was at some point but no longer... probably fake
-
RE: Door, Motion and Temperature Sensor
Hello guys,
I really need an expert's opinion on this because I'm experiencing some trouble... I've tried to include suggestions from all you guys, except the delay part, but so far it works partially... in my original code the temperature worked, and now it doesn't. The rest works ok, sensor and motion, so I would be grateful if anyone could take a look at my code and help me with it... I kind of need to get it in place soon, as I intend to leave my house for some time.
Thank you.
//This sketch is for Door & Motion & Temp Sensor #include <MySensor.h> #include <SPI.h> #include <DallasTemperature.h> #include <OneWire.h> #include <Bounce2.h> #define CLIENT_ID AUTO // Sets MYSensors client id #define RADIO_CH 76 // Sets MYSensors to use Radio Channel #define TRIGGER 3 // used to connect motion sensor #define BUTTON_PIN 4 // used to connect door/window sensor //Temp Sensor bits #define ONE_WIRE_BUS 14 // Pin where dallas sensor is connected OneWire oneWire(ONE_WIRE_BUS); DallasTemperature DallasSensors(&oneWire); float lastTemperature ; #define CHILD_ID_T1 3 //CHILD ID for temp //Door/Window bits #define CHILD_ID_D1 1 //CHILD ID for door/window //Trigger Sensor Bits #define CHILD_ID_S1 2 //CHILD ID for Motion sensor boolean lastTripped = 0; MySensor gw; Bounce debouncer = Bounce(); int oldValue=-1; // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(CHILD_ID_D1,V_TRIPPED); MyMessage triggerMsg(CHILD_ID_S1,V_TRIPPED); MyMessage tempMsg(CHILD_ID_T1,V_TEMP); void setup() { // Startup OneWire Temp Sensors DallasSensors.begin(); DallasSensors.setWaitForConversion(false); // Initialize library and add callback for incoming messages gw.begin(NULL, AUTO, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Multi Sensor", "1.1"); // Register all sensors to gw (they will be created as child devices) gw.present(CHILD_ID_D1, S_DOOR); gw.present(CHILD_ID_T1, S_TEMP); gw.present(CHILD_ID_S1, S_MOTION); // Setup the button pinMode(BUTTON_PIN,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN,HIGH); // After setting up the button, setup debouncer debouncer.attach(BUTTON_PIN); debouncer.interval(5); // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. } void loop() { // Alway process incoming messages whenever possible gw.process(); // Check for motion change value boolean tripped = digitalRead(TRIGGER) == HIGH; if (lastTripped != tripped ) { gw.send(triggerMsg.set(tripped?"1":"0")); // Send new state and request ack back Serial.println("Tripped"); lastTripped=tripped; } // Check if digital input has changed and send in new value debouncer.update(); // Get the update value int value = debouncer.read(); if (value != oldValue) { // Send in the new value gw.send(msg.set(value==HIGH ? 1 : 0)); oldValue = value; } DallasSensors.requestTemperatures(); // no delay here gw.wait(750); // insert another value for non-12-bit resolution float tempC = DallasSensors.getTempCByIndex(1); // Only send data if temperature has changed and no error if (lastTemperature != tempC && tempC != -127.00) { // Send in the new temperature gw.send(tempMsg.set(tempC,1)); lastTemperature=tempC; } }
-
RE: Door, Motion and Temperature Sensor
Guys, I had some free time tonight and tried to apply this fix... I ended up re-installing the arduino IDE + downloading the latest version, which now is 1.4.1 as opposed to the 1.4 that I used to have ?
Anyways I had to upgrade my ethernet gateway (ENC28J60) and it's no longer working now... any hints will be golden.
LE: I was too tired to check the sketch... I forgot to include the correct library and went to all debugging first, reset router config to default, but in the end I did notice the issue So I learned a valuable lesson, never work on this if it's late or you're tired. -
RE: Door, Motion and Temperature Sensor
That was the version I was using when I first encountered the issues... anyways I'll remove arduino IDE with everything and reinstall it. Thanks.
@hek I also LOL-ed Gotta love the helping spirit in the community you guys built.
-
RE: Door, Motion and Temperature Sensor
@robosensor Thanks, I installed that but it's version 1.5 b1 and after using it it's giving me lots of errors I think there have been changes in how the code is used...
LE: I finally found the 1.4.1 branch and downloaded it however it's still giving me the same error about wait:
Door_Motion_Temp_rev2.ino: In function 'void getTemps()':
Door_Motion_Temp_rev2:115: error: 'class MySensor' has no member named 'wait'
'class MySensor' has no member named 'wait'LLE: Just checked the cpp and there is no wait, this is the library I used :
https://github.com/mysensors/Arduino/tree/1.4.1Can you tell me if there will be any issue if I comment that part ?
-
RE: Door, Motion and Temperature Sensor
@robosensor I don't know where to find the complete library for version 1.4.x
-
RE: Door, Motion and Temperature Sensor
@robosensor Thank you very much for your insight... do I just download the new library and overwrite the one in the Arduino IDE install folder ?
I've also used your code and I'm getting errors compiling it, any hints ? I guess it could be because of the library ?
Arduino: 1.6.4 (Windows 8.1), Board: "Arduino Mini, ATmega328"
Door_Motion_Temp_rev2.ino: In function 'void getTemps()':
Door_Motion_Temp_rev2:115: error: 'class MySensor' has no member named 'wait'
Multiple libraries were found for "DallasTemperature.h"Used: C:\Users***\Documents\Arduino\libraries\DallasTemperature << this is where I've copied the downloaded library
Not used: C:\Users***\Documents\Arduino\libraries\Arduino-Temperature-Control-Library-master
'class MySensor' has no member named 'wait'
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.'class MySensor' has no member named 'wait'
-
RE: Door, Motion and Temperature Sensor
@mvdarend @m26872 Thanks so much for your feedback, I did apply the hints and I'll test the sketch later on today. I do have a question... does anyone know how do I upgrade my library to version 1.4.1 ? I've copied the one available from the main page, but it's version 1.4.
Thanks.
-
RE: Door, Motion and Temperature Sensor
@m26872 No idea how do to that, could you please help me ?
-
RE: Door, Motion and Temperature Sensor
@AWI Yes I want all my nodes to be repeaters, and that's exactly what I want to do However I use a Vera as my controller, and there you are supposed to have a parent node for your arduino sensor, followed by child devices for sensors/relays etc. Right now I have 3 child devices for the My Sensors plugin which isn't right.
-
Door, Motion and Temperature Sensor
Hi guys,
It's been a few months since I last made a sensor, and I'm experiencing some issues trying to create one now. I've made a sketch, from parts from other projects and made myself a 3in1 sensor, but the problem is that I have no parent node, and I can't understand why.
Can anyone take a look over it and correct me ?
Note that this is meant to be a power operated sensor. Thank you
//This sketch is for Door & Motion & Temp Sensor #include <MySensor.h> #include <SPI.h> #include <DallasTemperature.h> #include <OneWire.h> #include <Bounce2.h> char sketch_name[] = "Multi Sensor"; char sketch_ver[] = "1.0"; #define CLIENT_ID AUTO // Sets MYSensors client id #define RADIO_CH 76 // Sets MYSensors to use Radio Channel #define TRIGGER 3 // used to connect motion sensor #define BUTTON_PIN 4 // used to connect door/window sensor //Temp Sensor bits #define ONE_WIRE_BUS 14 // Pin where dallas sensor is connected OneWire oneWire(ONE_WIRE_BUS); DallasTemperature DallasSensors(&oneWire); float lastTemperature ; #define CHILD_ID_T1 3 //CHILD ID for temp //Door/Window bits #define CHILD_ID_D1 1 //CHILD ID for door/window //Trigger Sensor Bits #define CHILD_ID_S1 2 //CHILD ID for Reed/Motion sensor boolean lastTripped = 0; MySensor gw; Bounce debouncer = Bounce(); int oldValue=-1; // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(CHILD_ID_D1,V_TRIPPED); MyMessage triggerMsg(CHILD_ID_S1,V_TRIPPED); MyMessage tempMsg(CHILD_ID_T1,V_TEMP); void setup() { // Startup OneWire Temp Sensors DallasSensors.begin(); // Initialize library and add callback for incoming messages gw.begin(NULL, AUTO, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo(sketch_name, sketch_ver); // Register all sensors to gw (they will be created as child devices) gw.present(CHILD_ID_D1, S_DOOR); gw.present(CHILD_ID_T1, S_TEMP); gw.present(CHILD_ID_S1, S_MOTION); // Setup the button pinMode(BUTTON_PIN,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN,HIGH); // After setting up the button, setup debouncer debouncer.attach(BUTTON_PIN); debouncer.interval(5); // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. } void loop() { // Alway process incoming messages whenever possible gw.process(); // Check for motion change value boolean tripped = digitalRead(TRIGGER) == HIGH; if (lastTripped != tripped ) { gw.send(triggerMsg.set(tripped?"1":"0")); // Send new state and request ack back Serial.println("Tripped"); lastTripped=tripped; } // Check if digital input has changed and send in new value debouncer.update(); // Get the update value int value = debouncer.read(); if (value != oldValue) { // Send in the new value gw.send(msg.set(value==HIGH ? 1 : 0)); oldValue = value; } // Fetch temperatures from Dallas sensors DallasSensors.requestTemperatures(); float tempC = DallasSensors.getTempCByIndex(1); // Only send data if temperature has changed and no error if (lastTemperature != tempC && tempC != -127.00) { // Send in the new temperature gw.send(tempMsg.set(tempC,1)); lastTemperature=tempC; delay(30000); } }
-
RE: Vera Lite U17 - Serial Can't Detect Device
To fix that error someone, needs to update the plugin and include this line:
luup.set_failure(false)
This way the can't detect message won't be displayed anymore. -
RE: Vera Edge UI7 - Serial USB Fix!!!
@hek I don't think he'll mind I just wanted to clear things out
-
RE: Vera Edge UI7 - Serial USB Fix!!!
Please edit the title so you won't mislead people. This is actually the Vera EDGE usb fix, it only applies to those only. Using the link on Vera 3/lite will brick the unit.
-
RE: Remote controlled switches (433MHz) and temperature sensors
@Heinz Thanks for pointing that out, since I plan to have most if not all my sensors ac powered I'll change that.
-
RE: Remote controlled switches (433MHz) and temperature sensors
As per @Heinz suggestion I was able to use only one pin to get both temperature values, now I'm looking at lowering the refresh rate interval, now happens very fast. He suggested using millis(), but didn't help much.
Also I have one other question, I've noticed that when the node is on my desk (about 5 meters and 1 wall) from the gateway the RF switches no longer work, but the sensors do keep updating without any issues. I don't understand exactly why would this be the case.
LE: Seems that the issue with the RF is related to the power output from my USB port, I changed to a different one and it works without issue. Weird anyway.
-
RE: Remote controlled switches (433MHz) and temperature sensors
@tbowmo Because I don't know how to use the library correctly. I don't know how to display two sensors connected to the same port so I've done it how I knew. I am a beginner at coding and I know it can be simplified but this is as much as I know. I would like to see how you would do it
This is my last code for the temperature part:
#define ONE_WIRE_BUS 4 // Pin where dallas sensor is connected - on Rboard this is A0(D14) #define ONE_WIRE_BUS2 5 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature DallasSensors(&oneWire); OneWire oneWire2(ONE_WIRE_BUS2); DallasTemperature DallasSensors2(&oneWire2); float lastTemperature ; float lastTemperature1 ; #define CHILD_ID_T1 4 //CHILD ID for temperature sensor1 #define CHILD_ID_T2 5 //CHILD ID for temperature sensor2 MyMessage tempMsg(CHILD_ID_T1,V_TEMP); MyMessage tempMsg2(CHILD_ID_T2,V_TEMP); void setup() { {...} // the lights part gw.present(CHILD_ID_T1, S_TEMP); gw.present(CHILD_ID_T2, S_TEMP); } void loop() { gw.process(); // Fetch temperatures from Dallas sensors DallasSensors.requestTemperatures(); float tempC = DallasSensors.getTempCByIndex(1); DallasSensors2.requestTemperatures(); float tempD = DallasSensors2.getTempCByIndex(1); // Only send data if temperature has changed and no error if (lastTemperature != tempC && tempC != -127.00) { // Send in the new temperature gw.send(tempMsg.set(tempC,1)); lastTemperature=tempC; } // Only send data if temperature has changed and no error if (lastTemperature1 != tempD && tempD != -127.00) { // Send in the new temperature gw.send(tempMsg2.set(tempD,1)); lastTemperature1=tempD; } }
-
RE: Remote controlled switches (433MHz) and temperature sensors
Just an update on this, I've spent several hours today but I was able to get the sketch to show up 1 temperature sensor, and then two temperature sensors. Now the problem I have is that the two temperature sensors display the same value. They are connected to different pins on the arduino, 4 and 5, and are not wired in parallel. This is the temperature sensor part :
OneWire oneWire(ONE_WIRE_BUS); DallasTemperature DallasSensors(&oneWire); float lastTemperature ; float lastTemperature1 ; #define CHILD_ID_T1 4 //CHILD ID for temperature sensor1 #define CHILD_ID_T2 5 //CHILD ID for temperature sensor2 MyMessage tempMsg(CHILD_ID_T1,V_TEMP); MyMessage tempMsg2(CHILD_ID_T2,V_TEMP); void setup() { {...} // the lights part gw.present(CHILD_ID_T1, S_TEMP); gw.present(CHILD_ID_T2, S_TEMP); } void loop() { gw.process(); // Fetch temperatures from Dallas sensors DallasSensors.requestTemperatures(); float tempC = DallasSensors.getTempCByIndex(1); float tempD = DallasSensors.getTempCByIndex(2); // Only send data if temperature has changed and no error if (lastTemperature != tempC && tempC != -127.00) { // Send in the new temperature gw.send(tempMsg.set(tempC,1)); lastTemperature=tempC; } // Only send data if temperature has changed and no error if (lastTemperature1 != tempD && tempD != -127.00) { // Send in the new temperature gw.send(tempMsg2.set(tempD,1)); lastTemperature1=tempD; } }
Anyone got any hints ? I'm so close on finalizing this ! I've learned a lot over the last couple of days
LE: After writing this here I realized I didn't declare the second pin in the code and thus was using the same one. I've corrected that and this WAS IT !
-
RE: Remote controlled switches (433MHz) and temperature sensors
@blacey
Thanks for the feedback, today I started from scratch with a brand spanking new arduino nano ready for flashing. I ditched the temperature sensor part because yesterday I was being a bit too cocky, and rewrote the the sketch based on @Dwalt example combined with the TypeA_lightweight example from RC Switch and I can successfully say that I was able to control my switches !!!YAY! , now how do I add the temperature part as I need to monitor two temperature sensors from the device.
FYI, this is the sketch I have that works :
#include <MySensor.h> #include <SPI.h> #include <RF24.h> #define NUMBER_OF_OUTLETS 3 // Each outlet will have 2 OOK codes #define SEND_DATA 3 MySensor gw; int RCLpin = 3; void RCLswitch(uint16_t code) { for (int nRepeat=0; nRepeat<6; nRepeat++) { for (int i=4; i<16; i++) { RCLtransmit(1,3); if (((code << (i-4)) & 2048) > 0) { RCLtransmit(1,3); } else { RCLtransmit(3,1); } } RCLtransmit(1,31); } } void RCLtransmit(int nHighPulses, int nLowPulses) { digitalWrite(RCLpin, HIGH); delayMicroseconds( 350 * nHighPulses); digitalWrite(RCLpin, LOW); delayMicroseconds( 350 * nLowPulses); } void setup() { // The node is mains powered, so why not make it a repeater. gw.begin(incomingMessage, AUTO, true); // Send the sketch version information to gateway gw.sendSketchInfo("RF433", "0.1"); pinMode(RCLpin, OUTPUT); // Register outlets to gw (they will be created as child devices) for(int i=0; i<NUMBER_OF_OUTLETS;i++) { gw.present(i+1, S_LIGHT); } } void loop() { gw.process(); } void incomingMessage(const MyMessage &message) { if (message.type==V_LIGHT) { int incomingLightState = message.getBool(); int incomingOutlet = message.sensor; Serial.print("Outlet #: "); Serial.println(message.sensor); Serial.print("Command: "); Serial.println(message.getBool()); if (incomingOutlet==1) { if (incomingLightState==1) { // Turn on socket 1 Serial.println("Turn on Socket 1"); RCLswitch(0b101011000001);// These codes are unique to each outlet delay(50); } if (incomingLightState==0) { // Turn off socket 1 Serial.println("Turn off Socket 1"); RCLswitch(0b101011000010); delay(50); } } if (incomingOutlet==2) { if (incomingLightState==1) { // Turn on socket 2 Serial.println("Turn on Socket 2"); RCLswitch(0b101010100001); delay(50); } if (incomingLightState==0) { // Turn off socket 2 Serial.println("Turn off Socket 2"); RCLswitch(0b101010100010); delay(50); } } if (incomingOutlet==3) { if (incomingLightState==1) { // Turn on socket 3 Serial.println("Turn on Socket 3"); RCLswitch(0b101010010001); delay(50); } if (incomingLightState==0) { // Turn off socket 3 Serial.println("Turn off Socket 3"); RCLswitch(0b101010010010); delay(50); } } } delay(50); }
-
RE: Remote controlled switches (433MHz) and temperature sensors
@Heinz I've used that lib in both my tries (it works with their sketch, but not with mine), but I will try the windows GUI and see how that goes.
LE: While bringing the serial gateway near my computer, I broke off the mini USB port (on the nano I was testing this), something dropped on it and all hell broke loose. I'll check it out tomorrow, but I would really appreciate if someone could take a look at my code. It has to be something I used incorrectly.
-
RE: Sensor to control remote controlled switches from Flamingo.eu e.g. mumbi m-FS300
@Heinz No need to write the code for me, I've done most of the work already but the only problems I have now is that with the sketch from this thread I can't control the 3 switches I have and the two temperature sensors are not detected by the Vera interface (I guess they aren't initialized correctly ?).
I would appreciate if you could take a look at it. -
RE: Remote controlled switches (433MHz) and temperature sensors
@Dwalt Thank you for pointing that out, I am that bad at coding. Anyway, I've done that and I've tried to rewrite the part for two temperature sensors but they still don't show up on the Vera interface.
I've done some testing and said that I should ditch RCSwitch library and use instead a simple function they provide, so I've retested the switches, and made sure that the code send is correct but I still can't control any switches. Also the temperature sensors do not show up. I need help guys, I feel I am so close it's kind of frustratingBelow is the revised code :
#include <MySensor.h> #include <SPI.h> #include <RF24.h> #include <DallasTemperature.h> #include <OneWire.h> // Define Constants #define RF433_CHILD_ID 0 #define NUMBER_OF_OUTLETS 3 #define CLIENT_ID AUTO // Sets MYSensors client id #define RADIO_CH 76 // Sets MYSensors to use Radio Channel #define MAX_ATTACHED_DS18B20 2 unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds) //Temp Sensor bits #define ONE_WIRE_BUS 4 // Pin where dallas sensor is connected - on Rboard this is (D4) OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); float lastTemperature[MAX_ATTACHED_DS18B20]; int numSensors=0; // >> in original temp sketch this is 0 should it be changed to 2 ? int RCLpin = 3; MySensor gw; MyMessage msg(0,V_TEMP); void RCLswitch(uint16_t code) { for (int nRepeat=0; nRepeat<6; nRepeat++) { for (int i=4; i<16; i++) { RCLtransmit(1,3); if (((code << (i-4)) & 2048) > 0) { RCLtransmit(1,3); } else { RCLtransmit(3,1); } } RCLtransmit(1,31); } } void RCLtransmit(int nHighPulses, int nLowPulses) { digitalWrite(RCLpin, HIGH); delayMicroseconds( 350 * nHighPulses); digitalWrite(RCLpin, LOW); delayMicroseconds( 350 * nLowPulses); } void setup() { Serial.begin(115200); // Not sure why this was included // The node is mains powered, so why not make it a repeater. gw.begin(incomingMessage, CLIENT_ID , false,AUTO,RF24_PA_MAX,RADIO_CH,RF24_250KBPS); // Send the sketch version information to gateway gw.sendSketchInfo("RF433&Temp", "1.0b"); //enable RF 433MHz transmitter pinMode(RCLpin, OUTPUT); // Register outlets to gw (they will be created as child devices) for(int i=0; i<NUMBER_OF_OUTLETS;i++) { gw.present(i+1, S_LIGHT); // Fetch the number of attached temperature sensors numSensors = sensors.getDeviceCount(); // Present all sensors to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { gw.present(i, S_TEMP); } } } void loop() { gw.process(); // Fetch temperatures from Dallas sensors //DallasSensors.requestTemperatures(); sensors.requestTemperatures(); // Read temperatures and send them to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { // Fetch and round temperature to one decimal float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.; // Only send data if temperature has changed and no error if (lastTemperature[i] != temperature && temperature != -127.00) { // Send in the new temperature gw.send(msg.setSensor(i).set(temperature,1)); lastTemperature[i]=temperature; } } } void incomingMessage(const MyMessage &message) { if (message.type==V_LIGHT) { int incomingLightState = message.getBool(); int incomingOutlet = message.sensor; Serial.print("Outlet #: "); Serial.println(message.sensor); Serial.print("Command: "); Serial.println(message.getBool()); if (incomingOutlet==1) { if (incomingLightState==1) { // Turn on socket 1 Serial.println("Turn on Socket 1"); RCLswitch(0b101011000001);// These codes are unique to each outlet } if (incomingLightState==0) { // Turn off socket 1 Serial.println("Turn off Socket 1"); RCLswitch(0b101011000010); } } if (incomingOutlet==2) { if (incomingLightState==1) { // Turn on socket 2 Serial.println("Turn on Socket 2"); RCLswitch(0b101010100001); } if (incomingLightState==0) { // Turn off socket 2 Serial.println("Turn off Socket 2"); RCLswitch(0b101010100010); } } if (incomingOutlet==3) { if (incomingLightState==1) { // Turn on socket 3 Serial.println("Turn on Socket 3"); RCLswitch(0b101010010001); } if (incomingLightState==0) { // Turn off socket 3 Serial.println("Turn off Socket 3"); RCLswitch(0b101010010010); } } } gw.sleep(SLEEP_TIME); }
-
RE: Remote controlled switches (433MHz) and temperature sensors
Looking in the Vera logs this is what I actually see when I try to control one switch from the interface :
08 02/26/15 18:23:50.791 JobHandler_LuaUPnP::HandleActionRequest device: 57 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget <0x2f6a5680> 08 02/26/15 18:23:50.791 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=57 <0x2f6a5680> 08 02/26/15 18:23:50.791 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:SwitchPower1 <0x2f6a5680> 08 02/26/15 18:23:50.792 JobHandler_LuaUPnP::HandleActionRequest argument action=SetTarget <0x2f6a5680> 08 02/26/15 18:23:50.792 JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=0 <0x2f6a5680> 08 02/26/15 18:23:50.792 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.6773929147942098 <0x2f6a5680> 50 02/26/15 18:23:50.795 luup_log:34: Arduino: Sending: 19;1;1;1;2;0 <0x2b772000> 51 02/26/15 18:23:50.796 0x31 0x39 0x3b 0x31 0x3b 0x31 0x3b 0x31 0x3b 0x32 0x3b 0x30 0xd 0xa (19;1;1;1;2;0\r\n) <0x2b772000> 52 02/26/15 18:23:50.852 0x30 0x3b 0x30 0x3b 0x33 0x3b 0x30 0x3b 0x39 0x3b 0x73 0x65 0x6e 0x64 0x3a 0x20 0x30 0x2d 0x30 0x2d 0x31 0x39 0x2d 0x31 0x39 0x20 0x73 0x3d 0x31 0x2c 0x63 0x3d 0x31 0x2c 0x74 0x3d 0x32 0x2c 0x70 0x74 0x3d 0x30 0x2c 0x6c 0x3d 0x31 0x2c 0x73 0x74 0x3d 0x66 0x61 0x69 0x6c 0x3a 0x30 (0;0;3;0;9;send: 0-0-19-19 s=1,c=1,t=2,pt=0,l=1,st=fail:0) <0x2f8e8680> 50 02/26/15 18:23:50.853 luup_log:34: Arduino: Log: send: 0-0-19-19 s=1,c=1,t=2,pt=0,l=1,st=fail:0 <0x2f8e8680> 08 02/26/15 18:23:51.815 JobHandler_LuaUPnP::HandleActionRequest device: 57 service: urn:upnp-org:serviceId:SwitchPower1 action: SetTarget <0x2f6a5680> 08 02/26/15 18:23:51.815 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=57 <0x2f6a5680> 08 02/26/15 18:23:51.816 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:SwitchPower1 <0x2f6a5680> 08 02/26/15 18:23:51.816 JobHandler_LuaUPnP::HandleActionRequest argument action=SetTarget <0x2f6a5680> 08 02/26/15 18:23:51.816 JobHandler_LuaUPnP::HandleActionRequest argument newTargetValue=1 <0x2f6a5680> 08 02/26/15 18:23:51.816 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.17616296711805424 <0x2f6a5680> 50 02/26/15 18:23:51.832 luup_log:34: Arduino: Sending: 19;1;1;1;2;1 <0x2b772000> 51 02/26/15 18:23:51.833 0x31 0x39 0x3b 0x31 0x3b 0x31 0x3b 0x31 0x3b 0x32 0x3b 0x31 0xd 0xa (19;1;1;1;2;1\r\n) <0x2b772000> 52 02/26/15 18:23:51.883 0x30 0x3b 0x30 0x3b 0x33 0x3b 0x30 0x3b 0x39 0x3b 0x73 0x65 0x6e 0x64 0x3a 0x20 0x30 0x2d 0x30 0x2d 0x31 0x39 0x2d 0x31 0x39 0x20 0x73 0x3d 0x31 0x2c 0x63 0x3d 0x31 0x2c 0x74 0x3d 0x32 0x2c 0x70 0x74 0x3d 0x30 0x2c 0x6c 0x3d 0x31 0x2c 0x73 0x74 0x3d 0x66 0x61 0x69 0x6c 0x3a 0x31 (0;0;3;0;9;send: 0-0-19-19 s=1,c=1,t=2,pt=0,l=1,st=fail:1) <0x2f8e8680> 50 02/26/15 18:23:51.884 luup_log:34: Arduino: Log: send: 0-0-19-19 s=1,c=1,t=2,pt=0,l=1,st=fail:1 <0x2f8e8680>
From serial monitor I see this output:
sensor started, id 19 send: 19-19-0-0 s=255,c=0,t=17,pt=0,l=3,st=fail:1.4 send: 19-19-0-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0 send: 19-19-0-0 s=255,c=3,t=11,pt=0,l=5,st=fail:RF433 send: 19-19-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.0 send: 19-19-0-0 s=1,c=0,t=3,pt=0,l=3,st=fail:1.4 send: 19-19-0-0 s=2,c=0,t=3,pt=0,l=3,st=fail:1.4 send: 19-19-0-0 s=3,c=0,t=3,pt=0,l=3,st=ok:1.4 send: 19-19-0-0 s=4,c=1,t=0,pt=7,l=5,st=fail:21.1
-
Remote controlled switches (433MHz) and temperature sensors
Hi guys,
I've been trying to build a 433MHz transmitter and temperature sensor for two Dallas sensors. The goal is to monitor my heating system and turn on/off the recirculating pumps using the 433MHz switches. Up until now this has been done manually (through remote), but I would really love to automate this.
The problem is that I suck badly at coding, everything goes over my head (sorry), so I've been trying to adapt the currently available code into a single sketch that would help me do this.
Using the RC Switch library I was able to find out the codes I need to be sending to control my 3 RF switches. Now here comes the funny part, I've used @Dwalt sketch and modified to something I think should work(I am very bad at coding ). I've also included bits from a multi-sensor sketch I had from @gregl to get at least one temperature sensor added (no idea how to add two).
I've flashed it on my nano, but when included on the Vera lite (UI5), only the 3 switch devices show up on the interface but no temperature device is created. Using serial monitor I can see that temperature is sent back, but unfortunately the switches from the interface do not seem to control my RF switches.
I would appreciate any hints on my current issues :
- how to get two temperature sensors to show up on interface (including the current one)
- how to correct the RF transmission
The code is the one below :
// Include related libraries #include <MySensor.h> #include <SPI.h> #include <RF24.h> #include <RCSwitch.h> #include <DallasTemperature.h> #include <OneWire.h> // Define Constants #define RF433_CHILD_ID 0 #define NUMBER_OF_OUTLETS 3 // Each outlet will have 2 OOK codes #define SEND_DATA 3 // pin used to send 433MHz data #define CLIENT_ID AUTO // Sets MYSensors client id #define RADIO_CH 76 // Sets MYSensors to use Radio Channel //Temp Sensor bits #define ONE_WIRE_BUS 4 // Pin where dallas sensor is connected - on Rboard this is (D4) OneWire oneWire(ONE_WIRE_BUS); DallasTemperature DallasSensors(&oneWire); float lastTemperature ; float tempC = DallasSensors.getTempCByIndex(1); RCSwitch mySwitch = RCSwitch(); #define CHILD_ID_T1 4 //CHILD ID for temperature MySensor gw; MyMessage tempMsg(CHILD_ID_T1,V_TEMP); void setup() { Serial.begin(115200); // Not sure why this was included // The node is mains powered, so why not make it a repeater. gw.begin(incomingMessage, CLIENT_ID , false,AUTO,RF24_PA_MAX,RADIO_CH,RF24_250KBPS); // Send the sketch version information to gateway gw.sendSketchInfo("RF433_Temp", "1.0"); //enable RF 433MHz transmitter mySwitch.enableTransmit(SEND_DATA); // Register outlets to gw (they will be created as child devices) for(int i=0; i<NUMBER_OF_OUTLETS;i++) { gw.present(i+1, S_LIGHT); } // Fetch temperatures from Dallas sensors DallasSensors.requestTemperatures(); // Only send data if temperature has changed and no error if (lastTemperature != tempC && tempC != -127.00) { // Send in the new temperature gw.send(tempMsg.set(tempC,1)); lastTemperature=tempC; } } void loop() { gw.process(); } void incomingMessage(const MyMessage &message) { if (message.type==V_LIGHT) { int incomingLightState = message.getBool(); int incomingOutlet = message.sensor; Serial.print("Outlet #: "); Serial.println(message.sensor); Serial.print("Command: "); Serial.println(message.getBool()); if (incomingOutlet==1) { if (incomingLightState==1) { // Turn on socket 1 Serial.println("Turn on Socket 1"); mySwitch.switchOn("10101", "10000"); // These codes are unique to each outlet delay(50); } if (incomingLightState==0) { // Turn off socket 1 Serial.println("Turn off Socket 1"); mySwitch.switchOff("10101", "10000"); delay(50); } } if (incomingOutlet==2) { if (incomingLightState==1) { // Turn on socket 2 Serial.println("Turn on Socket 2"); mySwitch.switchOn("10101", "01000"); delay(50); } if (incomingLightState==0) { // Turn off socket 2 Serial.println("Turn off Socket 2"); mySwitch.switchOff("10101", "01000"); delay(50); } } if (incomingOutlet==3) { if (incomingLightState==1) { // Turn on socket 3 Serial.println("Turn on Socket 3"); mySwitch.switchOn("10101", "00100"); delay(50); } if (incomingLightState==0) { // Turn off socket 3 Serial.println("Turn off Socket 3"); mySwitch.switchOff("10101", "00100"); delay(50); } } } delay(50); }
-
RE: Sensor to control remote controlled switches from Flamingo.eu e.g. mumbi m-FS300
I would like to adapt your sketch to control my Rf (433MHz) plugin switches, which do have a DIP switch (I think it should be easier ?) and also include temperature reading for two Dallas sensors. The goal is to monitor my heating system and turn on/off the recirculating pumps using the 433MHz switches. Up until now this has been done manually (through remote), but I would really love to automate this.
The problem is that I suck badly at coding, everything goes over my head (sorry), so I would appreciate any help with this, and hopefully help others in the process.
I've included below pictures with the remote and switch I have, so we know the chip (HX2262) it uses :
Remote
SwitchI would really appreciate any help you guys can give me.
LE: I'll start my own thread for this, as I was able to identify the codes using the RC Switch library.Thank you.
-
RE: Serial Port Configuration Not Available
@jjwalker You can go ethernet gateway or keep looking for an FTDI based nano. I did find one after some searches on aliexpress but it took a damn long time to reach me. I have plenty of sensors on my table the only thing I lack right now is a good looking enclosure, which is extremely hard to find
-
RE: Serial Port Configuration Not Available
What USB chip do you have on your Nano ? Is it one of those Chinese ch340 chips ? If it is, you won't be able to get it to work with Vera. If you have an FTDI chip then you might want to try this.
-
RE: Help with setup
@Dean said:
@CaptainZap said:
I've tried flashing the gateway with IDE and I get a compilation error on line:
MyGateway gw(DEFAULT_CE_PIN, DEFAULT_CS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, 6, 5, 4);
saying that 'MyGateway' does not name a type. Any ideeas ?Thanks.
LE: Figured it out... my bad, compiling now.
LLE: Still doesn't work
LLLE: Tried using these chinese nano ripoffs but they are not detected at all by Vera. These CH340G chips suck so bad... My only way of getting this to work is with my Uno. Will appreciate any help anyone can provide.I have the same problem, can you share what you did to resolve the issue?
Bought an FTDI arduino nano...
-
RE: Trouble flashing Arduino Pro Mini with a sketch
Yes, I did check the output it's 12.3 Volts and my chinese knockoff of the pro mini is rated to work with 12V. I'll try to get a regulator to power it at 5V instead and see how it goes. I don't use LE33, and went instead for the cheaper version the SOT23.
To power it to 5V I intend to use one of those USB adapters for the car's cigarette lighter, because I have a few lying around in my car. -
RE: Trouble flashing Arduino Pro Mini with a sketch
Thanks to @meanpenugin help I was able to finish with the soldering, but now I'm encountering trouble controlling the device.
For example I wasn't able to include it properly the first time, but after a few tries it was added on the dashboard and for some reason it has parent node 255 instead of GW ?
And when I try to control it I'm getting all sorts of errors :08 12/02/14 12:44:38.784 JobHandler_LuaUPnP::HandleActionRequest device: 40 service: urn:upnp-org:serviceId:Dimming1 action: SetLoadLevelTarget <0x2eca0680> 08 12/02/14 12:44:38.784 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=40 <0x2eca0680> 08 12/02/14 12:44:38.785 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:Dimming1 <0x2eca0680> 08 12/02/14 12:44:38.785 JobHandler_LuaUPnP::HandleActionRequest argument action=SetLoadLevelTarget <0x2eca0680> 08 12/02/14 12:44:38.785 JobHandler_LuaUPnP::HandleActionRequest argument newLoadlevelTarget=100 <0x2eca0680> 08 12/02/14 12:44:38.785 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.12523629035042994 <0x2eca0680> 51 12/02/14 12:44:38.789 0x31 0x35 0x3b 0x30 0x3b 0x31 0x3b 0x31 0x3b 0x33 0x3b 0x31 0x30 0x30 0xd 0xa (15;0;1;1;3;100\r\n) <0x2af2a000> 52 12/02/14 12:44:38.856 0x30 0x3b 0x30 0x3b 0x33 0x3b 0x30 0x3b 0x39 0x3b 0x73 0x65 0x6e 0x64 0x3a 0x20 0x30 0x2d 0x30 0x2d 0x31 0x35 0x2d 0x31 0x35 0x20 0x73 0x3d 0x30 0x2c 0x63 0x3d 0x31 0x2c 0x74 0x3d 0x33 0x2c 0x70 0x74 0x3d 0x30 0x2c 0x6c 0x3d 0x33 0x2c 0x73 0x74 0x3d 0x66 0x61 0x69 0x6c 0x3a 0x31 0x30 0x30 (0;0;3;0;9;send: 0-0-15-15 s=0,c=1,t=3,pt=0,l=3,st=fail:100) <0x2e85d680> 08 12/02/14 12:44:46.039 JobHandler_LuaUPnP::HandleActionRequest device: 40 service: urn:upnp-org:serviceId:Dimming1 action: SetLoadLevelTarget <0x2eca0680> 08 12/02/14 12:44:46.039 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=40 <0x2eca0680> 08 12/02/14 12:44:46.039 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:Dimming1 <0x2eca0680> 08 12/02/14 12:44:46.039 JobHandler_LuaUPnP::HandleActionRequest argument action=SetLoadLevelTarget <0x2eca0680> 08 12/02/14 12:44:46.040 JobHandler_LuaUPnP::HandleActionRequest argument newLoadlevelTarget=0 <0x2eca0680> 08 12/02/14 12:44:46.040 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.9738186305664368 <0x2eca0680> 51 12/02/14 12:44:46.048 0x31 0x35 0x3b 0x30 0x3b 0x31 0x3b 0x31 0x3b 0x33 0x3b 0x30 0xd 0xa (15;0;1;1;3;0\r\n) <0x2af2a000> 52 12/02/14 12:44:46.096 0x30 0x3b 0x30 0x3b 0x33 0x3b 0x30 0x3b 0x39 0x3b 0x73 0x65 0x6e 0x64 0x3a 0x20 0x30 0x2d 0x30 0x2d 0x31 0x35 0x2d 0x31 0x35 0x20 0x73 0x3d 0x30 0x2c 0x63 0x3d 0x31 0x2c 0x74 0x3d 0x33 0x2c 0x70 0x74 0x3d 0x30 0x2c 0x6c 0x3d 0x31 0x2c 0x73 0x74 0x3d 0x66 0x61 0x69 0x6c 0x3a 0x30 (0;0;3;0;9;send: 0-0-15-15 s=0,c=1,t=3,pt=0,l=1,st=fail:0) <0x2e85d680>
Any way you can help me resolve this ?
Note that the voltage for the output is not adjusted when I try to control the level of the device.
One thing I've noticed is that after first powering the node the voltage drops consistently from ~9.5 V to about 0.01V in like 1 minute or so. And my arduino pro mini, powered by 12 V (~12.3V actually) is burning up really bad. I believe I might have a loop of some sort in my design ?Thanks.
-
RE: Trouble flashing Arduino Pro Mini with a sketch
@meanpenugin
Thanks so much for the explanation, and I'll try it once again as soon as I have some free time. For anyone looking for the original thread here is a link to it. -
RE: Trouble flashing Arduino Pro Mini with a sketch
Well it must be the FTDI adapter, I went ahead and turned my UNO into a programmer, re-written the bootloader on the pro-mini, then flashed the sketch, and I'll test it after I make some re-touches to the dimmer board.
Actually I have a question if you can answer it, the sketch says the following :
- The MOSFET Gate pin is connected to Arduino pin 3 (LED_PIN),
- The MOSFET Drain pin is connected to the LED negative terminal
- The MOSFET Source pin is connected to ground. -- is this the same as the Negative from the power supply or just GND pin from the Arduino. The schematic kind of confuses me.
LE: I think it's the - of the power supply :
-
RE: Trouble flashing Arduino Pro Mini with a sketch
Well I don't think I have the exact same problem, only if they made another change to the driver - to display a fake ID after the chip was bricked ?
Here's what I see in Device Manager :
-
RE: Trouble flashing Arduino Pro Mini with a sketch
As per the suggestion from this thread I've tried to flash my UNO with the FTDI adapter, but it failed with the same error. It works without issue with the USB connection from the UNO.
I remember for sure that the adapter used to work, and I'm thinking that I might have a fake FTDI adapter. Anyone know how I can try to reflash it so it will work ? -
RE: Trouble flashing Arduino Pro Mini with a sketch
The wiring is done correctly, I've even tried to change the cables a few times until now but nothing works. I have no usb cable - the adapter has an usb port on it :
http://www.aliexpress.com/item/FT232-FT232RL-high-quality-USB-to-TTL-module/1955253925.html
http://www.aliexpress.com/item/Pro-Mini-Module-Atmega328-5V-16M-For-Arduino-Compatible-With-Nano/1503533345.html -
RE: Trouble flashing Arduino Pro Mini with a sketch
@hek The Mini Pro board is connected only to the FTDI adapter, as I went with sockets for both arduino and RF chip, so they can be replaced if something goes bad.
After some digging around I found this on the seller's page :
"I couldn't get to work with factory flashed bootloader- neither in arduino, wiring and stk500 mode (in avrdude). After flashing new bootloader (optiboot_atmega328-Mini.hex from Arduino) with USBasp it's working fine on "-c arduino" mode in avrdude. Here is factory flash dump: http://www.mediafire.com/download/0dazcq8yxv2anv3/boot_mini.7z"
Anyone can tell me how to reflash the bootloader for this board ? I have an arduino uno if it helps.
-
Trouble flashing Arduino Pro Mini with a sketch
Hi Guys,
I really need your help, this thing is driving me nuts. I was trying to build my first LED Dimmer, and made the physical board with sockets and all, and when I got to the part of flashing my Pro Mini, I keep getting this error :
avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch System wide configuration file is "C:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf" Using Port : \\.\COM3 Using Programmer : arduino Overriding Baud Rate : 57600 avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Recv: avrdude: stk500_getsync(): not in sync: resp=0x00 avrdude done. Thank you.
I've looked online, tried several debug methods I found but nothing works. I'm using an FTDI adapter, and I remember some time ago I was able to flash my pro mini with a temperature sketch, I think. This is what I've tried, with no results :
http://www.instructables.com/id/A-solution-to-avrdude-stk500getsync-not-in-syn/?&sort=ACTIVE&limit=40#DISCUSS
COM3 is the correct port, the board is selected correctly, the led on pin 13 blinks ever few seconds, I even tried removing drivers and downgrading the version. My FTDI adapter has VID 403 and PID 6001 and I am running windows 8.1.I would appreciate any help you can offer. Thank you.
-
RE: Vera Plugin does not start inclusion
I had the same issue when using a CH340 nano clone... I had to get an FTDI based one, then worked without issues. Unlike you, I wasn't able to get my genuine Arduino uno to work with the plugin, even if I resolved the serial port detection.
-
RE: Vera Plugin does not start inclusion
What USB chip does your nano have ? FTDI or CH340 ?
-
RE: Help with setup
Hi Guys,
It's been a while since I posted here, but I just got my new chinese iduino based on an FTDI chip and was able to get it to work as a gateway, then used one of the other arduino nano hooked up to a motion sensor and was detected by the gateway and I have to say this is AWSOME !!! You guys have done a phenomenal job !!!!
Now I have some other questions... the motion sensor seem to remain tripped only for a few seconds, can you tell me where can I adjust this to say.... 20 seconds ? I've seen in the sketch this : unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
But it doesn't seem that way, should I adjust it from the sensor itself as explained below ?
One more question, can anyone explain why would it set itself as arduino Node 80 (not that I care too much ), being the first and single device ?
Next thing I wanna build is a multisensor, motion + temperature (dallas temperature sensor) sensor. Anyone got a good sketch I might use ?
I would also want to use a temperature sensor + 1 relay for some automation I have in mind.Thank you very much, for any opinions you might have.
LE: I wanted to do some range tests, and disconnected the motion sensor (powered by usb from computer or phone charger) but it seems that once I've disconnected it and moved it around I was never able to get to work again. Not even placing it back in the same location it used to work it still failed to report to Vera - nothing on the logs from the sensor - looks like it vanished. Did I do something wrong ?
LLE: I reset the gateway and it started to work. Anyone know why it would freeze and stop receiving incoming messages ?I know I've asked a lot of questions but hopefully someone can help me
-
RE: MySensors and Vera UI7
@hek : Do you have plans to upgrade the plugin for UI7 use ? I know the guys at MCV are willing to assist any developer with the upgrade :
http://forum.micasaverde.com/index.php/topic,27645.0.html -
RE: SOT23 or LE33
@hek : Thanks so much... no idea why I didn't see that earlier. I think you can close this post.
-
SOT23 or LE33
Hi guys,
I'm planning on ordering some power regulators for my 5V Pro mini`s, and it seems both should work fine(SOT23 and LE33)... I'm looking at ordering the SOT23, as they are so much cheaper -even if smaller- but I can't find an exact schematic on how I should connect them from the 5V of the mini to the 3v3 of the NRF24L01+.
Can anyone help me with this ?
Is it as simple as the picture below?
Thanks, and sorry for the noob question
-
RE: Help with setup
Will any FTDI based arduino nano work ?
I saw an iduino on aliexpress and I'm not sure if it will work...
I also got a reply from the seller that this also has FTDI chip onboard. Wondering if they'll be compatible or not. -
RE: Help with setup
I've tried flashing the gateway with IDE and I get a compilation error on line:
MyGateway gw(DEFAULT_CE_PIN, DEFAULT_CS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, 6, 5, 4);
saying that 'MyGateway' does not name a type. Any ideeas ?Thanks.
LE: Figured it out... my bad, compiling now.
LLE: Still doesn't work
LLLE: Tried using these chinese nano ripoffs but they are not detected at all by Vera. These CH340G chips suck so bad... My only way of getting this to work is with my Uno. Will appreciate any help anyone can provide. -
RE: Help with setup
Hi Hek,
Thank you for the suggestion... I was thinking of using IDE tomorrow. Can you tell me if the plugin should be displayed like this on Vera ?
This doesn't seem right to me... When I press Start it should be highlighted right ?
I appreciate the huge work you've done and will do my best to help the community as much as I can. -
Help with setup
Hi guys,
I need your help in figuring this out.
I have 1 arduino uno, 2x arduino nano (chinese copies) which I'm trying to get to work as a gateway and 1 PIR and temperature sensor.
At first I had trouble getting the UNO detected by Vera's serial, but I've fixed this so this isn't a problem.
I've flashed both gateway and 1 PIR nano sensor from Firefox using the built-in flasher. I've tested each device directly to the computer and they seem to be working properly.I've loaded up the plugin, latest version 1.4 from git, but the icon on the Vera unit does not show Lib Version, only the plugin version. Also Start and Stop do not stay highlighted, which I think it's strange ?
The issue I have is that no matter how close or what I try the nano with the PIR sensor is not detected by the plugin.Below some raw logs from when I press on Include :
08 09/27/14 19:42:25.991 JobHandler_LuaUPnP::HandleActionRequest device: 19 service: urn:upnp-arduino-cc:serviceId:arduino1 action: StartInclusion <0x2d93b680>
08 09/27/14 19:42:25.992 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=19 <0x2d93b680>
08 09/27/14 19:42:25.992 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-arduino-cc:serviceId:arduino1 <0x2d93b680>
08 09/27/14 19:42:25.992 JobHandler_LuaUPnP::HandleActionRequest argument action=StartInclusion <0x2d93b680>
08 09/27/14 19:42:25.993 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.8403925963750314 <0x2d93b680>
50 09/27/14 19:42:26.007 luup_log:19: Arduino: Sending: 0;0;3;0;5;1 <0x2b208000>
25 09/27/14 19:42:26.007 luup_io_write 19 size: 11 <0x2b208000>
51 09/27/14 19:42:26.008 0x30 0x3b 0x30 0x3b 0x33 0x3b 0x30 0x3b 0x35 0x3b 0x31 0xd 0xa (0;0;3;0;5;1\r\n) <0x2b208000>And this is what I get from the PIR(motion) sensor - which I think it's working fine :
req node id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
1
req node id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,st=ok:
0
I can provide logs from the gateway but it should be working fine as well. I've also tried adding a capacitor to the wireless chip, a 22uF cap between 3v3 and GND.
Can anyone help me ? I've been looking through mcv forum and this one but wasn't able to figure it out.Thank you.