RF Receiver in the background

Hi,

I’m trying to create light controller for my home.
I want to manage it over RF433 remotes and Blynk.
At this moment I’m using Arduino Nano as RF receiver.
Also Arduino is connected to relays and switching them ON and OFF.
ESP8266 is connected to Arduino over UART connection.
Blynk is running on ESP8266. Blynk works with relays on Arduino via serial connection (sending command like ON1 or OFF1).
I want to remove Arduino from this project and leave only ESP8266, but I faced with one problem.
In the setup() function ESP8266 is connecting to the network. It will not run loop() function until connection to the network is established. In such case I can’t receive and process signals from RF433 receiver.
Is it possible to start something like separated thread for RF listener before connecting to Wi-Fi network?
Thank you.

Can’t you use the very eleborate connection management options for Blynk? There is some info here: http://docs.blynk.cc/#blynk-firmware-connection-management

You can probably build something to suit your needs.

I think it is related to Blynk server connection. but I need to run in earlier - before connecting to Wi-Fi network.
I see SimpleTimer in some examples. Is it possible to use it like loop() analog with 10ms period, for example?

Can you post your code? It may clarify things and allow us to help better.

How are you going to send RF signals if you don’t have a connection from the app to the hardware i.e. a network of some kind?
As @Lichtsignaal points out Connection Management will let your loop run without Blynk but then you are back to “Nano” mode.

no, it’s not sending RF signals.
device is receiving signals from RF remotes and switching connected relays ON or OFF.
so, I want to have two modes to switch relays:

  1. From RF remotes
  2. From Blynk

As about Connection Manager, it is the second step of connection.
First step is Wi-Fi network. And if Wi-Fi network is down, ESP8266 will stuck in setup waiting for Wi-Fi connection.

I’ll be able to provide sources a bit later, they are on another laptop.

Connection Management will be fine then. Similarly with the WiFI connection just use millis() and if it is not connected within 3 seconds (normally connects within 1 second) continue.

Is it possible to use ESPTouch (or SmartConfig) in such case?

Yes, and for quite complex systems you should look at WiFi Manager by @tzapulica from GitHub - tzapu/WiFiManager: ESP8266 WiFi Connection manager with web captive portal

1 Like

@Costas, thank you for your hint, will look into WiFi Manager