×

INDI Library v1.9.8 Released (29 Sep 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

INDI focuser driver for Waveshare Stepper Motor HAT for Raspberry Pi / Rock Pi

  • Posts: 59
  • Thank you received: 3
Awesome! I'll definitely give that a try. Sorry I haven't had a chance to check it out yet. I've been busy re-purposing my 3d printer to print headbands for medical face shields. It looks like I'm supposed to have clear skies tonight, so I'll hopefully be able to get the gear out and give it a trial run.
The following user(s) said Thank You: Jeff Wilson
2 years 6 months ago #51264

Please Log in or Create an account to join the conversation.

  • Posts: 51
  • Thank you received: 12
I've been using an arduino nano and 28BYJ-48 Stepper Motor for a while (there are a few projects across the web for this), but that requires an extra USB cable to the Nano from my Rpi/Rock64. I might have to give this a try. I think I have a NEMA motor hanging around somewhere.
2 years 6 months ago #51298

Please Log in or Create an account to join the conversation.

  • Posts: 215
  • Thank you received: 16
colgs3b: I've been using an arduino nano and 28BYJ-48 Stepper Motor for a while (there are a few projects across the web for this), but that requires an extra USB cable to the Nano from my Rpi/Rock64. I might have to give this a try. I think I have a NEMA motor hanging around somewhere.

That was my reasoning as well. I switched from an Arduino setup. The really good news is that you can power the WaveShare HAT and have it power the Pi, thus eliminating one more cable in addition to the USB.
SkyWatcher 10" SynScan Goto Dobsonian, SV106 Guide, ZWO ASI178MC, Svbony SV105, SV305, Pi3HQcam, Pi4, DIY WaveShare focuser, Linux Ubuntu, KStars/Ekos, Carte du Ciel/CCDCiel, AstroDMx_Capture, Siril, StarTools, GIMP
Last edit: 2 years 6 months ago by Jon Carleton.
2 years 6 months ago #51338

Please Log in or Create an account to join the conversation.

  • Posts: 389
  • Thank you received: 95
BTW, I updated the source code to remove the dependency on WiringPi, since it has been abandoned by its author. It uses a different library for accessing the GPIO pins to communicate with the HAT. There shouldn't be any necessary configuration on anyone's part, it should just work. It accesses the /dev/gpiomem special file for access to the GPIO pins. On Raspbian:

"ls -l /dev/gpiomem" shows:

crw-rw---- 1 root gpio 247, 0 May 12 19:30 /dev/gpiomem

So as long as your user is a member of the "gpio" group, it should work. If you get any type of permission error, try adding your user to the gpio group. In my case, the user I run as is "pi", so:

sudo adduser pi gpio

Replace "pi" with whatever user you run as.

I'd be especially curious to know if this works on people running Ubuntu on their Raspberry Pi. I run Raspbian myself, so I can't check that.

Thanks!
-- Kevin
The following user(s) said Thank You: Jon Carleton
2 years 4 months ago #53710

Please Log in or Create an account to join the conversation.

  • Posts: 215
  • Thank you received: 16
Ah...excellent. I sent you a message about the wiringPi thing a while ago when it happened. And many thanks for making the change.
I have a Pi4 that I am running Raspbian on presently with the wiringPi-dependent version of the software, but I have built a Ubuntu 64bit Pi server and added xfce4 desktop for testing on a SD card. I can easily pop that card in, download the new code and see if it compiles and works. I'll let you know. If it does work, I'll probably stick with that platform, as having the 64bit OS solves another problem for me. The primary reason I have remained on Raspbian is your focuser driver. It REALLY works well!
SkyWatcher 10" SynScan Goto Dobsonian, SV106 Guide, ZWO ASI178MC, Svbony SV105, SV305, Pi3HQcam, Pi4, DIY WaveShare focuser, Linux Ubuntu, KStars/Ekos, Carte du Ciel/CCDCiel, AstroDMx_Capture, Siril, StarTools, GIMP
Last edit: 2 years 4 months ago by Jon Carleton.
2 years 4 months ago #53907

Please Log in or Create an account to join the conversation.

  • Posts: 389
  • Thank you received: 95
Thanks Jon! yes I'm especially interested in your results!

And yes, I responded to your PM, but it took me a while to notice I even had a message, since the forum software doesn't notify me on screen, and the email notification was in my spam folder.
2 years 4 months ago #53911

Please Log in or Create an account to join the conversation.

  • Posts: 1117
  • Thank you received: 182

Hi esb:

I considered using a 3D printer belt to drive the focus of my WhiteCat (basically identical to your RedCat), but abandoned it in favor of a geared solution:



indilib.org/forum/general/6896-featherto...us-cube-2.html#53102

By moving the gears away from the focus ring, this increases travel, hence resolution and reduces torque by a factor of 2x and 1/2, respectively.

That setup is driven driven by an analog motor and the FCUSB driver. Using Hy's linear focus algorithm, the result is spectacular. Hits perfect focus every time.

Atlas Pro AZ-EQ, ASI1600MM-Pro, ASI120MM-S, ES102ED, WO-Z61, Nikon D3300, ASI-EFW, ZWO LRGB,Ha,O3,S2 filter set
Last edit: 2 years 4 months ago by Jose Corazon.
2 years 4 months ago #53928
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 215
  • Thank you received: 16
OK...the compile under Ubuntu Server 20.04 went very well with no barks. However, installing indilib and kstars afterward had some conflicts with /usr/lib/aarch64-linux-gnu/libindilx200.so.1 that required deleting some files and reinstalling indilib1.

Running indiserver with just the focuser did trigger the gpio permission error. There was no gpio group in the /etc/group file, so I did addgroup gpio and adduser ubuntu gpio. Then I had to chmod 660 /dev/gpiomem and chown root.gpio /dev/gpiomem to get things to match your Raspbian specs. Still getting the permissions error. I'll mess with it more tomorrow and see where the issue is.
SkyWatcher 10" SynScan Goto Dobsonian, SV106 Guide, ZWO ASI178MC, Svbony SV105, SV305, Pi3HQcam, Pi4, DIY WaveShare focuser, Linux Ubuntu, KStars/Ekos, Carte du Ciel/CCDCiel, AstroDMx_Capture, Siril, StarTools, GIMP
Last edit: 2 years 4 months ago by Jon Carleton.
2 years 4 months ago #53930

Please Log in or Create an account to join the conversation.

  • Posts: 215
  • Thank you received: 16
OK, rebooted and /dev/gpiomem reverted to ownership of root.root. I ran sudo indiserver -vvvv indi_wmh_focuser and got these results:
ubuntu@ubuntu:~$ sudo indiserver -vvvv indi_wmh_focuser
2020-05-16T12:44:40: startup: indiserver -vvvv indi_wmh_focuser
2020-05-16T12:44:40: Driver indi_wmh_focuser: pid=2926 rfd=3 wfd=6 efd=7
2020-05-16T12:44:40: listening to port 7624 on fd 4
2020-05-16T12:44:40: Driver indi_wmh_focuser: sending msg copy 1 nq 1:
<getProperties version='1.7'/>

2020-05-16T12:44:40: Driver indi_wmh_focuser: read defSwitchVector Waveshare Motor HAT Focuser CONNECTION Idle rw
CONNECT='Off'
DISCONNECT='On'
2020-05-16T12:44:40: Driver indi_wmh_focuser: read defTextVector Waveshare Motor HAT Focuser DRIVER_INFO Idle ro
DRIVER_NAME='Waveshare Motor HAT Focuser'
DRIVER_EXEC='indi_wmh_focuser'
DRIVER_VERSION='1.0'
DRIVER_INTERFACE='8'
2020-05-16T12:44:40: Driver indi_wmh_focuser: read defSwitchVector Waveshare Motor HAT Focuser DEBUG Idle rw
ENABLE='Off'
DISABLE='On'
2020-05-16T12:44:40: Driver indi_wmh_focuser: read defNumberVector Waveshare Motor HAT Focuser POLLING_PERIOD Idle rw
PERIOD_MS='1000'
2020-05-16T12:44:40: Driver indi_wmh_focuser: read defSwitchVector Waveshare Motor HAT Focuser CONFIG_PROCESS Idle rw
CONFIG_LOAD='Off'
CONFIG_SAVE='Off'
CONFIG_DEFAULT='Off'
CONFIG_PURGE='Off'


I added a udev rule: KERNEL=="gpio*", MODE:="0660", GROUP:="gpio" and that fixed the sudo problem. I'm testing the operation of the focuser next.
SkyWatcher 10" SynScan Goto Dobsonian, SV106 Guide, ZWO ASI178MC, Svbony SV105, SV305, Pi3HQcam, Pi4, DIY WaveShare focuser, Linux Ubuntu, KStars/Ekos, Carte du Ciel/CCDCiel, AstroDMx_Capture, Siril, StarTools, GIMP
Last edit: 2 years 4 months ago by Jon Carleton.
2 years 4 months ago #53958

Please Log in or Create an account to join the conversation.

  • Posts: 215
  • Thank you received: 16
OK, it works fine in Ubuntu Server 20.04 for IoT (Pi4b). Probably best to install KStars/Ekos/INDI before installing per your instructions on GitHub rather than afterward to avoid whatever that conflict issue was. One needs to create the gpio group (and add user to group) and create a rule for the permissions on /dev/gpiomem. I like the new speed settings. about 40 ms works well for my NEMA17 with the gears I used.

The details of setup and testing are in the previous two posts, but since they were listed as replies to El Corazon, I decided it was best to backup and make this a reply to your post. This forum software is a bit wacky when it comes to notifications and thread order. That is one reason I wondered if you got my earlier messages. I got the distinct feeling the thing crashed on submit instead of sending. Better than no Forum, though.

Thanks again for your work! Well done. If I can assist in any way in future, do not hesitate to ask.

Last gasp: I did a reinstall of Ubuntu 20.04 on the Pi4 and installed KStars/Ekos/INDI prior to compiling your sofware and there was no library conflict. The only remaining issues were to create the gpio group, add the user to the group and create the rule KERNEL=="gpio*", MODE:="0660", GROUP:="gpio" in /etc/udev/rules.d
SkyWatcher 10" SynScan Goto Dobsonian, SV106 Guide, ZWO ASI178MC, Svbony SV105, SV305, Pi3HQcam, Pi4, DIY WaveShare focuser, Linux Ubuntu, KStars/Ekos, Carte du Ciel/CCDCiel, AstroDMx_Capture, Siril, StarTools, GIMP
Last edit: 2 years 4 months ago by Jon Carleton.
2 years 4 months ago #53962

Please Log in or Create an account to join the conversation.

  • Posts: 389
  • Thank you received: 95
Jon,

Thank you very much for your testing! And I'm glad you got it to work on Ubuntu without too much difficulty. I might take the easy way out, and install indi_wmh_focuser as setuid root. At least then only the focuser would run as root, and not all of the INDI modules. It's less than ideal, I know, since you normally only want to give only the permissions that a process needs, and no more. But hey, this is just a Pi running on a telescope, after all. :)

BTW, I'm working on new anti-backlash code. The new code will always approach focus from the same direction. If it needs to move inward, it will move inward. If it needs to move outward, it will move a bit too far, then move inward to the desired position. Or vice versa if desired.
2 years 4 months ago #53988

Please Log in or Create an account to join the conversation.

  • Posts: 389
  • Thank you received: 95

El Corazon,

Nice looking setup! I like the anti-backlash rubber band! :)

I assume that was all 3D printed?
2 years 4 months ago #53989

Please Log in or Create an account to join the conversation.

Time to create page: 0.454 seconds