Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Arctic Hare mod by Jussi

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17773

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 236
  • Dank erhalten: 21

Bernard schrieb: I have a similar issue in the past. with the service mode so i use a normal start in autostart (see file setup raspberry.txt in txt file on github)
BUT there is also a bug in old version
Test the last version PyArdu205 from the rfid branch ,simply open it and save it as PiArdu.py
or if you have your own one remove the line: checkSerial() after the try: into the def send_serial_message(message1): it was a bug that overload the cpu usage by create an infinte loop with tkinter.
And tell me if it solve the issue.

Now few days testing and it works much better but hang after 8-12 hours or so. Any ideas how to debug, all logs are empty in hang time.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17774

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1057
  • Dank erhalten: 203
If possible Try with the code into RFID branch with Pyardu207.py and ardumower according.
Be carrefull with the service starting mode and autorestart,
Check that the CPU usage of the Pi Don't increase non stop (if the service start multiple version of the soft)
In my case it's Actualy less than 4% with vns viewer (and after 24 Hours working)

Check the serial speed (be carreful the config.py is not read for the port and speed) try to use 115200 bps on the 2 side.
Something Strange again a bug it's 250000 bps on Arduino and 115200 on PI ??????????
But All work without Hangs for more than 5 days ?

You can also add a print at each due serialreceived ,so maybe a log can be read after rebooting
if DueConnectedOnPi :  
        mymower.dueSerialReceived=Due_Serial.readline()
        if str(mymower.dueSerialReceived)!="b''":  
            print(mymower.dueSerialReceived)

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17775

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 236
  • Dank erhalten: 21
Systemctl won't restart this even it hangs. Don't know why.. Maybe there should be some kind error/exit code or so
bps is 250000 both side now, I'll try 115200

Updated rfid branch both sides, now pfod connection hang up after few minutes if mower do something else than sit in station. In video leaving station with timer to start at 35m end up other side out of perimeter and error but don't know what error that was because all connections was lost :unsure:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von jussip.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17776

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1057
  • Dank erhalten: 203
Is it ESP32 or HC05 for BT ?
Fast remark on the video:
The reverse is not straigh (Can you check in reverse test motor 5 turn if the 2 motors stop at the same time and adjust the PWM right reverse offset)
The arc circle is not enough (Into setting Perimeter Circle Arc Distance I forget the t) Try to put 200.
Is it possible to see the PI console ?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17777

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 236
  • Dank erhalten: 21
Mower sit in station slight angle to wall (because wire is kinda arc there and have to re-install it) and ground is much higher on wall side (left wheel) than right wheel side. Flat surface it drive straight forward and reverse.
BT is HC05, haven't got esp32 yet. Pi console was about same than above post (lost it because had to reboot mower). I'll try tomorrow add arc, its 100 cm now..
Edit: Now I get it :ohmy: it's distance not radius/diameter

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von jussip.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17778

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1057
  • Dank erhalten: 203
Here also ESP32 BT hang when lost connection if the mower is very far my phone, so maybe i need to check my last change.Because i never see that before.
After how many time it hang in your test 30 second, or 10 minutes ?

Maybe The piArdu can also hang when use the curl option if the WIFI is not ready , Possible that the subprocess stop all.
In the past i use the nc method,I need to verify

But if you don't use area2 it's not your Pi hang issue

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17780

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 236
  • Dank erhalten: 21
BT hang 6-7 times, not more than 1-2 minutes every time.
Piardu GUI stay kinda working state -> buttons work, saving rfid file etc. is it main loop what stop? no communication with due, network, console..

Maybe we can use urllib/urlib2 to check network or internet connection before nc/curl. Or use urllib instead of nc/curl? Maybe it's more failsafe than external process?
import urllib2

def network_check():
    try:
        urllib2.urlopen('http://192.168.1.1', timeout=1)
        return True
    except urllib2.URLError as err: 
        return False

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17781

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1057
  • Dank erhalten: 203
For BT.
Tested more than 10 minutes with my paranello platform(with HC05) and no issue after 10 min with arduremote.
For Pi
urlib2 why not to be tested
I have restart my Denna platform yesterday and no issue in the PI side after 24 Hours with timer and 2 mowing cycle.

What is the PI CPU Usage after 2 hours working ?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von Bernard.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17782

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 236
  • Dank erhalten: 21
Sorry that BT/pfodd issue. That was my bad totally, there was so many errors and missing lines etc. in pfod.cpp that I don't understand how I got it compiled&uploaded yesterday.

CPU usage is 3-5% or so now after commenting out that checkserial.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17784

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 236
  • Dank erhalten: 21
