Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Arctic Hare mod by Jussi

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

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175
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 2 Monate 1 Woche her #17338

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 185
  • Dank erhalten: 13
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 2 Monate 1 Woche her #17340

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175
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 2 Monate 1 Woche her #17345

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 185
  • Dank erhalten: 13
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 2 Monate 1 Woche her #17346

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175
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 2 Monate 6 Tage her #17362

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 185
  • Dank erhalten: 13
"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 2 Monate 6 Tage her #17367

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175

"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 2 Monate 6 Tage her #17368

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 185
  • Dank erhalten: 13
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 2 Monate 6 Tage her #17370

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175
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 2 Monate 5 Tage her #17371

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175
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 2 Monate 5 Tage her #17377

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 185
  • Dank erhalten: 13
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 2 Monate 5 Tage her #17378

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175
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.

Arctic Hare mod by Jussi 2 Monate 1 Tag her #17407

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 185
  • Dank erhalten: 13
Phidgets reader cost ~60€ w/o tags and cheap ones 5€ with 3 tags
But what is the difference? When looking pcb's phidget has certainly better antenna.. just thinking if buying cheap one and making better antenna to get more range.

I'm thinking options for short return to station. If using IMU it would help if mower goes specific direction to find wire. e.g. when go home is activated mower goes to north until wire is found and start tracking.
Is anyone tried image/object recognition on raspberry?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von jussip.

Arctic Hare mod by Jussi 2 Monate 1 Tag her #17408

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175
Hi.
For RFID.
The Rfid is really something very good and work like a charm on my mower. (2 Month and Never lost a Tag and less than 5cm on positionning mowing on the wire.)
BUT the Phidgets is not OK for me because it use a 125KHZ frequency and perturbe a lot the perimeter wire detection so i have reduce the tracking speed and the distance between coil and rfid reader is big in my Denna chassis so certainly it can't work on other platform.
I have tested 5 or 6 rfid reader and never find a small one working at more than 6 cm and not on 125Khz frequency.

Today i receive a PN5180 so to be tested.
The PN532 work at only 2 or 3 cm but it's a 13Mhz and work on I2C so it's possible to connect it on PCB1.3.
My actual goal is to build something 3D printing to move the reader freely up and down depending on the ground (to avoid stuck mower on slope or when reverse).

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 1 Tag her #17412

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175
For IMU.
The compass don t work well in the mower so it is difficult to find same north everytime.
It is the main difference between my code version and normal Azurit .into azurit there is a fusion on gyro accel and compass , and i think the compass destroy the accuracy of the final result.
My code use the compass only when the lane change and the rest of the time i read only a fusion of gyro and accel.
Rfid is perfect for fast return.

For Vision you can search on the web for google aiy vision kit (but dificult to find one and the price ?)

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 8 Stunden her #17419

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 185
  • Dank erhalten: 13
What rfid reader is worth to buy? Just read older posts and I'm little confused which is working and which not :D

Compass doesn't need to be so accurate if mower goes always to same side of garden to looking for wire

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von jussip.

Arctic Hare mod by Jussi 1 Monat 4 Wochen her #17425

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 185
  • Dank erhalten: 13
Houston, we have a problem :)
I made error counter page to piardu and when testing it noticed that theres no reset to motorMowSenseCounters. When they triggers once then only power off reset them. It was quite handy to trigger errors, nothing else than touch "mow is on" -button :D but it might be a problem in real use..

