Hello,
The project is complete and working well.
I attach photos to feed the album of the site.
Sincerely.
Hello,
The project is complete and working well.
I attach photos to feed the album of the site.
Sincerely.
Hello,
@mfalkvidd thank you, that was right, so I changed the values and now no more ghost CHILDID. Thank you very much!
#define MY_GATEWAY_SERIAL
#define MY_TRANSPORT_WAIT_READY_MS 5000
#define MY_GATEWAY_SERIAL_BAUD_RATE 115200
#define MY_DEBUG
#define CHILD_ID_ARMED 0
#define CHILD_ID_PORTAIL2 1
#define CHILD_ID_PORTILLON2 2
#define CHILD_ID_Texte1 3
#define CHILD_ID_Texte2 4
#define Code_ON 0
#define Code_OFF 1
Have a nice day
Hello,
@mfalkvidd thank you, that was right, so I changed the values and now no more ghost CHILDID. Thank you very much!
#define MY_GATEWAY_SERIAL
#define MY_TRANSPORT_WAIT_READY_MS 5000
#define MY_GATEWAY_SERIAL_BAUD_RATE 115200
#define MY_DEBUG
#define CHILD_ID_ARMED 0
#define CHILD_ID_PORTAIL2 1
#define CHILD_ID_PORTILLON2 2
#define CHILD_ID_Texte1 3
#define CHILD_ID_Texte2 4
#define Code_ON 0
#define Code_OFF 1
Have a nice day
Hello,
To know if we look at the date and time in the column "Last seen" in chilid "0" at 6:30 the alarm was stopped, and that's normal, on the other hand the childid phantoms 25, 249 and 255 were requested at the same time, why? So I'll show you the part of the script that you might be interested in:
#define MY_GATEWAY_SERIAL
#define MY_TRANSPORT_WAIT_READY_MS 5000 //set how long to wait for transport ready in milliseconds
#define MY_GATEWAY_SERIAL_BAUD_RATE 115200
#define MY_DEBUG
#define CHILD_ID_ARMED 0
#define IDX_PORTAIL2 635
#define IDX_PORTILLON2 1129
#define IDX_Texte1 1143
#define IDX_Texte2 1144
#define Code_ON 0
#define Code_OFF 1
#include <Tiny4kOLED.h>
#include<EEPROM.h>
#include <MySensors.h>
#include <Keypad.h>
int bu1=0;
int i=0;
int ii=0;
int Arme = 0;
int value0 = 0;
int oldValue0 = 0;
char pass1[4];
char customKey;
char customKey1;
int watchdog1 = 30000; // Fréquence des lectures des données Domoticz
unsigned long previousMillis2 = 0;
const unsigned long timeout2 = 30000; // Timeout de 30 secondes
unsigned long previousMillis1 = 0;
unsigned long currentMillis1 = millis();
unsigned long currentMillis2 = millis();
int returnWait = 1500;
int returnWait1 = 500;
int returnWait2 = 100;
int returnWait3 = 10;
int returnWait4 = 3000;
int returnWait5 = 800;
const int PinBuzzer = 10;
// *********** Pour MySensors **************************************************************
char newMessage[40]; // taille message reçu
char newMessage1[40]; // taille message reçu
bool state = 0;
MyMessage msg0(CHILD_ID_ARMED, V_STATUS);
MyMessage msg1(IDX_PORTAIL2, V_STATUS);
MyMessage msg2(IDX_PORTILLON2, V_STATUS);
MyMessage Texte1(IDX_Texte1, V_TEXT);
MyMessage Texte2(IDX_Texte2, V_TEXT);
void presentation(){
// Send the sketch version information to the gateway and Controller
sendSketchInfo("ClavierOled", "1.0");
// Register all sensors to gateway (they will be created as child devices)
present(CHILD_ID_ARMED, S_BINARY, "Armed");
present(IDX_PORTAIL2, S_BINARY, "Portail2");
present(IDX_PORTILLON2, S_BINARY, "Portillon2");
present(IDX_Texte1, S_INFO, "Texte1");
present(IDX_Texte2, S_INFO, "Texte2");
}
void setup() {
//Serial.begin(115200);
pinMode(PinBuzzer, OUTPUT);
digitalWrite(PinBuzzer, LOW);
oled.begin(128, 64, sizeof(tiny4koled_init_128x64br), tiny4koled_init_128x64br);
oled.setFontX2(FONT6X8P);
oled.on();
etablirInformations(); // initialise la structure avec soit le mot de passe par défaut, soit celui qui était déjà en EEPROM si dispo
presentation();
} // Fin Setup
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void loop() {
currentMillis1 = millis();
customKey = customKeypad.getKey();
if (customKey) { // si une touche du clavier et que l'alarme est active
if (Arme != 0) {
Dysarmed();
}
switch (customKey) {
case '*':
MENU();
break;
case '#':
send(msg1.set(1)); // Envoi la commande Portail
oled.clear();
oled.setCursor(20, 3);
oled.setFontX2(FONT6X8P);
oled.println("PORTAIL");
wait(returnWait + 2000);
break;
case 'C':
send(msg2.set(1)); // Envoi la commande Portillon
oled.clear();
oled.setCursor(18, 3);
oled.setFontX2(FONT6X8P);
oled.println("Portillon");
wait(returnWait + 2000);
break;
default:
// Rien si timeout atteint et aucune touche pressée
break;
}
}
customKey = NO_KEY;
// Gestion de l'écran de veille
if ((currentMillis1 - previousMillis1) > watchdog1) {
oled.clear();
oled.setCursor(i, ii);
oled.setFont(FONT6X8);
oled.println(Arme == 1 ? "Alarme ON" : "Alarme Off");
oled.setFontX2(FONT6X8P);
previousMillis1 = currentMillis1;
i = (i > 68) ? 0 : i + 1;
ii = (ii > 6) ? 0 : ii + 1;
watchdog1 = 10000; // Réinitialisation du watchdog
}
}
void receive(const MyMessage &message) {
if (message.getType() == V_STATUS) { // check to see if incoming message is for a switch
switch (message.sensor) { // message.getCommand will give us the command type of the incomming message
case 0: //message is a set command from controller to update relay state
state = message.getBool(); // get the new state
digitalWrite(0, state ? Code_ON : Code_OFF); // switch relay to new state
Arme = state;
if (Arme == 1) {
oled.setFont(FONT6X8);
oled.println("Alarme ON");
oled.setFontX2(FONT6X8P);
}
if (Arme == 0) {
oled.setFont(FONT6X8);
oled.println();
oled.println("Alarme Off");
oled.setFontX2(FONT6X8P);
}
}
}
if (message.getType()==V_TEXT) {
oled.setFont(FONT6X8);
if (message.sensor == IDX_Texte1){
strcpy(newMessage, message.getString());
oled.clear();
oled.setCursor(0,2);
for (i = 0; i < sizeof(newMessage)-1; i++) {
oled.write(newMessage[i]);
}
}
if (message.sensor == IDX_Texte2){
strcpy(newMessage1, message.getString());
oled.setCursor(0,3);
for (i = 0; i < sizeof(newMessage1)-1; i++) {
oled.write(newMessage1[i]);
wait (returnWait3);
}
}
for (int bu=0; bu <= 1; bu++){
digitalWrite(PinBuzzer, HIGH);
wait(returnWait4);
digitalWrite(PinBuzzer, LOW);
wait(returnWait1);
}
wait (returnWait4);
}
}
If you see anything abnormal, please let me know.
Have a nice day.
Hello,
First of all thank you for your help. Yesterday I installed everything again after deleting everything in Domoticz. The result of ghost child. It's not blocking for domoticz but still I would have liked to understand. Some photos:
The parasites have returned 25, 249 and 255
Cordially.
Hello, Thank you for your OSD answer, I tried to remove them from restarting but they come back! I don't have a declared radio node, the nano program only concerns the three childs 0, 1 and 2 all the others 24, 41, 249, 253 and 255 are parasites.
I noticed that the 249 and 255 were time-stamped and that corresponds to the activation of my alarm. Does this mean that my script is badly constructed?
To read you.
Hello,
It's a Nano that is connected to my rasberry pi3 by usb key, declared in domotcz 2024.7, I see somes Child Ghost appearing, below only child 0, 1 and 2 are declared, so where do the others come from.
An idea? thanks in advance.
Hello Jeelet,
Thank you for the encouragements.
Your advice to save (protect) the Oled screen is also welcome, thank you.
My code expects it, the text is mini and moves every 3 seconds. Press a key and the menu returns.
Cordially.
Hello,
The project is complete and working well.
I attach photos to feed the album of the site.
Sincerely.
Hello,
Thanks to @JeeLee for answering me.
This is the only and first MySensors network that I am installing. There is no RADIO, only the Gateway_Serial USB link.
This morning I changed the Adafruit_SSD1306 & GFX library of the Oled to that of Tiny4kOLED and for the moment everything seems to be working correctly.
Here is my setup:
And the beginning of the code:
If I run into any problems again, I'll come back here.
Cordially.
Hello,
First of all, I apologize for my language, which comes from the translation.
I discover MySensors, and I see that great work has been done to develop this system, congratulations!
I use Domoticz with a PI3B, and I wanted to install a 4x4 keyboard with a small Oled screen. A way to be able to stop the alarm if the Wifi or internet is no longer present, yes it happens...
So I discover MySensors, I say to myself why try?
So I get a Nano+Keypad+Oled I2C.
The Nano is the Gataway and connected via USB to >RPI 3B.
During my PC tests connected to the Nano, my program works very well.
On the other hand, when I plug it into Domoticz, the Nano bugs quite quickly and Domoticz drops it.
My question: is it possible to make the whole thing work??? There seems to be a conflict with the serial port and I2C.
What do you think?
Thank you in advance for your replies.
A+