urllib tests going on, it's urllib.request and urllib.error in python3.
How I pass ip address as argument? Always got error "TypeError: checkNetwork() missing 1 required positional argument: 'ip_address' " solved :)
def checkNetwork(ip_address):
    print(ip_address)
    try:
        urllib.request.urlopen('http://' + ip_address, timeout=1)
        return True
    except urllib.error.URLError as err: 
        return False
checkNetwork("192.168.1.1")
def readWEBSITE():
    # check network
    checkvar = checkNetwork("192.168.1.11")
    if checkvar:
        # open a connection to a URL using urllib
        webUrl  = urllib.request.urlopen('http://192.168.1.11/meteograph.cgi?text=last60m_rain0_total_mm')
        # read the data from the URL and print it
        data = webUrl.read()
        print(data)

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von jussip.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17786

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 236
  • Dank erhalten: 21
Finally I found what was wrong. In robot.py where are self.stateNames I had space after "ERR "
Then I have statements in message 'STA' decoding part 'if stateName!='ERR' and ...=='ERR' these caused infinite loop because flags didn't change etc.
This was reason why bt/pfodd stopped and mower turn zombie
Folgende Benutzer bedankten sich: Bernard

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17787

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1057
  • Dank erhalten: 203

In robot.py where are self.stateNames I had space after "ERR "

I change this on Git

I have statements in message 'STA' decoding part 'if

Not find in my code and certainly it explain why i have not your hang issue.

If i understand corretly you use your own version so certainly not easy to upgrade with my last change ? ?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17789

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 236
  • Dank erhalten: 21
Updating was time consuming project :D Notepad++ and compare plugin was my friends
PiArdu was easier, my error page handling didn't like that extra space. It was updating variables every time when STA message came in.
Today I plugged raspberry usb off from due and everything started working again.
Now I'm looking for why mowing start mow motors off (force off is not active)

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17790

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1057
  • Dank erhalten: 203
I also see this mowing start with blade off and i think it append if something wrong while perimeter tracking , maybe motor power idle trigger ?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17792

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 236
  • Dank erhalten: 21
Is it possible to get only e.g. 100 latest lines?
txtConsoleRecu.get('1.0','end')

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17793

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1057
  • Dank erhalten: 203
Into chek_serial you have this :
if useDebugConsole:
        txtRecu.delete('5000.0',tk.END) #keep only  lines
        txtSend.delete('5000.0',tk.END) #keep only  lines
    txtConsoleRecu.delete('2500.0',tk.END) #keep only  lines

Actualy the Piardu get 2500 line but you can reduce to 100 (I test this in the past and no particular change so i prefer to keep a large amount of data)


For the ERR
I don't understand exactly what you want to Do.
Actualy into Azurit each time the err_counter are call a Console.print is add to know what is the error.
And into PyArdu the Console is saved inside log directory, So each time the mower is in Error you can easily find WHY the mower stop.


To Check this:
First you need to change the Power OFF idle into battery setting (For example 2 minutes to avoid wait 30 minutes).
Start the mower and lift it so normaly the state change to Error and all is stop.
Remember that in Error or OFF or Station (No charging and without Timer ) the PCB1.3 auto shutdown after this battery idle.
Don't touch the mower for the last 2 minutes and normaly the automatic power Off shuntdown the PCB1.3 correctly and PyArdu save the Console.


After restart all (Possible 1 hour later or 2 days), check the file into log directory and you can see the tilt error and day and time when occur.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17795

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 236
  • Dank erhalten: 21
