Giter VIP home page Giter VIP logo

Comments (17)

healeysa avatar healeysa commented on July 18, 2024 1

Current Astroberry focuser cannot work on Raspberry PI 5. To use the same GIPO numbers as before, gpiochip4 should be used.

I have created code to get the model name from /sys/firmware/devicetree/base/model and use the appropriate gpiochip number. Could you merge the attached patch?

diff.patch

Or should I submit a Pull Request?

This Patch worked great for me on a Raspberry Pi 5. Thanks for sharing!!

from astroberry-diy.

rkaczorek avatar rkaczorek commented on July 18, 2024 1

Thanks for great work! Pushed to master

from astroberry-diy.

mimosa4 avatar mimosa4 commented on July 18, 2024

even when applying the patch the focuser does not work

from astroberry-diy.

jctk avatar jctk commented on July 18, 2024

Hi @mimosa4

Please let me know a few things to help me isolate the issue.

Q1.
Was Focuser working on Raspberry PI 4 before you applied this patch?

Q2.
Did you install the HAT and Stepper Motor that worked on Raspberry PI 4 on Raspberry PI 5?

Q3.
Have you confirmed that the Stepper Motor installed on Raspberry PI 5 in Q2 works with any test program other than Astroberry Focuser?

Q4.
Is the INDI control panel for Astroberry Focuser on Raspberry PI 5 the same as that on Raspberry PI 4?

Q5.
What message is displayed when the following command is executed on Raspberry PI 5?
cat /sys/firmware/devicetree/base/model

For my Raspberry PI 5, the following string is displayed.
Raspberry Pi 5 Model B Rev 1.0

from astroberry-diy.

mimosa4 avatar mimosa4 commented on July 18, 2024

Hi jctk and thank for your answer

Q1 - I have never tested with an RPI4 but I tested directly with RPI5.

Q2 - See Q1.

Q3 - I tested Stepper motor and driver with another program and everything is OK.

Q4 - I don't know ; see Q1.

Q5 - The same as you : " Raspberry Pi 5 Model B Rev 1.0 "

I can do a test with a RPI 4 I have.
I'll come back to post after the test.

from astroberry-diy.

jctk avatar jctk commented on July 18, 2024

When you test with RPi4, could you check with the original code without the patch and with the patched code?

from astroberry-diy.

mimosa4 avatar mimosa4 commented on July 18, 2024

OK, I will

from astroberry-diy.

mimosa4 avatar mimosa4 commented on July 18, 2024

Hi jctk
Finally I managed to install astroberry focuser on RPI4 but only with bullseye 64 bits ; compilation errors with bullseye 32 bits.
I tested with and without patch and both work.

from astroberry-diy.

jctk avatar jctk commented on July 18, 2024

I am using INDI with bookworm 64bit for both RPi4 and RPi5.

Now, if I set the INDI Control Panel settings on the Astroberry Focuser on the RPi5 to the same as on the RPi4, did it work?

The only difference in behavior between RPi5 and RPi4 is whether gpiochip4 or gpiochip0 device is used.
The logs of the patched Astroberry Focuser show the model name of the Raspberry PI and the name of the target device.

For example, for the RPi5, the following is shown.

2024-04-25T13:58:46: [INFO] model:Raspberry Pi 5 Model B Rev 1.0, device:/dev/gpiochip4

Does this show up in the INDI Cotrole Panel logs like this?

If it doesn't work, could you please set its log level to Verbose and share the detailed log?

from astroberry-diy.

mimosa4 avatar mimosa4 commented on July 18, 2024

Sorry but I don’t know where to find the indi logs; I’m mostly a fedora user and the logs are in/var/logs. I looked for them but I did not find them.
If you say that on your setup it works on RPI4 and RPI5 there is no reason for it to be otherwise with my hardware.
As I did a lot of manipulations with this RPI5 there may be a library problem. I will redo a fresh installation.
I will come back to this post later.
Thanks for your help.

from astroberry-diy.

mimosa4 avatar mimosa4 commented on July 18, 2024

