Project

General

Profile

Actions

Feature #1191

closed

Add pwremote to imlightsw repo

Added by Hammel 4 days ago. Updated 3 days ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
Sensors
Target version:
Start date:
27 Mar 2025
Due date:
% Done:

100%

Estimated time:
Severity:
01 - Critical

Description

This will be a simple Arduino controller, based on ESP01 (because I have lots of those), that controls off-the-shelf 433MHz outlets.

I will use the ESP8266 Remote Controlled Sockets tutorial as an outline.
The code will require
  • rc-switch as a submodule
  • A receiver app, pwscan , for scanning for a remote's codes. The code for this is in the tutorial.
  • An Ironman sensor, pwremote , that actually controls the outlets and integrates with IronMan. The signalling code is in the tutorial example for sending commands.

This will have a unique requirement: a shared submodule for rc-switch. Since both apps needs to use it, I will need to put both apps in a subdir, pwrmgmt, which will hold the app directories and the submodule. The pwrmgmt.mk will cd into pwrmgmt directory and build the APP=<> app.

pwremote and pwscan require
  • ESP01
  • Mains power to 3.3V for the ESP01
  • Possible antenna extension?

It might be possible to put both into a single app with a push button/switch the toggles the boot mode. But that probably won't help unless I add some web service code to display the codes it finds. It also might not work because I need to use a button/toggle to switching between operational mode and pairing mode and there are not enough GPIOs for that. I would need to add some kind of I2C device or maybe just an xor in hardware or something.

Actions #1

Updated by Hammel 4 days ago

  • Description updated (diff)
Actions #2

Updated by Hammel 3 days ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 20

My sandbox has the updates for the receiver code, pwscan. The code was uploaded to an Arduino UNO but has not been tested with against a remote control yet.

There is no need for an APP=<> environment variable when building. The pwscan can be built with "make pwscan", which just passes the relative path to the sketch. The same will be true for "make pwremote".

Also, rc-switch doesn't need to be a submodule as it's been integrated upstream and can be installed with the Arduino-cli. This has been integrated with the rest of the library management in the imlightsw (as it's currently called) repository.

The pwremote still needs to be implemented.

Actions #3

Updated by Hammel 3 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 20 to 100

The example code didn't quite work as I wanted, but switching to the code in the rc-switch examples (ReceiveDemo_Simple and SendDemo) worked perfectly. These are just stubs for now and the pwremote just turns the outlet mapped to button 1 on the BN-Link remote on and off repeatedly. But pwscan correctly reported the on and off buttons and I was able to hard code those in pwremote.

That's enough for this issue. I will add more feature-specific issues as I go.

Code committed and pushed.

Closing issue.

Actions

Also available in: Atom PDF