I want to print(txtConsoleRecu.get('1.0','end') to error email but only e.g. 100 lines or so. Is that possible without changing that delete setting?
Also tried add setting for perimeter arc radius control (left motor divider). PiArdu ends up error
File "/home/pi/Documents/PiArdumower/PiArdu.py", line 1784, in refreshPerimeterSettingPage
    sliderMotorLeftSpeedDivider.set(myRobot.motorLeftSpeedDivider)
  File "/usr/lib/python3.5/tkinter/__init__.py", line 2878, in set
    self.tk.call(self._w, 'set', value)
_tkinter.TclError: floating point value is Not a Number

Here is error code what I added and changed yesterday. It's working now like expected.. Easier to show code than try to explain :)
if message.sentence_type =='ERR': # Errors message
                mymower.millis=message.millis
                mymower.ErrCharger=message.errCharger
                mymower.ErrBattery=message.errBattery
                mymower.ErrMotorLeft=message.errMotorLeft
                mymower.ErrMotorRight=message.errMotorRight
                mymower.ErrMotorMow=message.errMotorMow
                mymower.ErrMowSense=message.errMowSense
                mymower.ErrOdoLeft=message.errOdoLeft
                mymower.ErrOdoRight=message.errOdoRight
                mymower.ErrPeriTout=message.errPeriTout
                mymower.ErrTracking=message.errTracking
                mymower.ErrImuComm=message.errImuComm
                mymower.ErrImuCalib=message.errImuCalib
                mymower.ErrImuTilt=message.errImuTilt
                mymower.ErrRtcComm=message.errRtcComm
                mymower.ErrRtcData=message.errRtcData
                mymower.ErrGpsComm=message.errGpsComm
                mymower.ErrGpsData=message.errGpsData
                mymower.ErrStuck=message.errStuck
                mymower.ErrEepromData=message.errEepromData
                refreshErrorPage()
                mymower.errorResetDone=False
                
                if ((myRobot.stateNames[mymower.state]=='ERR') & (mymower.errorEmailSent==False)):
                    checkMailSent = sendEmail()
                    if checkMailSent:
                        mymower.errorEmailSent=True
                    else:
                        mymower.errorEmailSent=False
                    

            if message.sentence_type =='STA': #permanent message for state info
                
                mymower.millis=message.millis
                mymower.state=int(message.state)
                mymower.odox=message.odox
                mymower.odoy=message.odoy
                mymower.prevYaw=message.prevYaw
                mymower.batVoltage=message.batVoltage
                mymower.yaw=message.yaw
                mymower.pitch=message.pitch
                mymower.roll=message.roll
                mymower.Dht22Temp=message.Dht22Temp
                mymower.loopsPerSecond=message.loopsPerSecond
                #//bber17
                if autoRecordBatCharge:
                    if ((mymower.autoRecordBatChargeOn==False) & (myRobot.stateNames[mymower.state]=='CHARG')): #the mower is now on charge
                        consoleInsertText("Start to record the Battery charging" + '\n')
                        SldMainBatRefresh.set(10) #data flow 10 times each minute
                        mymower.autoRecordBatChargeOn=True
                        BtnBatPlotStartRec_click()
                    if ((mymower.autoRecordBatChargeOn==True) & (myRobot.stateNames[mymower.state]=='STAT')): #the mower is now on charge
                        consoleInsertText("Stop to record the Battery charging" + '\n')
                        BtnBatPlotStopRec_click()
                        mymower.autoRecordBatChargeOn=False

                if ((myRobot.stateNames[mymower.state]!='CHARG') & (mymower.resetChargeReadings==True)):
                    tk_chgVoltage.set(0)
                    tk_chgSense.set(0)
                    mymower.resetChargeReadings=False
                
                if ((myRobot.stateNames[mymower.state]!='ERR') & (mymower.errorResetDone==False)):
                    resetErrors()
                    mymower.errorEmailSent=False
                    mymower.errorResetDone=True
emailer code
def sendEmail():
    testnetEmail = checkNetwork("https://google.fi")
    if testnetEmail:
        print("Network check OK. Sending error email...")
        consoleInsertText("Network check OK. Sending error email..." + '\n')
        email = 'zzzz@gmail.com'
        password = 'xxxxx'
        send_to_email = 'yyyyy@gmail.com'
        
        msg = MIMEMultipart()
        msg['From'] = 'ArduMower ERROR STATE'
        msg['To'] = send_to_email
        msg['Subject'] = 'Errors and console output'

        msg.attach(MIMEText("Error counters:\n" + "Charger: {}\nBattery: {}\nMotor Left: {}\nMotor Right: {}\nMotor Mow: {}\nMow Sense: {}\nOdometry Left: {}\nOdometry Right: {}\nPerimeter Timeout: {}\nPerimeter Tracking: {}\nIMU Communication: {}\nIMU Calibration: {}\nIMU Tilt: {}\nRTC Communication: {}\nRTC Data: {}\nGPS Communication: {}\nGPS Data: {}\nRobot Stuck: {}\nEEPROM Data: {}\n\n".format(mymower.ErrCharger, mymower.ErrBattery, mymower.ErrMotorLeft, mymower.ErrMotorRight, mymower.ErrMotorMow, mymower.ErrMowSense, mymower.ErrOdoLeft, mymower.ErrOdoRight, mymower.ErrPeriTout, mymower.ErrTracking, mymower.ErrImuComm, mymower.ErrImuCalib, mymower.ErrImuTilt, mymower.ErrRtcComm, mymower.ErrRtcData, mymower.ErrGpsComm, mymower.ErrGpsData, mymower.ErrStuck, mymower.ErrEepromData) + "Console output:\n" + txtConsoleRecu.get('1.0','end'), 'plain'))

        server = smtplib.SMTP('smtp.gmail.com', 587)
        server.starttls()
        server.login(email, password)
        text = msg.as_string()
        server.sendmail(email, send_to_email, text)
        server.quit()
        print("Error email sent!")
        consoleInsertText("Error email sent!" + '\n')
        return True
    else:
        print("Network connection problem. Email not sended!")
        consoleInsertText("Network connection problem. Email not sended!" + '\n')
        return False

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 2 Monate 2 Wochen her #17796

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1057
  • Dank erhalten: 203

I want to print(txtConsoleRecu.get('1.0','end') to error email but only e.g. 100 lines or so. Is that possible without changing that delete setting?

Simply copy the txtConsoleRecu to a new tk string var ConsoleToMail and keep only 100 lines in this var using ConsoleToMail.delete('100.0',tk.END).


Today it's 38 deg oudoor and 58 Deg Inside the mower so !!!!!!!!!!!!!!!!!(The Pi screen show a new small red temperature icon ??????? and finally all hang)
I thing i need to reduce the max temp setting value and avoid charging if the temp is too high.
Folgende Benutzer bedankten sich: jussip

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #17915

  • Stockfisch
  • Stockfischs Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 97
  • Dank erhalten: 2
Hello
I have short questions about the Test modes:
- When i run 3m forward test my mower drives nearly perfect 3m (+-5cm) :)
- When i run the 180° test my mower turn nearly perfect 180° :cheer:
- But if i run 360° the mower only turns ~220-250° :(
- When i run the IMU test and click on South or North or whatever the Mower allways turn only 90° :S
My values of IMU are logic. I see nearly 0° at North and 180° at South
What can be the reasons for the 2 problems?

And one question about leaving the station:
- I adjusted the "Reverse Distance" to max value of 200cm
But the mower runs back only ~1m. This is very tight because my station is in an edge.

Thanks and best regards,
Bjoern

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #17918

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1057
  • Dank erhalten: 203
It's a bug.
I have not this issue because my motor are fast.

The problem is in the state duration timeout.
On all state there is a limit duration to avoid mower stuck on slope or other, But if your motor rotate slowly the timeout occur before the end of the state.

Actualy in the code i find a value according to my Denna platform, but certainly it's different for you



It'sinto void Robot::OdoRampCompute()
  //compute the approximative moving time in millis()
  //warning maybe 40000 need to be adjusted
  //Need to compute in 2 times to avoid overflow  !!!!!
  movingTimeLeft = distToMoveLeft *  odometryTicksPerRevolution / 40000.00; //0.58= nb ticks/ms at max speed
  movingTimeLeft = movingTimeLeft * abs(SpeedOdoMaxRight);
  movingTimeRight = distToMoveRight * odometryTicksPerRevolution / 40000.00;
  movingTimeRight = movingTimeRight * abs(SpeedOdoMaxRight);
  //for small mouvement need to reduce the accel duration
  if (movingTimeLeft >= motorOdoAccel) accelDurationLeft = motorOdoAccel;
  else   accelDurationLeft =  movingTimeLeft / 2;
  if (movingTimeRight >= motorOdoAccel) accelDurationRight = motorOdoAccel;
  else   accelDurationRight =  movingTimeRight / 2;
  if (statusCurr == TESTING) {
    MaxOdoStateDuration = 30000 + max(movingTimeRight, movingTimeLeft); //add 3 secondes to the max moving duration of the 2 wheels
  }
  else
  {
    MaxOdoStateDuration = 3000 + max(movingTimeRight, movingTimeLeft); //add 3 secondes to the max moving duration of the 2 wheels
  }
  //check to set the correct heading
  imuDriveHeading = imu.ypr.yaw / PI * 180; //normal mowing heading
  if (statusCurr == BACK_TO_STATION) {  //possible heading change
    imuDriveHeading = periFindDriveHeading / PI * 180;
  }
  if (statusCurr == REMOTE) {   //possible heading change
    imuDriveHeading = remoteDriveHeading / PI * 180;
  }

I need to spend time to find a correct algorithm to estimate the exact state moving duration but it's complex with accel and brake..

In all case if you use the Pi ,In the console you can see the message "Warning can t TestMotor in time please check your Odometry or speed setting"
and if this kind of message is present very often on normal mowing you need to adjust the value 40000.

I have post on Git the solution for the Test by adding 30 secondes when you start test motor or IMU.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Ladezeit der Seite: 0.500 Sekunden