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

Loss connection on restart #12

Closed
santinet28 opened this issue Jun 17, 2021 · 3 comments
Closed

Loss connection on restart #12

santinet28 opened this issue Jun 17, 2021 · 3 comments
Assignees

Comments

@santinet28
Copy link

Hello,

I have managed to connect correctly with the motor, but when cutting the power and restarting it loses connection with the motor.
I have looked at the debug and the rollingcode works fine, but still the engine is not responding.

I have also tried to load the CC1101 example and once synchronized then load the remotySomfy example. In this way the rollingcode also works well and the motor responds, the error turns off and on again.

Thank you

@santinet28
Copy link
Author

Captura de pantalla (161)

@Legion2
Copy link
Owner

Legion2 commented Jun 17, 2021

Hi,
so it works with the CC1101 example also after restarts, but your own code does not work after restarts? Can you provide the code which causes the problem?

@Legion2 Legion2 self-assigned this Jun 17, 2021
@santinet28
Copy link
Author

gracias por responder

con el ejemplo cc1101 funciona perfecto después del reinicio y de apagar y encender.

El skecht que no funciona después de apagar és el del ejemplo remoteSomfy

`
#include <EEPROM.h>
#include <EEPROMRollingCodeStorage.h>
#include <SomfyRemote.h>

#define EMITTER_GPIO 4 // I've changed it
#define EEPROM_ADDRESS 1 // and this
#define REMOTE 0x5184c8

EEPROMRollingCodeStorage rollingCodeStorage(EEPROM_ADDRESS);
SomfyRemote somfyRemote(EMITTER_GPIO, REMOTE, &rollingCodeStorage);

void setup() {
Serial.begin(115200);

somfyRemote.setup();

#if defined(ESP32)
if (!EEPROM.begin(4)) {
Serial.println("failed to initialise EEPROM");
delay(1000);
}
#elif defined(ESP8266)
EEPROM.begin(4);
#endif
}

void loop() {
if (Serial.available() > 0) {
const String string = Serial.readStringUntil('\n');
const Command command = getSomfyCommand(string);
somfyRemote.sendCommand(command);
#ifdef DEBUG
Serial.println("finished sending");
#endif
}
}

`

Now I have copied the setup lines of the example cc1101 and my skecht works correctly.
ELECHOUSE_cc1101.Init(); ELECHOUSE_cc1101.setMHZ(CC1101_FREQUENCY); ELECHOUSE_cc1101.SetTx();

The problem is resolved

Thanks

@Legion2 Legion2 closed this as completed Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants