This should work with Domoticz, it's what I intend to use with it. I've received the boards from China and I'm currently working on a version 2 of this board. There are some errors in the design of version 1 that I need to get out. New version will be up shortly.
Posts made by sebas
-
RE: RGBW LED Controller
-
RE: RGBW LED Controller
@drock1985 said:
Ok, going to have to look at this one very carefully. Just bought a Hue lightstrip a week ago; this looks like more fun.
@sebas , did you by chance do this in KiCad? If you did, do you have a part for the HLK-PM01?
The design is made in Eagle. Is it possible to import Eagle files in KiCad?
-
RE: RGBW LED Controller
@Maciej-Kulawik said:
Some comments:
- You should include resistors (e.g. 100 ohm) between mc pin and transistor gate. Just to protect controller pin agains high current (when gate is charged).
- PWM output is available only for some pins. "On most Arduino boards (those with the ATmega168 or ATmega328), this function works on pins 3, 5, 6, 9, 10, and 11."
So I don't think you can use pin 4 for green. - Additionally - PWM on pins 5 and 6 is a little broken; arduino core libraries use the same timer for millis() and delay() functions. Refer to documentation:
"This will be noticed mostly on low duty-cycle settings (e.g 0 - 10) and may result in a value of 0 not fully turning off the output on pins 5 and 6." - R2 is not necessary. Just enable internal pull-up in controller. The same for R1.
- Your schematic is a little bit ugly There are missing may dots on signal connections.
The rest is quite fine. I also plan to build similar node.
It's the most beautiful schematic I've ever made. It's also the first one I've ever made Thanks for the feedback, really appreciate it. You're right about the PWM pins on the Arduino. My prototype seems to be working fine when connected to pin 4. I'll see what it does when the PCB's arrive.
@Dwalt said:
I am confused as to why this board would be powered by both 12V and 230V. Seems a bit redundant. What use case am I missing?
You could run the board on 12V. This design just takes the GND of the LED power supply and feeds that through the MOSFET's for driving the LED's. With this you can use whatever power supply you need for the LED's and swap them if you upgrade from 12V to 24V for example. I take the 230V that goes in to the LED power supply and feed that in the board for powering the arduino, radio etc.
-
RE: 110v-230v AC to Mysensors PCB board
A question about the fuses. The BOM in the Word document links to two 230V fuses, the PTC and slow blow fuse. If I read the schematic correctly one fuse is on the AC side and one is on the DC side. How does a 230V fuse help on the DC side where there should not be more than 5Vdc? Or am I missing something? As I'm quite new to this I'm probably not reading the schematic correctly or missing something
-
RE: Classic Ethernetshield
Yes, just stick it on your Arduino and your good to go.
I did have to change the pin configuration with an Arduino Mega2560 and the ethernet shield. I've placed a comment with my pin config in that tutorial. -
RE: Compile error with relay example
Thank you! That worked.
Should have tried that... -
Compile error with relay example
I'm writing a sketch with the 1.5 version of MySensors and based on the relay example that's on this site. When I compile I get a lot of errors about stuff not being declared. I'm assuming that the example on the site is correct. What am I missing here?
The compile errors:
Arduino: 1.6.4 (Windows 8.1), Board: "LilyPad Arduino, ATmega328" In file included from C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.cpp:12:0: C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.h:39:28: error: 'DEFAULT_CE_PIN' was not declared in this scope MyGateway(uint8_t _cepin=DEFAULT_CE_PIN, uint8_t _cspin=DEFAULT_CS_PIN, uint8_t _inclusion_time = 1, uint8_t _inclusion_pin = 3, uint8_t _rx=6, uint8_t _tx=5, uint8_t _er=4); ^ C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.h:39:59: error: 'DEFAULT_CS_PIN' was not declared in this scope MyGateway(uint8_t _cepin=DEFAULT_CE_PIN, uint8_t _cspin=DEFAULT_CS_PIN, uint8_t _inclusion_time = 1, uint8_t _inclusion_pin = 3, uint8_t _rx=6, uint8_t _tx=5, uint8_t _er=4); ^ C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.cpp: In constructor 'MyGateway::MyGateway(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)': C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.cpp:27:167: error: no matching function for call to 'MySensor::MySensor(uint8_t&, uint8_t&)' MyGateway::MyGateway(uint8_t _cepin, uint8_t _cspin, uint8_t _inclusion_time, uint8_t _inclusion_pin, uint8_t _rx, uint8_t _tx, uint8_t _er) : MySensor(_cepin, _cspin) { ^ C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.cpp:27:167: note: candidates are: In file included from C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.h:15:0, from C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.cpp:12: C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MySensor.h:145:2: note: MySensor::MySensor(MyTransport&, MyHw&) MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver() ^ C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MySensor.h:145:2: note: no known conversion for argument 1 from 'uint8_t {aka unsigned char}' to 'MyTransport&' C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MySensor.h:136:7: note: MySensor::MySensor(const MySensor&) class MySensor ^ C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MySensor.h:136:7: note: candidate expects 1 argument, 2 provided C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.cpp: In member function 'void MyGateway::begin(rf24_pa_dbm_e, uint8_t, rf24_datarate_e, void (*)(char*))': C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.cpp:41:20: error: 'setupRepeaterMode' was not declared in this scope setupRepeaterMode(); ^ C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.cpp:78:39: error: 'setupRadio' was not declared in this scope setupRadio(paLevel, channel, dataRate); ^ C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.cpp:79:36: error: 'BASE_RADIO_ID' was not declared in this scope RF24::openReadingPipe(WRITE_PIPE, BASE_RADIO_ID); ^ C:\Users\Sebastiaan\Documents\Arduino\libraries\MySensors\MyGateway.cpp:81:23: error: cannot call member function 'void RF24::startListening()' without object RF24::startListening(); ^ Error compiling. This report would have more information with "Show verbose output during compilation" enabled in File > Preferences.
And the sketch
#include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif // MySensors #include <MySigningNone.h> #include <MyTransportNRF24.h> #include <MyHwATMega328.h> #include <MySensor.h> #include <SPI.h> MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW); MyHwATMega328 hw; MySensor gw(radio, hw); // Initialize leds #define ledPin 8 #define numPixels 24 Adafruit_NeoPixel strip = Adafruit_NeoPixel(24, ledPin, NEO_GRB + NEO_KHZ400); int pinOff = 3; int pinWhite = 4; int pinRed = 5; int pinGreen = 6; int pinBlue = 7; int power = 0; void setup() { Serial.begin(9600); pinMode(pinOff, INPUT); pinMode(pinWhite, INPUT); pinMode(pinRed, INPUT); pinMode(pinGreen, INPUT); pinMode(pinBlue, INPUT); strip.begin(); // Turn light off strip.show(); Serial.println("Led light ready"); Serial.print("Power is: "); Serial.println(power); } void loop() { int off = digitalRead(pinOff); int white = digitalRead(pinWhite); int red = digitalRead(pinRed); int green = digitalRead(pinGreen); int blue = digitalRead(pinBlue); if(off == 0) { //Off button pushed Serial.println("Off button pushed"); turnOff(); delay(2000); } if(white == 0) { Serial.println("White button pushed"); turnWhite(); delay(2000); } if(red == 0) { Serial.println("Red button pushed"); turnRed(); delay(2000); } if(green == 0) { Serial.println("Green button pushed"); turnGreen(); delay(2000); } if(blue == 0) { Serial.println("Blue button pushed"); turnBlue(); delay(2000); } } void turnOff() { Serial.println("Turning lights of"); strip.setBrightness(0); strip.show(); } void turnWhite() { Serial.println("Setting light to white"); for(int i=0;i<numPixels;i++) { strip.setPixelColor(i, 255, 255, 255); } strip.setBrightness(255); strip.show(); } void turnRed() { Serial.println("Setting light to red"); for(int i=0;i<numPixels;i++) { strip.setPixelColor(i, 255, 0, 0); } strip.setBrightness(255); strip.show(); } void turnGreen() { Serial.println("Setting light to green"); for(int i=0;i<numPixels;i++) { strip.setPixelColor(i, 0, 255, 0); } strip.setBrightness(255); strip.show(); } void turnBlue() { Serial.println("Setting light to blue"); for(int i=0;i<numPixels;i++) { strip.setPixelColor(i, 0, 0, 255); } strip.setBrightness(255); strip.show(); }
-
RE: MySensors 1.5 Released
Very nice. How do I find out how the new sensor types work? Specifically the RGB and RGBW sensors.
I've browsed through the source code but haven't found it yet. What file should I be looking into? -
RGB control
Is there an rgb control node type in the API? Just browsed through the API documentation and couldn't find it. I've got some neopixels I would like to control through mysensors. The dimmer and switch type allow me to switch the light on/off and dim them but would be nice if I'd be able to control the RGB colors.
-
RE: Dimmer doesn't appear in devices
Did you enable Domoticz to detect new hardware? It's the default setting but you can turn of the auto inclusion.
-
RE: seeking advice on system architecture for custom, responsive UI
It's possible to do this with HTTP as well. For example use websockets (http://socket.io/) to keep the connection between the client and the server open. Then the server can push device state changes to your clients in real time without the client having to pull every x seconds.
Here's a blog post on using websockets in native Android and iOs apps. http://www.elabs.se/blog/66-using-websockets-in-native-ios-and-android-appsDomoticz has a good REST Api you can use but you'll need to implement the websockets part yourself.
A thin client architecture seems heavy. You'll need a decent server to connect all the clients that's on 24/7 and you have to work with VPN connections when you're not on your local network.
-
RE: Temp and Relay node
Sounds like a problem in the arduino <-> relay communication as the Arduino is receiving data from Domoticz. Have you tested that the relay works by directly putting power on the signal pin of the relay?
-
RE: Measure temperatur and humidity in different rooms, Wireless
For the internet you could add a GSM shield to the gateway or a 3G usb stick to the Rpi. If you only pay for the data that's send than you could leave the internet on 24/7.
I would put the Rpi running the controller in the same house as the gateway so no data is lost because of a loss of the internet connection.
If you would want to connect to the controller to check the statistics or status of the switches and sensors you would connect to the controller via the internet. Using a dynamic dns service it wouldn't be a problem if the ip-address of the controller changes.Sensors are connected to the arduino via cable. The sensor arduino connects to the gateway wirelessly.
Thinking of it you could connect the Rpi to a VPN server running in your home so it will get a local ip-address of your home network. That way there's no need for the dynamic dns service.
-
RE: Messages received by gateway in strange format
Yes, sorry. Baud rate is indeed 115200 and not 115600. I'll have to check Domoticz to see if I can change those values. I would expect others to have the same problem if those were set incorrectly. I seem to be the only one.
-
RE: Messages received by gateway in strange format
In the serial monitor or in Domoticz? Is it possible to set that somewhere in MySensors?
The monitor is set to 115600 en that works as all the output is fine, just not the message send by Domoticz. -
Messages received by gateway in strange format
I'm having trouble with sending commands from Domoticz to the gateway. From the gateway to Domoticz works fine. Sensors are detected and reporting data just fine. Now I added a relay and the relay is detected and shown under devices. Now when I click the switch to activate the relay nothing happens.
To debug that I added a line of code to the ethernet gateway from the tutorials section of this website to print the incoming message to the serial monitor. The message that is printed in the monitor is this:
00;0;3;0;14;Gateway startup complete. Incoming message ยงรยฉ
I added the "Incoming message" part. It seems that the message send by Domoticz is in the wrong character encoding, or that's my best guess.
Haven't received a response on the Domoticz forum yet so I thought to give it a try here.
I'm using an ethernet gateway on a Arduino Mega 2560 with an ethernet shield.
-
RE: help newbie: MEGA2560 + Ethernet Shield = always fails
I'm working with a Mega 2560 and ethernet shield. I needed to change the pins in the RF24_config.h file to get it to work.
This is from my RF24_config.h
#elif defined SOFTSPI // change these pins to your liking // const uint8_t SOFT_SPI_MISO_PIN = A2; const uint8_t SOFT_SPI_MOSI_PIN = A1; const uint8_t SOFT_SPI_SCK_PIN = A0; const uint8_t SPI_MODE = 0; #define _SPI spi
And this is my gateway code
-
RE: newbie: ethernet gw and first sensor
If I understood correctly (I'm new with MySensors myself) the controller hands out the id's used by the sensors and gateway. Try adding the sensor to fhem and see if that helps.
-
RE: newbie: ethernet gw and first sensor
You will need a controller that gives your sensors an Id and will process the data that is generated by them. The sensors connect to the gateway and the gateway connects to the controller.
Have a look at this page for the possible controllers you can use. I'm using Domoticz on a Raspberry Pi but you can install that on a Windows, Linux or Apple computer as well.
-
RE: Newbie question about network security
Thanks. Didn't know I had to secure that at the Domoticz end. Got it.
-
Newbie question about network security
Sorry if this a noob question but I couldn't find the answer to it using search. How are sensors added to the MySensors network? Or more specifically how do I prevent sensors being added?
Yesterday I build my first gateway (ethernet) and sensors and after some tweaking with the pin numbers the code works and the sensor connected to the gateway and showed up in the controller (Domoticz). I'm happy it works and it's almost plug and play.
This makes me wonder how I can secure the access to the network a bit so no-one but me can add sensors and actuators to my MySensors network. Is this in some way possible?