Sunray / PI / Teensy

Bernard

Well-known member
Staff member
Here you can find my work on the adaptation of SUNRAY firmware for teensy pcb:
From the excellent work of Alexander https://forum.ardumower.de/members/alexanderg.14267/

Repos link: https://github.com/Boilevin/Sunray_TeensyPcb

and the Raspberry PI interface

Repos link: https://github.com/Boilevin/PiArdu-for-Sunray

Without Raspberry:
You use the Sunray APP to manage all the mower over the esp32 BLE .
Max 10 maps

With Raspbery:
You use Sunray APP to create the map and upload it into Rover.
From PiSunray main screen:
main00.png
and map menu:
You can now import the map in the raspberry.
Max 99 House with 9 map on each house.
maps00.pngmaps01.png

The timer page can start mowing on the house and map you want:
timer00.png

Manual page can drive mower (same as azuritber):
manual00.png

On auto page you can see the location on mower in the map and the actual process running:
auto00.png

And using house view you can see the 99 possible house , double click on one map upload it in the rover to start it.
auto01.png
 
Last edited:
Great work Bernard!
The information of the location of the mower you wrote "On auto page you can see the location on mower in the map and the actual process running:" is GPS-RTK based or ODO metrie based?
 
It's RTK location at +/- 2 cm when you have a fix.
Odometry and IMU are used to check some error on small movement or when you have a float rtk location.

I try to make a screen video capture of the working mode for easy understanding how it's work when i have time
 
Hi Bernard, Thank you for this great work.
I try to compile your code with VS code and when I change the driver (ZS-X11H), I Have theses errors.

Can you Help me ?
Thank you

src\src\driver\TeensyRobotDriver.cpp:578:19: error: 'pinMotorRightFault' was not declared in this scope; did you mean 'pinMotorRightEnable'?
578 | if (digitalRead(pinMotorRightFault) == gearsDriverChip.faultActive)
| ^~~~~~~~~~~~~~~~~~
| pinMotorRightEnable
src\src\driver\TeensyRobotDriver.cpp:582:19: error: 'pinMotorMowFault' was not declared in this scope; did you mean 'pinMotorMowEnable'?
582 | if (digitalRead(pinMotorMowFault) == mowDriverChip.faultActive)
| ^~~~~~~~~~~~~~~~
| pinMotorMowEnable
src\src\driver\TeensyRobotDriver.cpp: In member function 'virtual void AmMotorDriver::resetMotorFaults()':
src\src\driver\TeensyRobotDriver.cpp:594:19: error: 'pinMotorLeftFault' was not declared in this scope; did you mean 'pinMotorLeftEnable'?
594 | if (digitalRead(pinMotorLeftFault) == gearsDriverChip.faultActive)
| ^~~~~~~~~~~~~~~~~
| pinMotorLeftEnable
src\src\driver\TeensyRobotDriver.cpp:602:19: error: 'pinMotorRightFault' was not declared in this scope; did you mean 'pinMotorRightEnable'?
602 | if (digitalRead(pinMotorRightFault) == gearsDriverChip.faultActive)
| ^~~~~~~~~~~~~~~~~~
| pinMotorRightEnable
src\src\driver\TeensyRobotDriver.cpp:610:19: error: 'pinMotorMowFault' was not declared in this scope; did you mean 'pinMotorMowEnable'?
610 | if (digitalRead(pinMotorMowFault) == mowDriverChip.faultActive)
| ^~~~~~~~~~~~~~~~
| pinMotorMowEnable
*** [.pio\build\teensy41\src\src\driver\TeensyRobotDriver.cpp.o] Error 1
 
Hi Bernard, Thank you for this great work.
I try to compile your code with VS code and when I change the driver (ZS-X11H), I Have theses errors.

Can you Help me ?
Thank you

