Take a look at this topic on the Domoticz forum: http://www.domoticz.com/forum/viewtopic.php?f=34&t=8751
Posts made by ToniA
-
RE: Heatpump controller
-
RE: What is a good value for a watch dog timer?
Also the stock bootloader is broken so that in reboot, it sets the watchdog timer to a very small value (so that a reboot would happen before the sketch has done 'setup()'), but does not turn off the watchdog it it was enabled in the sketch -> eternal reset loop if you ever reboot from a watchdog-enabled sketch.
Optiboot, MYSBootLoader etc. would work fine.
-
RE: Has anyone tried software reset of an Arduino?
For whatever strange reason, the Arduino stock bootloader is broken, so that it will not disable the watchdog on startup, causing just an infinite reset loop. I'd recommend updating the bootloader with something like MYSBootloader or Optiboot.
-
RE: AC IR code decrypting
This is what I have done as a hobby so far: https://www.openhardware.io/view/41/Heatpump-airconditioner-controller
There's no Gree support in the HeatpumpIR library, though.
-
RE: AC IR code decrypting
@dpressle said:
@ToniA can you elaborate?
Yes, on my AC IR decoder sketch I have decoder modules for different heatpumps. Like this:
https://github.com/ToniA/Raw-IR-decoder-for-Arduino/blob/master/MitsubishiElectric.cpp
So, write a new one, and add a call to it into https://github.com/ToniA/Raw-IR-decoder-for-Arduino/blob/master/rawirdecode.ino#L315. First you need to write a condition to recognize the protocol (like, from the first bytes + length etc). Then just start adding functionality, like decoding the temperature, then operating mode etc.
-
RE: AC IR code decrypting
How about writing a new decode module into Raw-IR-decoder-for-Arduino? I find it very useful in trying to figure out how a certain A/C protocol works.
-
RE: incomingMessage is not initiated on relay sensor
The experience I have is from running the serial gateway on Sensebender (which is a 8MHz device, running on 3.3V). It just didn't work at all, and as soon as changed the serial speed to 38400 everything was just fine.
It also doesn't matter whether you connect through USB or RS-232, it's still the same problem. Another 'nice' finding was that Arduino Nano has a hardware problem, it's not discovered as a USB device when Raspberry boots up. I had really interesting times when trying to use it as the serial gateway, works fine when plugged in when Raspberry is running, but it's lost on every boot.
https://ketturi.kapsi.fi/2014/04/how-to-fix-moody-arduino-nano/
-
RE: Is it possible to connect a Pro Mini directly to Raspberry Pi GPIO for Gateway?
It's the /dev/ttyAMA0. See this: https://www.raspberrypi.org/forums/viewtopic.php?p=139945
Domoticz runs as root (which is a really bad thing IMHO), so it has no problems with this.
-
RE: Is it possible to connect a Pro Mini directly to Raspberry Pi GPIO for Gateway?
I've done the same with SenseBender, so it should work with Pro as well. You only need 4 wires, GND, Vcc, RX, TX.
If it's a 3.3V model, it runs on 8 MHz, so you need to set the serial speed to 38400. At 115200 the serial speed is too much off to work reliably.
-
RE: Raspberry Pi with Arduino Nano USB serial gateway
Hmm. I'm going to try this: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=59420
Seems like I need to solder the pins 25 & 26 together on the USB chip of the Nano. Now my Duemilanove is failing to connect on boot as well...
-
Raspberry Pi with Arduino Nano USB serial gateway
I'm trying to use Arduino Nano as serial gateway on RPi 2, but I'm stuck with the Nano not being detected when Raspberry boots up. To make it weirder, it works fine if I plug the Nano in when the RPi is already running... A Duemilanove board works fine, but I was hoping for something smaller.
Does anybody have any idea what's wrong with this setup?
Duemilanove is detected fine on boot (dmesg):
[ 3.864401] usb 1-1.2: new full-speed USB device number 4 using dwc_otg ... [ 4.013350] usb 1-1.2: New USB device found, idVendor=0403, idProduct=6001 [ 4.013363] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 4.013372] usb 1-1.2: Product: FT232R USB UART [ 4.013381] usb 1-1.2: Manufacturer: FTDI [ 4.013389] usb 1-1.2: SerialNumber: A101KWLO
... but the Nano isn't:
[ 4.115330] usb 1-1.4: new full-speed USB device number 5 using dwc_otg ... [ 4.205056] usb 1-1.4: device descriptor read/64, error -32 ... [ 4.401434] usb 1-1.4: device descriptor read/64, error -32
Also 'lsusb' doesn't show it.
But if I plug it in into a running RPi, it works just fine, until it's again lost on the next reboot:
[ 122.544930] usb 1-1.4: new full-speed USB device number 10 using dwc_otg [ 122.673685] usb 1-1.4: New USB device found, idVendor=0403, idProduct=6001 [ 122.673714] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 122.673731] usb 1-1.4: Product: FT232R USB UART [ 122.673746] usb 1-1.4: Manufacturer: FTDI [ 122.673761] usb 1-1.4: SerialNumber: AL01GVNR [ 122.682518] ftdi_sio 1-1.4:1.0: FTDI USB Serial Device converter detected [ 122.682797] usb 1-1.4: Detected FT232RL [ 122.683895] usb 1-1.4: FTDI USB Serial Device converter now attached to ttyUSB1
-
RE: Node are not receiving messages from domoticz
8 MHz Arduinos absolutely need to use lower baud rate than 115200. The baud rate is generated from the internal clock, and at 8 MHz 38400 bps is the highest baud rate close enough to the standard.
-
RE: Size of icons in forum mobile view
It's not the same thing. The title goes to the first post of the topic, and the arrow goes to the last post.
-
Size of icons in forum mobile view
This is a really nice forum in mobile phone, but the size of the new posts icon is awfully small... I mean the right-pointing arrow on the right. Any chance to forward this feedback to the forum developers?
-
RE: Sensebender Micro as gateway on raspberry pi
Yes, it's about the baud rate. 38400 works for me, and I even made a pull request (not yet merged, though): https://github.com/mysensors/Arduino/pull/391
Recent Domoticz beta's also have a feature to select the baud rate for MySensors serial gateway (default 115200, 38400 as an alternative). This of course needs to match with the baud rate on the gateway itself.
-
RE: RF24_PA_LEVEL and options
I was just yesterday testing a system I'm going to install on the summer cottage, and noticed that I get hardly 2 meters range. Then I noticed the sketch has 'RF24_PA_LOW' by default.
Is it OK/safe etc. to use the highest PA level for the PCB antenna versions of nRF24 ?
-
RE: [SOLVED] Trash in serial monitor when battery powering... (trying to troubleshoot a hang)
Are you using the 115200 baud rate (I guess you are)? Try lowering the baud rate down to 38400 if you are running on 8 MHz. On 1 MHz you may need to go down to 4800. Well, this doesn't explain why you get total garbage, but at 115200 you get corrupted characters every once and a while, frequently enough to make serial transfer from PC to Arduino a mess.
See these tables:
http://wormfood.net/avrbaudcalc.php?postclock=8&hidetables=1
http://wormfood.net/avrbaudcalc.php?postclock=1&hidetables=1For the same reason you can't use Sensebender or Pro Mini 3.3V as the serial gateway, unless you set the baud rate down to something like 38400.
-
RE: Physically small Gateway (to fit inside Raspberry Pi case)
I made a pull request. The sketch GatewaySerial.ino now sets the serial speed to 38400 if the Arduino is running on 8MHz clock speed.
https://github.com/mysensors/Arduino/pull/391
EDIT: My pull request was accepted into the Domoticz master branch
-
RE: Physically small Gateway (to fit inside Raspberry Pi case)
@gloob said:
The strange thing is, that the receiving Messages from nodes and sending the Content to the Controller was working. Only sending values from the Controller to the nodes was not working.
Yep, I had exactly the same problem. Looks good on the surface, but no commands were sent out.
-
RE: Physically small Gateway (to fit inside Raspberry Pi case)
OK, I think I'm good to go. I'll try to make a change & pull request into Domoticz (additional checkbox on 'MySensors USB gateway' device) to tell it's a '3.3V 8MHz ATmega328'. In that case the baud rate would be 38400, instead of 115200.
Maybe the MySensors code could also detect (is there a #define for it?) the clock speed/board model/operating voltage, and set the serial speed to 38400 for 8MHz on 8MHz boards.
-
RE: Physically small Gateway (to fit inside Raspberry Pi case)
One more thing. Gizmocuz (Domoticz author) was concerned about performance. Would you think it's fine to run the serial gateway on 8 MHz clock speed?
-
RE: Physically small Gateway (to fit inside Raspberry Pi case)
OK, found it. It's about the baud rate, 115200 does not work for a Serial Gateway running on a SenseBender. The real baud rate is too much off when the baud rate is generated from the ATmega 328's internal 8 MHz oscillator.
Unfortunately the 115200 baud rate is hard-coded into Domoticz. I just changed the hardcoded value to 38400 in hardware/MySensorsSerial.cpp, and also rebuilt the 1.5.3 version of the SerialGateway with 38400 as the baud rate.
Works fine now But I think I'll need to make a change & pull request to Domoticz.
-
RE: Physically small Gateway (to fit inside Raspberry Pi case)
Or, is it about the 115200 baud rate on a 3.3V ATmega328?
-
Physically small Gateway (to fit inside Raspberry Pi case)
I would like to have the gateway within the Raspberry Pi case, instead of connecting for example Arduino Nano through the USB, and connecting the NRF24 using DuPont wires. But how do I do this? None of the examples I have tried so far have worked correctly with the latest Domoticz beta. And yes, as a starting point, the Serial Gateway on Arduino Nano as of Git tag 1.5.3 works perfectly.
What I have tried so far are
- SenseBender Micro as the Serial Gateway
- One the first glance this seems fine, but it will not transmit anything
- Forum posts about the subject
- Is this caused by the 1 MHz clock speed?
- NRF24 connected directly to the Raspberry Pi's GPIO pins
- https://www.openhardware.io/view/17/Raspberry-Pi2-GPIO-interface-for-NRF24L01
- https://github.com/mysensors/Raspberry
- The MySensors Raspberry Gateway software seems to be on MySensors 1.4 level
- I have great difficulties in the sensor presentation on Domoticz, i.e. my sensors (V_IR_RECEIVE, V_TEXT, V_LIGHT) do not reliably appear as devices on Domoticz. When looking at the properties of the 'MySensors' system device, the sensors are there, however???
Any help would be greatly appreciated... I'd really want to have a small gateway within the Raspberry case.
- SenseBender Micro as the Serial Gateway
-
RE: Powersupply for Arduino Nano
I used to work for Nokia (and later Microsoft), so I have quite a few phone chargers. I've successfully used those Nokia chargers with USB-A connector on the charger itself. I.e. I can plug any USB cable into it, like a USB-A to USB mini (compatible with Nano). But I bet just about any USB power supply would do.
-
RE: Which controller supports AC or TV controlling by IR sensor ?
The 'Level' 0 should be 'OFF' by default, maybe that's the problem, i.e. having 'OFF' twice? If you don't want to show 'OFF', check the 'Hide Off Level' checkbox. I didn't have any problems with this.
-
RE: Which controller supports AC or TV controlling by IR sensor ?
Selector is a rather new feature in Domoticz, I don't remember when it first appeared... You may need to update to the latest beta first, I think the stable doesn't have it.
-
RE: Which controller supports AC or TV controlling by IR sensor ?
All those three sensors are created on the 'dummy' hardware. The first two are new 'multiselector' devices, and the last one is a thermostat. The actual control happens on the event script, it will notice changes on any of those three ones, and then communicate with the MySensors node, using the MySensors devices (not shown on this screenshot, but they do exist in Domoticz).
Yes, a device like PanasonicTV would be nice. But I think programming something like this is a bit beyond my current skills.
-
RE: 💬 Sensebender Micro
I had no problems two weeks ago. Just got them last week.
-
RE: Which controller supports AC or TV controlling by IR sensor ?
It's not that straightforward to control IR devices, you need to understand something about the protocols etc. But there are libraries for this, for example Ken Shirriff's IR library.
For TV's, I'd suggest looking at this: http://z3t0.github.io/Arduino-IRremote/
What comes to air conditioners / heatpumps, I've been working on the HeatpumpIR library for Arduino: https://github.com/ToniA/arduino-heatpumpir
Generally the media devices are much more simple, usually 32 bits are sent, and the command like like 'volume up' or 'switch to channel 3' etc. With air conditioners / heatpumps, the protocol is much more complex, as they typically send out the whole state information in the same data burst, usually this is several hundreds of bits of information.
I have also started to integrate the A/C / heatpump control into Domoticz, but it's still a bit clumsy, as there's no real UI support in Domoticz yet. But I'm able to send IR commands from Domoticz through the MySensors network.
Take a look at these links:
https://github.com/mysensors/Arduino/tree/development/libraries/MySensors/examples/HeatpumpIRController
http://www.domoticz.com/forum/viewtopic.php?f=34&t=7179#p69647 -
RE: Battery operated actuator
This is what I'm using as the control interface: http://www.domoticz.com/forum/viewtopic.php?f=34&t=7179#p69647
It's still under work, but I should be able to have events running on Domoticz, like turn on the A/C if it gets too hot inside the house etc.
-
RE: Heatpump controller
I just got it running on Sensebender today, on my desk. The problem is that this is not a 'sensor', but an 'actuator'. So it needs to listen to the radio all the time. I believe it would not run on batteries for too long.
I was asking about how to power the Sensebender in another thread, but didn't yet get any real answers. So let's try once more:
What kind of schema should I use to power the Sensebender (with NRF24), provided that I have +5V DC available, and I have a bunch of different capacitors and 'LE33ACZ 5V-3.3V Step Down Regulators'?
-
RE: Heatpump controller
Just got my Sensebenders this week. I can confirm that the HeatpumpIR library works also on the Sensebender Nice...
-
RE: Battery operated actuator
@riataman, have you looked at this: https://github.com/mysensors/Arduino/tree/development/libraries/MySensors/examples/HeatpumpIRController, it's based on the HeatpumpIR library I've written? I just added a few new heatpump models yesterday and today into the library...
Anyway, in my project I'm currently using Arduino Nano + NRF24. I placed this inside the indoor unit's covers, IR led next to the IR eye of the unit, and I even stole the power from the air conditioner, as its logic is running on +5V, which is conveniently the same as the operating voltage of the Nano Of course I can't recommend anybody to do that
I just got some Sensebenders this week, so I'm trying to build a way smaller device for the other A/C unit I have.
-
RE: Arduino & Microsoft Competition
Really interesting, maybe I could build something cool around the Arduino HeatpumpIR (https://github.com/ToniA/arduino-heatpumpir) library I've been building. Right now I'm integrating it with Domoticz (http://www.domoticz.com/forum/viewtopic.php?f=34&t=7179#p69647).
I'm an ex-Microsoft employee from Finland (resigned about a month ago).
-
RE: Recommendation: power supply
What I'm after is a (physically) small device acting as an actuator ('always on'), to send IR codes. So, I need to be able to send IR using 38 kHz PWM frequency, and I need to have it externally powered as it's an actuator. And 5V is easily available. The mini rboard would be perfect for a relay, thanks for the tip
So, would the SenseBender + radio run fine, if I power it from a cell phone USB charger using a 'LE33ACZ 5V-3.3V Step Down Regulator' (I already have these, SenseBender is on its way). Do I need to use some capacitors?
-
RE: Recommendation: power supply
@Dwalt But if the idea is to run some actuator (like relay) on it, it must be on all the time.
-
RE: Recommendation: power supply
I've been using Nokia phone chargers (ones with the USB type A connector, so that I could use any USB cable on them, like USB mini on the other end for Arduino Nano).
But how about powering the SenseBender? Do you guys have any good recommendations for a similar, small, sleek design wall outlet power adapter? Or should I use a low-dropout 5V to 3.3V regulator with some capacitor? Would be nice if there was a USB micro -powered version of the Sensebender...
-
RE: Heatpump controller
@DirkB19 said:
@ ToniA, do you expect problems when integrating this into the same Mysensors sketch as PIR + DHT22 ?
It should be fine. Just make sure that if you have any interrupt handlers (PIR?), make sure they execute fast so that they don't mess up the timings. It's probably not a very good idea to disable interrupts while sending the IR, as the IR sending takes several hundreds of milliseconds.
-
RE: Heatpump controller
@Panos-Toumpaniaris said:
Am I missing something?
Yes you are
You just have an uninitialized pointer to PanasonicNKEHeatpumpIR, while you should have this instead:
PanasonicNKEHeatpumpIR *ACIR = new PanasonicNKEHeatpumpIR();
-
RE: Heatpump controller
mharizanov's version of Daikin was different, the protocol now seems to have one extra frame which seems to carry the wall clock time.
The HeatpumpIR library now has the initial (untested) Daikin support.
-
RE: Heatpump controller
Interesting... I took a look at mharizanov's work, and I think I might have a decoder for the protocol here: https://github.com/ToniA/Raw-IR-decoder-for-Arduino
Would you try if this correctly decodes the protocol? I would also appreciate some full outputs of successful decode, together with the explanation of the state the remote control shows after the button press.
If the decoder is correct, creating a Daikin module for the HeatpumpIR library will be a piece of cake
-
RE: Heatpump controller
Quite a co-incidence, I just finished decoding the Sharp/IVT infrared protocol, and pushed my decoder changes into Github:
https://github.com/ToniA/Raw-IR-decoder-for-Arduino
This is the hardware you'd need, just about any Arduino would do, I'm using both Duemilanove and Mega: https://github.com/ToniA/Raw-IR-decoder-for-Arduino/blob/master/arduino_irreceiver.png
If you get the hex sequences and timings out, I can assist with the rest. We can discuss the detail over email (take a look at my Github profile...).
-
RE: Heatpump controller
Yes, I think it would work. I have used this piece of software to decode the bits from the remote.
If you have any heatpump/AC remotes at hand, you could try it out already now. It should also work with TV remotes etc. The only thing is that you might need to adjust the limits it's using to tell the one's and zero's apart.
-
RE: Heatpump controller
I finally managed to get rid of all compiler warnings I must say I like your CI build system, I'm also running Jenkins at work, actually running the build system on Jenkins is my primary job at the moment...
So the heatpump IR sender node is now one of the examples on the MySensors 'development' branch.
-
RE: Power Pro mini 3.3v from usb ?
You need to connect it using a 3.3V USB to serial adapter.
Something like this: http://www.ebay.com/itm/3-3V-USB-to-TTL-Serial-Cable-FT232-Chipset-FTDI-USB-Cable-Adapter-Computer-Cable-/181870867906
-
RE: Heatpump controller
@hek, I created pull request #211. I think it's good enough, the challenges are really on the Domoticz side.
-
RE: Heatpump controller
In live in Finland...
I now have the HeatpumpIR working together with Domoticz, so that I can also define which commands to send from Domoticz. And yes, 24 bits is plenty enough
https://github.com/ToniA/arduino-heatpumpir/tree/master/examples/MySensorsNode
@johnr, do you happen to have an infrared receiver module? If you do, I could assist you in decoding the protocol. This is how I for example got the Mitsubishi protocol decoded, I've never had a Mitsubishi remote controller myself...
-
RE: Request: New Sensor Type ? Thermostatically controlled switch
I've been thinking of integrating my HeatpumpIR library into MySensors. The S_HVAC isn't quite 1:1 mapping to what I've been thinking of, here's a Visual Studio screenshot of my current remote control app (sorry, not a fruit company one :)):
So, I think I'd need to pass this data for example from Domoticz to the MySensors node:
- Heatpump model (could be an index number to the list of supported models)
- Power mode (on/off)
- Operating mode (auto, heat, cool, dry, fan, maintenance heating)
- Temperature (8,10, 16-30 degrees Celcius)
- Fan speed (auto, 1-5)
As this is technically an infrared device, I've been also thinking of using the S_IR node type. I think I could pack the data into a 32-bit integer as an alternative. There's also no Domoticz support for this yet.
Any ideas would be welcome.
-
RE: Heatpump controller
Nice to see that my little HeatpumpIR library made it all the way here
I'm also quite new to MySensors, I actually just started today, I've had all the necessary hardware on my table for some weeks now... My goal is to power a (physically) small MySensors device directly from the Panasonic heatpump, and hide everything within the indoor unit's covers, and have it fully controlled by Domoticz. There's quite a bit of work to do, as for example Domoticz does not have a suitable devuce type yet.
And how about MySensors, I'm still quite a newbie on the messaging schema... Is there a schema which could be used to communicate all of these within the same message:
- ON/OFF information (0 or 1)
- Temperature information (integer from 8 to 30)
- Fan speed information (integer from 0 to 5)
- Mode information (COOL, HEAT etc. i.e. integer from 0 to 6)
What comes to Daikin, it would probably be quite easy to add it into the HeatpumpIR code, provided that I could borrow the remote controller for a while. Or, if somebody else could decode the protocol.