OneStep on raspberry pi


dhirajranger@...
 

Hi all,

I have been going over the wiki non stop for past couple of days from what i understand the current best build for oneStep is miniPCB with teensy 4.0. I was wondering why not use raspberry pi? it has built in wifi and bluetooth so lower cost (at least with pi zero) and much faster than any other platform. If there are not some obvious hurdles i would like to pick it up and port to R-pi. I wanted the the thoughts of this community on this. is this doable at all? if so can you give me a general idea where to start


"Guilherme Vênere
 

I'd love to see that too but i guess the issue with Raspberry Pi is the unreliable clock and the multitasking with the OS which might introduce unknown delays? 

Guilherme

On Tue, Nov 10, 2020 at 7:15 AM <dhirajranger@...> wrote:

Hi all,

I have been going over the wiki non stop for past couple of days from what i understand the current best build for oneStep is miniPCB with teensy 4.0. I was wondering why not use raspberry pi? it has built in wifi and bluetooth so lower cost (at least with pi zero) and much faster than any other platform. If there are not some obvious hurdles i would like to pick it up and port to R-pi. I wanted the the thoughts of this community on this. is this doable at all? if so can you give me a general idea where to start


dhirajranger@...
 

I think there must be few ports of some RTOS for that on raspberry pi, not sure how practical it would be though


Khalid Baheyeldin
 

It is more than just the Raspberry Pi's clock.

First, The Pi and OnStep boards are very different things: the Pi is a single board
computer (SBC), while the OnStep boards are basically microcontrollers.
An SBC usually runs a multitasking operating system, like Linux. It has peripherals
and so on.
Microcontrollers are basically single tasked.

Second, there is the whole Arduino API that is used throughout OnStep.
Therefore, OnStep can ONLY be compiled on boards that have Arduino support.


Alexander Varakin
 

Porting OnStep to Pi woud be a very major effort, even if it is possible.
I believe there is some project out there which is using Pi for controlling EQ mount.
If you really want to use Pi, do what I did: control the mount using a dedicated board (e.g. MKS Gen L) and control everything else using Pi.


dhirajranger@...
 

I was thinking of writing all the code from scratch in python or even reUse the C code but yeah the Arduino Libs used will be a major undertaking, I understand these are two very different universe but still wanted thoughts of people who have done this/tried this. from what i gather from all your views it will not be much of a port rather it will be parallel project from scratch. I was under impression some clever hack of running arduino code on  Rpi and pinMapping. Thanks everyone for your input


Rafael Barberá Córdoba
 

I don't understand your motivations. What OnStep does, in the end, is controlling some pieces of hardware (motors). Here perfect timing and a simpler execution path is the goal. And for this, microcontrollers are vast superior. Yes is more difficult to build fancy UI using it or adding complex software, but there is not need at this level. OnStep is a very modular system with multiple microcontrollers each one performing a dedicated task. Take for example WiFi add-on. Is not only software. You need to add a dedicated micro to handle it. Why? because is simpler and more testable. You have OnStep main controller communicating via serial interface. You add another micro with WiFi capabilities talking via serial with the main OnStep one and bang, you have WiFi capabilities "built in" your system.

You need more high level software? perfect, add it to other computer and use ASCOM / INDI to communicate with OnStep ecosystem. I've done with a Mac. Now, I'm running all the software I need inside a Raspberry Pi 4. This RP4 connects via WiFi with the add-on that talks via serie interface with OnStep. Complex? Perhaps, but I only interact with one system (KStars/Ekos). At this level of modularity I was able to test each component independently and I can put a new connection at each interface. For example, I also use SkySafari on my phone to connect directly via WiFi with the mount to control it when I'm at the eyepiece.

If you put all this possibilities on a Raspberry and also tries to run the top level software (KStars/Ekos) on it you will have a lot of food on the same plate. And you need to enable all the communications with the external world (a ton of users prefer to use Windows software connecting with ASCOM). I think that the goal you have is enormous and I don't see any advantage.

I like a lot having OnStep so close to the metal. It's completely autonomous and does one thing extraordinarily well: controlling the mount. All the other task are delegates to other micros / computers.


UndCon
 

ZWO Asair and ZWO Asair PRO both runs on RPI


Dave Schwartz
 

If you hoped to use an example of a camera/guider controller on an RPi as to why a GoTo mount controller could be the same, I hope you also recognize the irony of that statement.

On 2020-11-12 5:37 a.m., UndCon wrote:

ZWO Asair and ZWO Asair PRO both runs on RPI


David Tremblay
 

Let the best tool do the task they are meant to do. If you need to control things from a raspberry pi there's a great project called indilib https://www.indilib.org/forum/development/1406-re-driver-onstep-lx200-like-for-indi.html



Le jeu. 12 nov. 2020 à 09:55, Dave Schwartz <Dave.Schwartz@...> a écrit :
If you hoped to use an example of a camera/guider controller on an RPi
as to why a GoTo mount controller could be the same, I hope you also
recognize the irony of that statement.

On 2020-11-12 5:37 a.m., UndCon wrote:
>
> ZWO Asair and ZWO Asair PRO both runs on RPI
>
>






Rafael Barberá Córdoba
 
Edited

ZWO Asair and ZWO Asair PRO both runs on RPI


But they don’t handle hardware directly. I’ve exactly the same setup with my RP4. Think about OnStep as the electronics integrated inside your mount. The ASIAir will connect to your mount, not substitute your mount’s electronics. 


Khalid Baheyeldin
 

On Thu, Nov 12, 2020 at 12:16 AM, <dhirajranger@...> wrote:
I was thinking of writing all the code from scratch in python or even reUse the C code but yeah the Arduino Libs used will be a major undertaking, I understand these are two very different universe but still wanted thoughts of people who have done this/tried this. from what i gather from all your views it will not be much of a port rather it will be parallel project from scratch. I was under impression some clever hack of running arduino code on  Rpi and pinMapping. Thanks everyone for your input
Two very different worlds: multiuser/multitasking systems (e.g. Linux) vs. embedded real time control (microcontrollers).

The former provides richer environments with many programs running at the same time, but can never run something
that requires microsecond timing, like what is required for motors in OnStep. The latter can do that and that is why we
use them.

For the same reason, you see RPi used alongside microcontrollers in various applications, but not replacing them. For
example, in the 3D printing world, you still have Marlin firmware running on a microcontroller board, because precise
timing and movement is required, but an RPi serves other functions via Octoprint.

The same thing happens in the OnStep world: we have a microcontroller board for motor control, and KStars with
Ekos/INDI, or Stellarmate or ASIAir on an RPi providing additional functions, but not replacing the microcontroller.