I’m building an esp32-based remote control using sx127x (LoRa) protocol, sitting in deep_sleep most of the time.
I wake it up with a selection of gpio buttons.
In the on_boot section I want to send the state of the gpio that caused the wakeup, as soon as possible, i.e. when the sx127x is ready to transmit.
How can I do this? If I set the on_boot priority to 600, the log shows that it sets the correct switch off+on+off very quickly. But this doesn’t appear on the receiver side.
If I press it after the boot is completed, it works fine. So I guess the problem is that the sx127x protocol is not ready when I try to send.
Waiting until everything is set up is not good enough.
Help, please?
What kind of remote are you trying to make that requires LoRa?
You know, it’s really a lot easier to figure out what’s going on with someone’s project and be able to help them if they actually post the yaml configuration for Esphome and then we don’t have to guess, make assumptions, or make wild suggestions to you that send you down useless rabbit holes…
No one knows if you’re even using the right sleep function here because there’s 2 here. There’s one for the sx127x and then there’s the esp32 deep sleep and there are different ways to configure how you want it to sleep/respond and etc.
So, its hard to make sense of what you’re doing and even harder to be of any help unless you include the config…
Sure.
Of course I could show some yaml and logs (quite messy at the moment due to debugging stuff).
My thought was just that maybe some of you experienced geniuses in here had some general ideas about what happens during boot, and how to set the right priorities for something to happen at the right time. Or ask me some intelligent questions.
I placed the exact same question on esphome at discord. I got a very good reply after 2 minutes. Problem solved!
- Make sx127x load before most other stuff:
sx127x:
setup_priority: 800
- Remove the wifi component
Some (of several) reasons I have started experimenting with LoRa:
- Controlling stuff in my holiday house from kilometers away. outside the reach of zigbee/zwave.
- Controlling stuff kilometers away from my HA
- Sending sensor data at fixed intervals from the same location
That’s not necessary to to manually call that action because it’s done automatically just like all the other sensors/entities/etc are updated during the boot_up. You only need to specify something in on_boot if its something different like an automation or a list of actions based on a condition for example.
It specifically tells you in the documentation that the Priority is set at 600 by default on every single Esphome configuration you make, which goes back to my point above about it being unnecessary to do.
Sounds like the exact type of mystery that could be solved by anyone here that had a Top Secret clearance and had access to your configuration.
It explains how to do that in the sx127x Esphome documentation.
Do you think that would make me think lesser of you? When you ask detailed questions in any forum and withold all the relevant details and insist people play guessing games then you’re doing it all by yourself and seeing details messy or not is a huge help for everyone.
Well, unfortunately today im not on schedule to wear the magical mind reading hat so, it wont be me today.
FYI. If your going to ask questions and need help in the future then if you do yourself a favor by providing any relevant and detailed information then that allows others to be able to better help you so that you can get answers and move one on instead of keeping this OP alive for almost 2 days… Make sense?