Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Arctic Hare mod by Jussi

Arctic Hare mod by Jussi 1 Woche 2 Tage her #17331

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 831
  • Dank erhalten: 165
Hi.I try to upload the code on GitHub so it's possible to create your branch and exchange code.
;)
For The secondMowMotor = True it's perfect into mower.cpp near line 93.
For the WS it's into config.py add a true false on Windows and linux setting so it's possible to run the prog on the PC
.
I have open my mower today and see that near the GPS connector it's free Wlan one that use Serial1 so maybe you can test the GPS on this connector with JP6 and JP11 on 3.3V, into the code replace all Serial3 by Serial1 into GPS.cpp.It's work for me with M8N module, but work also in normal GPS connector.


In the code remember that if you want to save a var in the eeprom you need to add it at the end of the list line 471, for example you can add
eereadwrite(readflag, addr, secondMowMotor).
Never insert or change the type of a var in this list or you need a factory setting each time and lost your setting.

On pi side it's the same with the robot.py ,If something is changed here the read and save setting from file is corrupted.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Woche 1 Tag her #17338

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 118
  • Dank erhalten: 10
I did accidentally something but can't find what. When I click setting on main page this comes up:
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1562, in __call__
    return self.func(*args)
  File "/home/pi/Documents/PiArdumower/PiArdu96.py", line 1679, in ButtonSetting_click
    Setting.tkraise()
NameError: name 'Setting' is not defined

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Woche 1 Tag her #17340

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 831
  • Dank erhalten: 165
It was TabSetting
def ButtonPlot_click():
    TabPlot.tkraise()

def ButtonSetting_click():
    TabSetting.tkraise()
   
def ButtonBackToMain_click():
    MainPage.tkraise()

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Woche 9 Stunden her #17345

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 118
  • Dank erhalten: 10
Yes it was that, missing 'Tab'. No idea how that happen :D

Robot.cpp 'eereadwrite' lines and robot.py self.* lines, does these need to be exactly same order?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von jussip.

Arctic Hare mod by Jussi 1 Woche 8 Stunden her #17346

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 831
  • Dank erhalten: 165
No order Inside robot.py.
I have create it only to save all the setting easily So all what you add here is normaly saved when click on "Save setting to file" using pickle.dump but not sure it work every time ??:blush:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 4 Tage 11 Stunden her #17362

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 118
  • Dank erhalten: 10
"RMRET" pages, can I just add one page or do I have to do something also on talker.py?

pfod.cpp e.g. rain menu there's "print(F("|m00~Rain Use "));" and "serialPort->print(F("|m01~Counter "));" What are those "m00" and "m01" (same syntax others too but I dont know what it is)

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 4 Tage 7 Stunden her #17367

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 831
  • Dank erhalten: 165

"RMRET" pages, can I just add one page or do I have to do something also on talker.py?

If you don't change the structure of the sentence you change nothing on talker.py.
RMRET is use for refresh all the var in one shot .
into the setting
To add a page :
Into rpiremote
//page 13
    lineToSend = "RMRET,";
    lineToSend = lineToSend + "All";
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + "13";
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + robot->maxDurationDmpAutocalib;
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + robot->mowPatternDurationMax;
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + robot->DistPeriOutStop;
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + robot->DHT22Use; //4
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + robot->RaspberryPIUse;
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + "0";
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + "0";
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + "0";
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + "0";
    lineToSend = lineToSend + ",";
    lineToSend = lineToSend + "0";
    lineToSend = lineToSend + ",";
    writePi(lineToSend);
Create the page 14 (copy and past page 13 and change 13 by 14 ) for example but all the "0" on page 13 are free and you can put variable here
Don't forget the writePi at the end.
Into PyArdu
if message.pageNr =='13':    
                        myRobot.maxDurationDmpAutocalib=message.val1
                        myRobot.mowPatternDurationMax=message.val2
                        myRobot.DistPeriOutStop=message.val3
                        myRobot.DHT22Use=message.val4
                        myRobot.RaspberryPIUse=message.val5
                        refreshAllSettingPage() 
 

Here the data are receipt with the .val x is from 1 to 10


If you want the data are bind to object you need to use a tkinter variable
see tk_batVoltage=tk.DoubleVar() for example
and the value of the bat voltage is automaticly update when the var is change.into all the page of the project.


For Pfod i have create a new thread :

www.ardumower.de/index.php/de/forum/soft...od-how-to-prog#17366

The last code is on Git
github.com/Boilevin/AzuritBer

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von Bernard.

Arctic Hare mod by Jussi 4 Tage 7 Stunden her #17368

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 118
  • Dank erhalten: 10
Thanks, I allready used those four free slots on page 13.