Hi jctk
I reinstalled raspiOS Bookworm 64-bit, used the patch and used the same settings as for RPI4.
It still doesn’t work.
When I start a movement, the engine brake comes into action and the axis does not rotate.

from astroberry-diy.

jctk avatar jctk commented on July 18, 2024

When I start a movement, the engine brake comes into action and the axis does not rotate.

If the motor is rattling but not moving in a certain direction, the wiring between the stepper motor and the handler is not correct.
Or maybe there is not enough voltage, current, or torque in the motor.

from astroberry-diy.

mimosa4 avatar mimosa4 commented on July 18, 2024

The engine doesn't rattling it is simply maintained .
I did not change the wiring between the engine and the driver.
I use 2 separate 5V/5A power supplies for the RPI5 and 12V/3A for the motor.
The wiring is exactly the same as when testing with the RPI4. The only difference is that on the RPI4 I use an SSD on USB3 and on the RPI5 an NVMe SSD on a HAT. I don’t think it matters.
I use a A4988 driver and a 17HS08-1004S stepper motor.
I don’t understand what’s going on.

from astroberry-diy.

jctk avatar jctk commented on July 18, 2024

I am concerned that the voltage and current of the A4988 motor is too high relative to 17HS08-1004S, but I don't think that is the cause.

I think logs are needed to analyze the cause.
You can find the log output settings and storage location at https://www.indilib.org/.

from astroberry-diy.

mimosa4 avatar mimosa4 commented on July 18, 2024

The current on the A4988 can be adjusted but this is not the problem since the exact same configuration works with the RPI4.
Attached is the log file: indi + focuser (verbose).
For information eqmod, gps and zwo are not connected.
log_16-47-37.txt

I will finish this discussion because I will be leaving and I will not be back until Thursday.
Thanks for everything

from astroberry-diy.

jctk avatar jctk commented on July 18, 2024

I looked at the log.
The function AstroberryFocuser::Connect() determines the model as Raspberry Pi 5, the correct device "/dev/gpiochip4" is opened, and the function outputs a log indicating that it has completed successfully.

My patch is only the part that determines the device name. The device is successfully opened as determined by the code in the patch.

I suggest you check with the author of the original source or do your own investigation on the behavior of the other parts.

The original source has no error handling for GPIO operations.
Therefore, even if the GPIO operation fails, it cannot be determined in the log.
You may need to investigate with the debugger or add logs.

Finally, here are a few things you might want to check.
After connecting to Profile with KStars, open a terminal and run the "gpioinfo" command.
You can see which GPIOs the Astroberry Focuser is using in the "gpiochip4" block.
You can check if the correct GPIOs are assigned.

Here is part of the output of the "gpioinfo" command for my Astroberry DIY Driver HAT

   line  17:     "GPIO17" "m1@astroberry_focuser" output active-high [used]
   line  18:     "GPIO18" "m2@astroberry_focuser" output active-high [used]
   line  19:     "GPIO19"       unused   input  active-high 
   line  20:     "GPIO20"       unused   input  active-high 
   line  21:     "GPIO21"       unused   input  active-high 
   line  22:     "GPIO22" "sleep@astroberry_focuser" output active-high [used]
   line  23:     "GPIO23" "dir@astroberry_focuser" output active-high [used]
   line  24:     "GPIO24" "step@astroberry_focuser" output active-high [used]
   line  25:     "GPIO25"       unused   input  active-high 
   line  26:     "GPIO26"       unused   input  active-high 
   line  27:     "GPIO27" "m3@astroberry_focuser" output active-high [used]

Supplementary information.
Your version of KStars is very old. The latest KStars is 3.7.0.
I recommend using the same time release of KStars and INDI.

from astroberry-diy.

jctk avatar jctk commented on July 18, 2024

Thanks for merging this patch.
It is only a workaround because there is no guarantee that this logic will work in the future since it depends on the RPi model name.

The best way is to use libgpiod's API to get the appropriate GPIO Chip name.

Well, this workaround should be sufficient for a few years.

from astroberry-diy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.