Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiple independent GPIO sending support via MQTT. #661

Merged
merged 1 commit into from
Apr 4, 2019

Conversation

crankyoldgit
Copy link
Owner

Experimental code for #645 feature request.

Note: Only tested with just a single transmit channel/gpio.

@sheppy99 Can you please test this with your desired multiple IR LED desired config?

Experimental code for #645 feature request.

Note: Only tested with just a single transmit channel/gpio.
@sheppy99
Copy link

sheppy99 commented Apr 3, 2019

Will do, I just had a flick through the code - like the use of different topics which makes more sense than my idea of adding another parameter to the sending string. I need to add extra transistors to the board so it may take a while to test.

@crankyoldgit
Copy link
Owner Author

Will do, I just had a flick through the code - like the use of different topics which makes more sense than my idea of adding another parameter to the sending string. I need to add extra transistors to the board so it may take a while to test.

No rush. I'm fairly happy with the code as it is.
i.e. I've tested it in it's default config (where it listens on ir_server/send and ir_server/send_0) and it works enough to control my stereo.
I even tested adding a 2nd channel (ir_server/send_1) and using it didn't crash, but it didn't have an LED attached to the GPIO) so I can't confirm 100% etc. It did pretty much everything I expected it should without testing the hardware aspect.

Copy link
Collaborator

@markszabo markszabo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codewise looks good

@sheppy99
Copy link

sheppy99 commented Apr 4, 2019

Does it still output what's been sent on ir_server/sent or is it now ir_server/sent_0 etc?
I'm wondering if there's an easy way of separating out the reconnection messages such as "IR Server just (re)connected to MQTT. Lost connection about 5 seconds ago" That way I can get OpenHAB to resend the last message after a reconnection.

@crankyoldgit
Copy link
Owner Author

Does it still output what's been sent on ir_server/sent or is it now ir_server/sent_0 etc?

Still ir_server/sent.

I'm wondering if there's an easy way of separating out the reconnection messages such as "IR Server just (re)connected to MQTT. Lost connection about 5 seconds ago" That way I can get OpenHAB to resend the last message after a reconnection.

I'm not sure what you are after here. What do you want to have happen?

@sheppy99
Copy link

sheppy99 commented Apr 4, 2019

I'm not sure what you are after here. What do you want to have happen?

Have error messages on their own topic.
Currently the topic ir_server/sent gets both the sent message and also errors.
Alternatively does it, or could it, easily support LWT for loss of MQTT connectivity?
Its been up for almost 4 days now (previous version) and it has had 10 disconnections, it would be useful to see when these happen so I can see if I can track the cause, and resend any missing commands

@crankyoldgit
Copy link
Owner Author

yeah, we can easily have a different status topic (LWT) and an errors topic etc.
I'll also look at upping the QoS to 1.

Can you file an issue/feature request for that please?

@sheppy99
Copy link

sheppy99 commented Apr 4, 2019

done! I've also written a dirty bodge in OpenHAB that will work in default mode to allow me to troubleshoot in the short term. Basically when the string comes in I split it at the first comma and check for the presence of 53 (Daikin2 Protocol). If its not there I log what is, hopefully this will allow me to find if there is a cause of any dropouts

@crankyoldgit crankyoldgit merged commit 41efc71 into master Apr 4, 2019
crankyoldgit added a commit that referenced this pull request Apr 4, 2019
- Move log messages to their own MQTT topic. (ir_server/log)
- Set up a Last Will & Testament topic (ir_server/status)
- Change MQTT QoS to 1, which should hopefully handle messages lost during disconnects.

Tested log and LWT functionality on my personal device. Everything seems to work as normal.

Fixes #662
Ref #661
@crankyoldgit crankyoldgit deleted the mqtt_multisend branch April 5, 2019 11:26
@sheppy99
Copy link

sheppy99 commented Apr 6, 2019

I'm going to update my Huzzah today to test your latest changes, which branch would you like me to test?
There's the new multisend which I think has been merged plus new feedback topics plus the common command structure from what I can see.
Currently I send the full string to the ESP, but I can change this to test more of your library if there is documentation for the common command structure
I've also started a 60 second ping to the ESP with logging to see if I can isolate the reconnections which are running at 14 over 6 1/2 days.

@crankyoldgit
Copy link
Owner Author