src\src\driver\TeensyRobotDriver.cpp:578:19: error: 'pinMotorRightFault' was not declared in this scope; did you mean 'pinMotorRightEnable'?
578 | if (digitalRead(pinMotorRightFault) == gearsDriverChip.faultActive)
| ^~~~~~~~~~~~~~~~~~
| pinMotorRightEnable
src\src\driver\TeensyRobotDriver.cpp:582:19: error: 'pinMotorMowFault' was not declared in this scope; did you mean 'pinMotorMowEnable'?
582 | if (digitalRead(pinMotorMowFault) == mowDriverChip.faultActive)
| ^~~~~~~~~~~~~~~~
| pinMotorMowEnable
src\src\driver\TeensyRobotDriver.cpp: In member function 'virtual void AmMotorDriver::resetMotorFaults()':
src\src\driver\TeensyRobotDriver.cpp:594:19: error: 'pinMotorLeftFault' was not declared in this scope; did you mean 'pinMotorLeftEnable'?
594 | if (digitalRead(pinMotorLeftFault) == gearsDriverChip.faultActive)
| ^~~~~~~~~~~~~~~~~
| pinMotorLeftEnable
src\src\driver\TeensyRobotDriver.cpp:602:19: error: 'pinMotorRightFault' was not declared in this scope; did you mean 'pinMotorRightEnable'?
602 | if (digitalRead(pinMotorRightFault) == gearsDriverChip.faultActive)
| ^~~~~~~~~~~~~~~~~~
| pinMotorRightEnable
src\src\driver\TeensyRobotDriver.cpp:610:19: error: 'pinMotorMowFault' was not declared in this scope; did you mean 'pinMotorMowEnable'?
610 | if (digitalRead(pinMotorMowFault) == mowDriverChip.faultActive)
| ^~~~~~~~~~~~~~~~
| pinMotorMowEnable
*** [.pio\build\teensy41\src\src\driver\TeensyRobotDriver.cpp.o] Error 1
I never test the teensy code with ZSX11 driver, But to solve this compile error, you can simply delete all the code into the
void AmMotorDriver::resetMotorFaults(){
But can you show your change in the config.h (there is no ZS-X11H option ??? or i have not update github ??
 
Thank you for your response.
Regarding this post :
I use the JYQD driver.
 

Attachments

Thank you for your response.
Regarding this post :
I use the JYQD driver.
OK.
But you need to go deeper in the code and adjust according your wiring between driver and mainPCB.
Also be careful with VS code compilation issue in last version .

What is the platform and motor ?
 
Here you can find my work on the adaptation of SUNRAY firmware for teensy pcb:
From the excellent work of Alexander https://forum.ardumower.de/members/alexanderg.14267/

Repos link: https://github.com/Boilevin/Sunray_TeensyPcb

and the Raspberry PI interface

Repos link: https://github.com/Boilevin/PiArdu-for-Sunray

Without Raspberry:
You use the Sunray APP to manage all the mower over the esp32 BLE .
Max 10 maps

With Raspbery:
You use Sunray APP to create the map and upload it into Rover.
From PiSunray main screen:
View attachment 1080
and map menu:
You can now import the map in the raspberry.
Max 99 House with 9 map on each house.
View attachment 1075View attachment 1074

The timer page can start mowing on the house and map you want:
View attachment 1076

Manual page can drive mower (same as azuritber):
View attachment 1077

On auto page you can see the location on mower in the map and the actual process running:
View attachment 1079

And using house view you can see the 99 possible house , double click on one map upload it in the rover to start it.
View attachment 1078


Hi,

I have a question about this. Does the Raspberry Pi run as a server in this case, working with the Sunray app only to help load the map, or does it also handle control? I'm a bit lost in the world of Sunray. Could the Pi be placed in the house instead, meaning it wouldn’t have to be inside the mower? Would the ESP be able to work over Wi-Fi in this setup?
 
Not only manage the map, you can take control of the mower in manual mode, in the last version the manual mode also have the video feedback and Tensorflow IA obstacle detection, but it's not easy to implement all the dependence of tensorflow, and i need to say that it's really not perfect.

PI is locate inside the mower to have a perfect responsive action also using a large tactile screen, you can totaly control mower if no wifi or phone .

Yes ESP is perfectly able to work over WIFI, and you can easily test this with the great CASSANDRA app :
 
Back
Top