Does piardu ask RMSTA message all the time or is it due who send it without asking. I cant find where in code this sending/asking is done.
I'm trying to add RMBAT message same way when state is charging. It can be done if adding those variables to RMSTA but theres RMBAT allready, it just doesnt come without asking

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 4 Tage 4 Stunden her #17370

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 831
  • Dank erhalten: 165
If you want to follow the charging you can simply use the plot menu.
A file is create into log folder and KST read it at real time to show you the data.
When done if you stop the plot for bat the file can be read later into excel



STA is Always send without any request It's into void RpiRemote::run() {
void RpiRemote::run() {
  readPi();
  if (millis() >= nextTimeRaspberryPISendStat) {
    nextTimeRaspberryPISendStat = millis() + 500;  //better to put 200
    RaspberryPISendStat();
  }
  if ((millis() >= nextTimeRaspberryPISendInfo) && (maxRepetInfoToPi > 0)) {
    maxRepetInfoToPi = maxRepetInfoToPi - 1;
    nextTimeRaspberryPISendInfo = millis() + delayInfoToPi;
    RaspberryPISendInfo();
  }
  if ((millis() >= nextTimeRaspberryPISendMot) && (maxRepetMotToPi > 0)) {
    maxRepetMotToPi = maxRepetMotToPi - 1;
    nextTimeRaspberryPISendMot = millis() + delayMotToPi;
    RaspberryPISendMot();
  }
  if ((millis() >= nextTimeRaspberryPISendMow) && (maxRepetMowToPi > 0)) {
    maxRepetMowToPi = maxRepetMowToPi - 1;
    nextTimeRaspberryPISendMow = millis() + delayMowToPi;
    RaspberryPISendMow();
  }
  if ((millis() >= nextTimeRaspberryPISendPeri) && (maxRepetPeriToPi > 0)) {
    maxRepetPeriToPi = maxRepetPeriToPi - 1;
    nextTimeRaspberryPISendPeri = millis() + delayPeriToPi;
    RaspberryPISendPeri();
  }
  if ((millis() >= nextTimeRaspberryPISendBat) && (maxRepetBatToPi > 0)) {
    maxRepetBatToPi = maxRepetBatToPi - 1;
    nextTimeRaspberryPISendBat = millis() + delayBatToPi;
    RaspberryPISendBat();
  }
  if ((millis() >= nextTimeRaspberryPISendByLane) && (maxRepetByLaneToPi > 0)) {
    maxRepetByLaneToPi = maxRepetByLaneToPi - 1;
    nextTimeRaspberryPISendByLane = millis() + delayByLaneToPi;
    RaspberryPISendByLane();
  }
}

RMSTA message all the time

rpiremote.run is call in the robot main loop and the RMSTA is Always send each 500ms

All the other are only send on Pi request

On the Pi side the request is send by the 'send _req_message':
send_req_message('BAT',''350'','1','2500','0','0','0',)
It's mean the pi want to receive the BAT sentence each 350 ms and stop after 2500 sentences send.
You can find all this kind of request in the plot parts of the code with MOW,MOT ,PER etc with 10000 sentences send until stop.
Avoid to read data each ms for example ;)
To stop send for example:
send_req_message('BAT',''350'','1','','0','0','0',)


Here a txt file with a brief description of the Nmea sentence i use in talker.py
Dieser Anhang ist für Gäste verborgen.
Bitte anmelden oder registrieren um den Anhang zu sehen

Dieser Beitrag enthält einen Anhang.
Bitte anmelden (oder registrieren) um ihn zu sehen.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 4 Tage 3 Stunden her #17371

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 831
  • Dank erhalten: 165
Not tested but see last commit into GitHub in PyArdu98.py search for //bber17 ;)
It's auto record when charge.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von Bernard.

Arctic Hare mod by Jussi 3 Tage 8 Stunden her #17377

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 118
  • Dank erhalten: 10
Cant test right now because battery is full but it should work

Maybe this work also
case STATE_STATION_CHARGING:
      // waiting until charging completed
      if (batMonitor) {
        if ((chgCurrent < batFullCurrent) && (millis() - stateStartTime > 2000)) setNextState(STATE_STATION, 0);
        else if (millis() - stateStartTime > chargingTimeout) {
          Console.println("End of charging duration check the batfullCurrent to try to stop before");
          setNextState(STATE_STATION, 0);
          /*
            addErrorCounter(ERR_BATTERY);
            setNextState(STATE_ERROR, 0);
          */

        }
      }
      // SendBat to Pi when charging
      if (millis() >= nextTimeChgRasPISendBat) {
        nextTimeChgRasPISendBat = millis() + 6000; // delay ms
        MyRpi.RaspberryPISendBat();
      }
      //motorControl();
      break;

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 3 Tage 7 Stunden her #17378

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 831
  • Dank erhalten: 165
Yes good idea it is more simple ;)
But need to add something at the end to rename the txt file

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Ladezeit der Seite: 0.463 Sekunden