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
[P118] Make CS pin configurable, some refactoring #3889
[P118] Make CS pin configurable, some refactoring #3889
Conversation
…feature/P118-select-cs-and-refactoring
…feature/P118-select-cs-and-refactoring
Shall I already test this on my ESP8266+CC1101 or are you planning to add the Plugin_data_struct soon? |
I'm close to committing those changes as well, not sure I'll manage that today, could be tomorrow end of morning. |
I downloaded the branch from @tonhuisman and build it using Atom. However, when I flash my ESP either OTA or using the ESP Easy Flasher my device will not boot anymore. Below the output of the serial log: INIT : Booting version: pygit2_not_installed (ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support) |
Hmm, there is always a risk when refactoring that something breaks 🤔 |
First disabling P118 and then flashing it with that build did result in a successful boot. But it immediately crashes when I enable the task associated with P118. In the weblog which I had open in another tab nothing is visible. |
Any crashlog is only really visible in the serial log, the weblog can't be updated anymore if the unit is crashing. |
…feature/P118-select-cs-and-refactoring
@svollebregt I've tried to move some bits, and reverted the disable/enable interrupt logic I accidentally introduced when moving the code to |
I connected the device to my PC and opened a serial monitor with your latest commit loaded, with the serial output set to Debug Dev. When I enable the plugin I see the following messages:
No crash dump is generated. I tried this using the serial monitor of Atom, Arduino IDE, and MobaXterm. Do I need a special tool to see a crash log, or does the ESP simply not crash but just freezes? |
To decode the crash dump, you need the ESP connected to the IDE (VS code, not sure if Atom allows the stackdecoder to run) and run "monitor" from the PlatformIO menu. |
The $64000,- question: Does it still crash? (I can't determine that from your comment...) |
I wouldn't be surprised if it did... |
…feature/P118-select-cs-and-refactoring
Well, there is another observation: If the plugin is started when there is no hardware connected, it just hangs forever. Not even the WDT kicks in to revive the unit. At least that's what I get when enabling the plugin, and that's exactly the same behavior I got before I started the refactoring. |
And this is the culprit: https://github.com/letscontrolit/ESPEasy/blob/mega/lib/Itho/CC1101.cpp#L31-L34 |
I was testing it with all hardware attached (minus a CO2 sensor as it uses the serial port, disabled that plugin). I switched to VS Studio, and performed a successful build and monitor. Output on the terminal is the same, seems it hangs and does not crash. |
I see a couple of while loops (at least in the CC1101 library) that have the potential to last 'quite long' (as in 'forever'), if an expected state isn't reached. |
Tried state,1111, but doesn't seem to work. Will see if i can find more in the tweakers.net forums. Hopefully @nl0pvm can assist.
|
What build are you running, a Release build of ESPEasy, of downloaded from this PR's Actions build? That may be the difference, as I tried to modify that behavior, AFAICS... |
Didn't realize there was a new version (not that well versed in github) Was running: I don't see a difference when enabling RF debug. `
|
For my Orcon Fan. It seems every once in a while I see the cmd: 101 in the debug log. And the ID that follows that might be the return "OK" from my fan. All not as consistent as for the ITHO remotes. |
Those input fields expect decimal input, but the logged numbers are hexadecimal. You can use the Windows calculator in Developer/Programmer mode to enter each hex value (separately) to see what the decimal value is and fill in those 3 values. |
Ah; Was thinking about the Unit IDs that are in hex. Thanks will use decimal values for Device ID fields. |
When this option is enabled, and also the Log level is set for Debug, some extra logging is output. This requires the Debug log level to be available, but that's not in the Collection builds... |
This one adds over 5k to the build size. |
I have tested with my Orcon FAN and it seems to work. Now trying with 2 CC1101 chips connected to the same ESP32S2. One for Itho and one for Orcon fan. After some testing and configuring Home assistant 2 questions:
Also I have some suggestions for the documentation page, where can I put those? Couldn't find where in github. |
|
You can email that to me (see GH profile), or place your remarks here, and I will include it. The |
…feature/P118-select-cs-and-refactoring
Not sure if I can still report/ask something here, but I 'm running into an issue. Had to wait for new cc1101 chip. Now i'm running into the following. When sending commands via http directly everything works like i would expect. But when I use MQTT, something is wrong So something seems wrong here. |
That is most likely not related to this plugin. What is the exact topic you send via MQTT? |
…feature/P118-select-cs-and-refactoring
esp-fan/FAN01/cmd = State 1 |
Ah, the topic isn't used to address a specific task, as it's not easy to determine what part of the topic relates to a task, if any, so assuming the tasks are named |
Thanks. This works. Although didn't expect to be able to send commands to either cmd-topic. Still working on right Home assistant configuration not happy with it yet), but when i have everything complete will send you a mail with updates for the documentation. |
@One35SEven Have you seen this section in the docs? Home Assistant (openHAB) MQTT - Command Handling |
…feature/P118-select-cs-and-refactoring
Features/improvements:
CS
pin configurablePlugin_data_struct
to enable multi-instance and save some memoryMoved toCollection E
because of the size increase.CLIMATE
builds and move this plugin thereTODO: