Problem with DUE and Raspberry

Starsurfer78

Active member
At the moment i test DUE and the Raspberry (4) and set up the Raspberry according to the Wiki.
At the Point:
Piardu need to start and you can navigate inside all the menu very slowly if there are no firmware in the arduino DUE so wait
the Phyton Console show the Error:
>>>
============= RESTART: /home/pi/Documents/PiArdumower/PiArdu.py =============
Linux Platform
pygame 1.9.4.post1
Hello from the pygame community. https://www.pygame.org/contribute.html

************************************
ERREUR DE CONNECTION WITH PCB1.3 DUE
************************************

RFID file loaded OK
File "/home/pi/Documents/PiArdumower/PiArdu.py", line 609, in checkSerial
mymower.dueSerialReceived=Due_Serial.readline()
Traceback (most recent call last):
File "/home/pi/Documents/PiArdumower/PiArdu.py", line 609, in checkSerial
mymower.dueSerialReceived=Due_Serial.readline()
NameError: name 'Due_Serial' is not defined
Traceback (most recent call last):
File "/home/pi/Documents/PiArdumower/PiArdu.py", line 609, in checkSerial
mymower.dueSerialReceived=Due_Serial.readline()
NameError: name 'Due_Serial' is not defined
*** extract_tb:
[<FrameSummary file /home/pi/Documents/PiArdumower/PiArdu.py, line 609 in checkSerial>]
*** format_tb:
[' File "/home/pi/Documents/PiArdumower/PiArdu.py", line 609, in checkSerial\n mymower.dueSerialReceived=Due_Serial.readline()\n']
*** tb_lineno: 609
ERROR PLEASE CHECK TRACEBACK INFO
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.7/tkinter/__init__.py", line 1705, in __call__
return self.func(*args)
File "/home/pi/Documents/PiArdumower/PiArdu.py", line 208, in ButtonFlashDue_click
Due_Serial.close()
NameError: name 'Due_Serial' is not defined
The PI and the DUE are connected with a USB cable and a 5" Touchscreen connected only with HDMI and a USB Cable for the Touch.
As shown on the photo in the wiki.
The Power LED from DUE is on and the L (orange) LED is blinking.
THE DUE is empty.

Do i forgot something?
 
Normaly it's work on all USB port.
Are you sure you change into config.py:
DueconnectedOnPi from True to False.

If DUE is empty you need to set this var to FALSE to test the Piardu soft part.
If the AZURITBER code is present inside DUE you can set DueconnectedOnPi to True.

You can also upload code in the DUE using your PC.
 
Yes i have follow the Wiki Article.
In PiArdu.py you search for ttyACM0 and ttyACM1 and on the usb3 port there where not presend. If i remeber right, the usb3 ports have other names.
I have testet different USB Cables and USB Ports, after change to usb2 port, the connection was presend.
Flashing over the Raspi has worked also, so it's ok, for the moment.

Now I have to think about how to assemble the components without PCB.

P.S. Nice work
 
Thanks but it's strange because i have actually a PI4 in my RL2000 and the DUE is connected on Blue USB3 port and detected as ttyACM0 or ttyACM1 if error occur.
Maybe try to powerOFF all and restart from 0V to be sure.

Without PCB it's better to use only 3.3 V module.
For example If you test on table ,you can use the ESP32 (like describe on RFID option but without rfid board) to connect via Bluetooth and use arduremote it's very easy to connect and test firmware in real time.
 
Hm ok, maybe it was my fault or the incorrect USB Cable. But for the moment i'm lucky that it runs.
The ESP32's are on the way for the Perimeter Sender.

Is the Step: Optional Screen
only for Display that are conected to the Raspberry's GPO's or for all? My is only conected to HDMI an to USB for Touch.

Did you have a link to the two Buttons left side from your Display?

Thank you for the replay.
 
Zuletzt bearbeitet:
Sorry but i don't understand this part:

Is the Step: Optional Screen
only for Display that are conected to the Raspberry's GPO's or for all? My is only conected to HDMI an to USB for Touch.

The 5 inch screen is directly connected to GPIO port for touchscreen and HDMI using the adapter

So i don't use PI GPIO at all, All the electronic is connected to PCB1.3.

Fo 5 Volt device you can use a simple arduino nano and connect it to PI over USB (you can see the code in nonaconnectedonPI) In the past i use this for rain sensor and multiple VL53L0 laser sensor, but laser fail to work outdoor on full sun.
 
The 5 inch screen is directly connected to GPIO port for touchscreen and HDMI using the adapter
OK on the picture it's seems that the TFT used the GPIOs of the mega.

Other Question,
i have flashed the DUE with AZURITBER-MPU9250 on the PC. Seriel Console on PC show, that the Firmware works. So i have put the DUE back to the Raspi on native USB Port an start the Raspi.
The Start is normal without errors, but the Piardumower start very slow and the operation of the software is very slow.
The Pyton Shell show:
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license()" for more information.
>>>
============= RESTART: /home/pi/Documents/PiArdumower/PiArdu.py =============
Linux Platform
pygame 1.9.4.post1
Hello from the pygame community. https://www.pygame.org/contribute.html
Find Serial on ttyACM1
b''
RFID file loaded OK
So all seems ok.

1. It is not possible to flash the DUE with the Raspberry
2. On Settings -> Main -> Reboot all, doesn't work
3. On Main Page Power off, doesn't work

Can it be a Problem that there is no other Hardware than the Raspberry and the DUE?
Must i have a bluethoot Device and arduremote to aktivate something?

Désolé pour toutes ces questions.
 
Without PCB1.3 it's a little complex to test because you don't have the RTC memory ,so AZURITBER always start with factory setting locate into mower.cpp, but normaly you need to have data exchange between PI and DUE and not only console.

With only raspberry and DUE you can normaly flash.
Do you have arduino ide installed in the raspberry , if yes simply try to load a simple blink soft and try to flash DUE directly from raspberry.
Have you done the dos2unix process on DueFlash.py.Try to load the prog into Python idle and test.
This normaly solve point 1

For point 2 and 3:
Without PCB1.3 the factory setting are used,so:
Check into mower.cpp
near line 240
You need to have
RaspberryPIUse = true; // a raspberryPi is connected to USBNative port
If not change it and upload again the code in the DUE.

You need to see the red line into PIardu with status and date changing each second.

If you are french you can send message in PM in french.
 
The Arduino IDE is installed on the Raspi and dos2unix i have done for all the Files descripted in the Wiki.
After find RaspberryPIUse = false; and change it to true it works now.
I have add a DS3231 RTC and change the AT24C32_ADDRESS in mower.h to B1010111
Seems to work too. But i didnt test yet if the Eproom is used and worked correct.
The RTC lost the Time every start, perhaps it's not ok. Must test a other one.

Next step is to add the MPU9250, but i'm not sure if it works out of the box with 3.3v.

If i add a ESP32 for bluetooth the RX/TX need a level shifter to 3.3v?

Thank you for replay and i'am not french but german :cool:
 
Now the PC Console shows:
SETUP
--> ++++++++++++++++++++++++++++++++++* Start Robot Setup at 2502 --> +++++++++++++++++++++++++++
Load ErrorCounters
EEPROM ERR COUNTERS: NO EEPROM ERROR DATA
PLEASE CHECK AND SAVE YOUR SETTINGS
Save Robot Stats
Robot Stats address Start = 800
Robot Stats address Stop = 826
ERROR / ERR
UserSettings are read from EEprom Address : 2000 To 2497
Load Robot Stats
Robot Stats address Start = 800
Robot Stats address Stop = 826
IMU error: no calib data
-------- IMU CALIBRATION --------
ACCEL GYRO MPU6050 OFFSET ax: 376 ay: -1768 az: 1512 gx: 91 gy: 12 gz: -2
COMPASS OFFSET X.Y.Z AND SCALE X.Y.Z --> comOfs=0.00,0.00,0.00
comScale=1.00,1.00,1.00
.
--------------------------------------------------------------------------
--------------------------------- START IMU GYRO ACCEL -------------------
--------------------------------------------------------------------------
Connected with MPU-9250/MPU-9255
Wait for GYRO near 10 secondes
...........
Initial GYRO/ACCELL Yaw :0.00 Pitch : 0.00 Roll : 0.00
With Offset GYRO/ACCELL Yaw :0.00 Pitch : 0.00 Roll : 0.00
--------------------------------------------------------------------------
--------------------------------- START COMPASS --------------------------
--------------------------------------------------------------------------
Compass is not used
--------------------------------------------------------------------------
--------------------------------- IMU READY ------------------------------
--------------------------------------------------------------------------
------------------------------- GPS Initialisation --------------------------------------------
Send config sentence
End of Gps Config
START
Ardumower 1.44-Azuritber
Config: Ardumower
press...
d for menu
v to change console output (sensor counters, values, perimeter etc.)
off

Watchdog is enable and set to 2 secondes
BT in used : Use Arduremote over Bluetooth

Seems to look ok?
 
Yes it's OK.
You need to calibrate the GYRO to avoid error and after some test and restart the first EEPROM ERR COUNTER normaly go out.
MPU9250 you can directly power it at 3.3V and no problem (it's also possible to shunt the DC/DC voltage include in the ship with solder join)
ESP32 simply connect like describe in RFID page
directly RX to TX and TX to RX
VIN to same 5V as DUE
and GND to GND

Upload code named ESP32_BT_Passerelle into the ESP32 ( it's locate into TEST FILE on repository.)
Pair your phone with ESP32 and start arduremote.
 
Hi,
the Raspi and the due makes me crazy.

First I used now the AzuritBer Master, with GY-521, DS3231 RTC (change i2cc Adresse in mower.h) and DHT22 on PIN 49.
The Raspi is a Raspi 4

The Flashing of the DUE over Raspi, seems to work now. The Console shows Flash Finish.
1. Should the Raspi and DUE Reboot after Flash?

The Power of Button in Piardu does not work. The Raspi and DUE does not Power off.
I have follow the steps in Wiki:
Code:
cd ~/Documents/PiArdumower
dos2unix streamVideo320.py
dos2unix streamVideo640.py
dos2unix DueFlash.py
dos2unix PowerOff.py
dos2unix Restart.py
dos2unix testnet1.py
cd ~/Desktop
dos2unix mower.sh

If execute the PowerOff.py or Restart.py manualy, they did work.

If i set the Time in Piardu and send it to the RTC, the Time and Date did not save. After read the Time from RTC it is wrong. I have read in the Forum that the DS3231 should work with AzuritBer after changing the i2c Adresse from Eeprom.
With a test Program the RTC did work.

The DHT Temperature is not shown, did not test it yet with a test script. But the DHT is new.
 
Hi.
It's not easy to have all working withgout PCB1.3 but:
To test everything it's better to first setup the Option1 using Arduremote over BT (ESP32 work perfectly for that) and test all component before connecting Raspberry, Also i think the Date Time setting from PI don't work, i always use arduremote.

You need to first check the communication between DUE and PI.
Send a screen copy of the Console (On bottom left you need to see incoming data from DUE each 500 ms and on bottom right you need to see data send by PI)


For DHT temp, and without Arduremote access you need to activate it in mower.cpp line 113 set it to 1.And upload again the code.

Can you check the permission on poweroff and restart.py (Using PI file explorer ) You need to have permission to execute file

It's in WIKI :
Set permission to everyone for all the piardumower file
Open a terminal (>_ icon ondesktop) and send the 5 command
cd Documents
sudo chown -R pi:pi PiArdumower
sudo chmod -R 755 PiArdumower


Power OFF process Using PCB1.3 work like that:
Pi send request to DUE.
DUE send response to PI and initiate powerOFF pcb1.3, but wait 30 second before setting Out 4 to low
PI received response and save console and start powerOFF.py subprocess.
PI shutdown process start and take 10 or 20 seconds.
PCB1.3 cut power on all (DUE and PI) when out 4 is low.

Without communication between Pi and DUE it can't work.
 
Ok i will test it with Bluetooth.
The Folder and Files have the right permission.
So to power off or restart the due set out 4 to low. Must take a look into the schematic to find a solution.
 

Anhänge

  • Ardumower (ardumower) – VNC Viewer 22.01.2021 13_53_58.png
    Ardumower (ardumower) – VNC Viewer 22.01.2021 13_53_58.png
    55,5 KB · Aufrufe: 4
Can you check in mower.cpp if the battery monitor is activate.
It's line 220.
You need to activate it with arduremote or directly in mower.cpp if you use factory setting or using piardu.
Same for DHT22.

I check the date time setting (BUG!!) from piardu because it's fail also on my side.

bat monitor.pngsave.png
 
Oben