Skip to content

Commit

Permalink
added arduino soft to test historic three phase mode
Browse files Browse the repository at this point in the history
  • Loading branch information
InnoGreenTech committed Dec 3, 2022
1 parent d4226e9 commit 3d9e3c8
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
69 changes: 69 additions & 0 deletions res/Simulateur_linky/Simulateur_linky.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
int i=0;


void setup() {
Serial.begin(1200,SERIAL_7E1);
//Serial.begin(9600);

}

void loop() {


if (i==20){

Serial.print(trame_historique("ADCO", "123456789012"));
delay(13);
Serial.print(trame_historique("OPTARIF", "BASE"));
delay(13);
Serial.print(trame_historique("ISOUSC", "60"));
delay(13);
Serial.print(trame_historique("BASE", "000015000"));
delay(13);
Serial.print(trame_historique("PETC", "TH12"));
delay(13);
Serial.print(trame_historique("IINST1", "012"));
delay(13);
Serial.print(trame_historique("IINST2", "014"));
delay(13);
Serial.print(trame_historique("IINST3", "013"));
delay(13);
Serial.print(trame_historique("IMAX1", "060"));
delay(13);
Serial.print(trame_historique("IMAX2", "060"));
delay(13);
Serial.print(trame_historique("IMAX3", "060"));
delay(13);
Serial.print(trame_historique("PMAX", "09000"));
delay(13);
Serial.print(trame_historique("PAPP", "00700"));
delay(13);
Serial.print(trame_historique("HHPHC", "A"));
delay(13);
Serial.print(trame_historique("MOTDETAE", "000000"));
delay(13);
Serial.print(trame_historique("PPOT", "00"));
i=0;
}

delay(33);
Serial.print(trame_historique("ADIR1", "005"));
delay(13);
Serial.print(trame_historique("ADIR2", "003"));
delay(13);
Serial.print(trame_historique("ADIR3", "004"));
delay(13);
Serial.print(trame_historique("ADCO", "123456789012"));
delay(13);
Serial.print(trame_historique("IINST1", "034"));
delay(13);
Serial.print(trame_historique("IINST2", "028"));
delay(13);
Serial.print(trame_historique("IINST3", "053"));




delay(33);

}
27 changes: 27 additions & 0 deletions res/Simulateur_linky/TRAME_HISTORIQUE.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
String trame_historique(char *etiquette, char *donnee ){

String trame="";
String information="";


information = etiquette;
information += char(0x20);
information += donnee;


int lengh = information.length();

char checksum=0;
for (int i=0; i<lengh; i++)
{
checksum = checksum + char(information[i]);
}
checksum = (checksum & 0x3F) + 0x20;
trame=char(0x0A);
trame+=information;
trame+=char(0x20);
trame+=char(checksum);
trame+=char(0x0D);

return trame;
}

0 comments on commit 3d9e3c8

Please sign in to comment.