Other thing which is not working is powerOff-button, it will power off pcb but not Pi. PowerOff.py works when execute it on console but not via piardu. I cant figure out why?
// check motor current
void Robot::checkCurrent() {
  if (millis() < nextTimeCheckCurrent) return;
  nextTimeCheckCurrent = millis() + 100;
  if (statusCurr == NORMAL_MOWING) {
    if ((motor1MowSense >= 0.8 * motorMowPowerMax) || (motor2MowSense >= 0.8 * motorMowPowerMax)) {  //do not start the spirale if in tracking and motor detect high grass
      spiraleNbTurn = 0;
      halfLaneNb = 0;
      highGrassDetect = true;
      Console.println("Warning  motorMowSense >= 0.8 * motorMowPowerMax ");
      ////  http://forums.parallax.com/discussion/comment/1326585#Comment_1326585
    }
    else {
      if ((spiraleNbTurn >= 8) || (halfLaneNb >= 8)) {
        spiraleNbTurn = 0;
        halfLaneNb = 0;
        highGrassDetect = false; //stop the spirale
      }
    }
  }


  if (motor1MowSense >= motorMowPowerMax)
  {
    motor1MowSenseCounter++;
    Console.print("Warning  motor1MowSense >= motorMowPowerMax and Counter time is ");
    Console.println(motor1MowSenseCounter);
  }
  if (secondMowMotor) {
    if (motor2MowSense >= motorMowPowerMax) {
      motor2MowSenseCounter++;
      Console.print("Warning  motor2MowSense >= motorMowPowerMax and Counter time is ");
      Console.println(motor2MowSenseCounter);
    }
  }
  else {
    errorCounterMax[ERR_MOW_SENSE] = 0;
    motor1MowSenseCounter = 0;
    if (secondMowMotor) motor2MowSenseCounter = 0; // second mow motor
    if ((lastTimeMotorMowStuck != 0) && (millis() >= lastTimeMotorMowStuck + 60000)) { // wait 60 seconds before switching on again
      errorCounter[ERR_MOW_SENSE] = 0;
      if ((stateCurr == STATE_FORWARD_ODO)) { //avoid risq of restart not allowed
        motorMowEnable = true;
        lastTimeMotorMowStuck = 0;
        Console.println("Time to restart the mow motor(s) after the 60 secondes pause");
      }

    }


  }

  //need to check this
  if ((motor1MowSenseCounter >= 30) || (motor2MowSenseCounter >= 30)) { //ignore motorMowPower for 1 seconds
    motorMowEnable = false;
    Console.println("Error: Motor mow current");
    addErrorCounter(ERR_MOW_SENSE);
    lastTimeMotorMowStuck = millis();

  }

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 4 Wochen her #17426

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175
Hi .
For mow motor ,have you tested the last Git code, i have made a lot of change on the mow motor management for start spirale, soft stop ,or auto restart after a delay on high sense detection But i have not check the error counter ?
I Always check the Console to see what's happens on trouble.
Update = nightmare:evil: :evil: :evil:

For the PowerOff i see this behaviour with your service starting method,also the Phidgets library fail .
If you start PiArdu normaly all is OK but i can't tell you why, certainly permission or user issue (Thanks Linux :evil: :evil:).
Test it by stopping PiArdu and restart it using my mower.sh script.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 4 Wochen her #17428

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 185
  • Dank erhalten: 13
Yes, this is with latest. When that number (30) comes full only power off reset it. Maybe it should reset via error counter reset like others? Or better way is tie it to time, if it count over x in y time and if not it reset automatic
//need to check this
  if ((motor1MowSenseCounter >= 30) || (motor2MowSenseCounter >= 30)) { //ignore motorMowPower for 1 seconds
    motorMowEnable = false;
    Console.println("Error: Motor mow current");
    addErrorCounter(ERR_MOW_SENSE);
    lastTimeMotorMowStuck = millis();

  }

I dont have service running right now. It is runned by user pi. Maybe I try run it os.system way like poweroff.py not subsystem.. Does it make any change
pi@LawnMowerCC:~ $ cat bin/piardumower.sh
#!/bin/bash
cd /home/pi/Documents/PiArdumower/
/usr/bin/python3 PiArdu.py
pi@LawnMowerCC:~ $ cat Documents/PiArdumower/PowerOff.py
#!/usr/bin/python3
# Initialisation
import time
import os
time.sleep(5)
os.system("ssh pi@192.168.1.14 'sudo shutdown -h now'")
os.system("sudo shutdown -h now")

Is this like it should be? 'python3 /home.....'? or to end '.. "shell=True","stdout=subprocess.PIPE"])
subprocess.Popen('/home/pi/Documents/PiArdumower/PowerOff.py')

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von jussip.

Arctic Hare mod by Jussi 1 Monat 4 Wochen her #17429

  • Bernard
  • Bernards Avatar
  • Abwesend
  • Benutzer
  • Benutzer
  • Beiträge: 945
  • Dank erhalten: 175
Are you sure you have set the permission on poweroff.py

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Ladezeit der Seite: 2.410 Sekunden