@sheppy99 For you, the best branch to test is the one associated with PR #663 i.e. https://github.com/markszabo/IRremoteESP8266/tree/Issue662
It should include this (#661 , #645) also.

The new common_ac branch isn't used by anything yet. I've still got to add that to IRMQTTServer, but after it's PR is merged etc.

@sheppy99
Copy link

sheppy99 commented Apr 8, 2019

A quick test is looking good, the conventional single channel part works fine, and I'll add another channel at some stage to test with. Before I compiled the firmware I updated a few libraries, and have had only one disconnection so far in 23 1/2 hours and that was because I rebooted OpenHAB.

crankyoldgit added a commit that referenced this pull request Apr 10, 2019
- Move log messages to their own MQTT topic. (ir_server/log)
- Set up a Last Will & Testament topic (ir_server/status)
- Change MQTT QoS to 1, which should hopefully handle messages lost during disconnects.

Tested log and LWT functionality on my personal device. Everything seems to work as normal.

Fixes #662
Ref #661
crankyoldgit added a commit that referenced this pull request Apr 30, 2019
_v2.6.0 (20190430)_

**[Bug Fixes]**
- Fixed problem where LG protocol used wrong duty cycle for repeat. (#687)
- Fix checksum calculation for Daikin protocols. (#678)
- Fix the byte array version of sendGree() (#684, #685)
- Fix artificial vs. real state creation on HaierAC. (#668, #671)
- Fix issues caused by having `MQTT_ENABLE` set to false. (#677)
- Fix compile problem when DEBUG is defined. (#673, #674)
- Fix Minor bug with MQTT_ENABLE False condition (#654)

**[Features]**
- Experimental support for DAIKIN216 (ARC433B69) (#690)
- Experimental support for Mitsubishi Heavy Industries A/Cs. (#660, #665, #667)
- Support more features of TCL A/C (#656)
- Add LEGO(TM) Power Functions IR protocol. (#655)
- Add Panasonic AC RKR model & Example (#649)
- DAIKIN/IRDaikinESP overhaul and add Comfort mode support. (#678)
  **WARNING**: Previous `sendDaikin()` calls may not work.
               Please recapture codes or use `kDaikinStateLengthShort` for
               `nbytes` in those calls.
- IRMQTTServer: Move MQTT server and other parameters to WifiManager. (#680)
  **WARNING**: Previous users may need to fully wipe/reset the
               SPIFFS/WifiManager settings by visiting
               `http://<your_esp8266's_ip_address>/reset` prior to or
               after update.
- Add Wifi filtering options to IRMQTTServer. (#679)
- Add advanced aircon/climate functionality to IRMQTTServer (#677)
- Initial prototype of a common interface for all A/Cs. (#664)
- Improve MQTT topic usage for feedback messages. (#663)
- Add multiple independent GPIO sending support via MQTT. (#661)

**[Misc]**
- Adjust kGreeHdrSpace to 4500 (#684, #686)
- Add Home Assistant mqtt climate instructions. (#682)
- Implement htmlEscape() to prevent XSS etc. (#681)
- Add F() Macros (#670)
- Update Daikin2's Cool mode min temp to 18C (#658)
- Change per byte bit-order in Electra protocol. (#648)
- Improve Daikin2 power on/off. (#647)
@crankyoldgit crankyoldgit mentioned this pull request Apr 30, 2019
crankyoldgit added a commit that referenced this pull request Apr 30, 2019
_v2.6.0 (20190430)_

**[Bug Fixes]**
- Fixed problem where LG protocol used wrong duty cycle for repeat. (#687)
- Fix checksum calculation for Daikin protocols. (#678)
- Fix the byte array version of sendGree() (#684, #685)
- Fix artificial vs. real state creation on HaierAC. (#668, #671)
- Fix issues caused by having `MQTT_ENABLE` set to false. (#677)
- Fix compile problem when DEBUG is defined. (#673, #674)
- Fix Minor bug with MQTT_ENABLE False condition (#654)

**[Features]**
- Experimental support for DAIKIN216 (ARC433B69) (#690)
- Experimental support for Mitsubishi Heavy Industries A/Cs. (#660, #665, #667)
- Support more features of TCL A/C (#656)
- Add LEGO(TM) Power Functions IR protocol. (#655)
- Add Panasonic AC RKR model & Example (#649)
- DAIKIN/IRDaikinESP overhaul and add Comfort mode support. (#678)
  **WARNING**: Previous `sendDaikin()` calls may not work.
               Please recapture codes or use `kDaikinStateLengthShort` for
               `nbytes` in those calls.
- IRMQTTServer: Move MQTT server and other parameters to WifiManager. (#680)
  **WARNING**: Previous users may need to fully wipe/reset the
               SPIFFS/WifiManager settings by visiting
               `http://<your_esp8266's_ip_address>/reset` prior to or
               after update.
- Add Wifi filtering options to IRMQTTServer. (#679)
- Add advanced aircon/climate functionality to IRMQTTServer (#677)
- Initial prototype of a common interface for all A/Cs. (#664)
- Improve MQTT topic usage for feedback messages. (#663)
- Add multiple independent GPIO sending support via MQTT. (#661)

**[Misc]**
- Adjust kGreeHdrSpace to 4500 (#684, #686)
- Add Home Assistant mqtt climate instructions. (#682)
- Implement htmlEscape() to prevent XSS etc. (#681)
- Add F() Macros (#670)
- Update Daikin2's Cool mode min temp to 18C (#658)
- Change per byte bit-order in Electra protocol. (#648)
- Improve Daikin2 power on/off. (#647)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants