Giter VIP home page Giter VIP logo

remoterotator's Introduction

RemoteRotator

Build Status Go Report Card MIT licensed Coverage Status Downloads

Alt text

remoteRotator is a command line application that makes your azimuth / elevation antenna rotators available on the network. It is available for Linux/Windows/MacOS and is written in the programming language Go.

To get a first impression, you're welcome to play with our public demo at demo.rotator.shackbus.org.

Supported Rotators

remoteRotator supports the following protocols:

This is a list of rotator controllers that are known to work well with remoteRotator:

If your rotator controller is not supported, feel free to open an issue. It is relatively easy to add more rotator controllers / protocols.

Supported Transportation Protocols

  • NATS (preferred)
  • HTTP + Websockets + MDNS (will be deprecated)

License

remoteRotator is published under the permissive MIT license.

Download

You can download a tarball / zip archive with the compiled binary for

  • MacOS (amd64)
  • Linux (arm,386,amd64)
  • Windows (386,amd64)

from the releases page.

remoteRotator works well on SoC boards like the Raspberry / Orange / Banana Pis. The application is just a single executable.

Dependencies

remoteRotator does not have any runtime dependencies.

Getting started

remoteRotator provides a series of nested commands and flags.

$ ./remoteRotator
Network interface for Rotators

Usage:
  remoteRotator [command]

Available Commands:
  enumerate   discover and list all available rotators on the network
  help        Help about any command
  server      remoteRotator Server
  version     Print the version number of remoteRotator
  web         webserver providing access to all rotators on the network

Flags:
      --config string   config file (default is $HOME/.remoteRotator.yaml)
  -h, --help            help for remoteRotator

Use "remoteRotator [command] --help" for more information about a command.

So let's fire up a remoteRotator server for your rotator:

First, identify the serial port to which your rotator is connected. On Windows, this will be something like COMx (e.g. COM3), on Linux / MacOS it will be a device in the /dev/ folder (e.g. /dev/ttyACM0).

All parameters can be set either in a config file (see below) or through pflags. To get a list of supported flags for the lan server, execute:

$ ./remoteRotator server lan --help
The lan server allows you to expose a rotator on your local area network.
By default, the rotator will only be listening on the loopback adapter. In
order to make it available and discoverable on the local network, a network
connected adapter has to be selected.

remoteRotator supports access via TCP, emulating the Yaesu GS232A protocol
(disabled by default) and through a web interface (HTTP + Websocket).

You can select the following rotator types:
1. Yaesu (GS232 compatible)
2. Dummy (great for testing)

remoteRotator allows to assign a series of meta data to a rotator:
1. Name
2. Azimuth/Elevation minimum value
3. Azimuth/Elevation maximum value
4. Azimuth Mechanical stop

The metadata enriches the rotator representation in the web interface 
for example by colorizing the rotator range or indicating the mechanical stop.

Usage:
  remoteRotator server lan [flags]

Flags:
      --azimuth-max int        metadata: maximum azimuth (in deg) (default 360)
      --azimuth-min int        metadata: minimum azimuth (in deg)
      --azimuth-stop int       metadata: mechanical azimuth stop (in deg)
  -b, --baudrate int           baudrate (default 9600)
      --discovery-enabled      make rotator discoverable on the network (default true)
      --elevation-max int      metadata: maximum elevation (in deg) (default 180)
      --elevation-min int      metadata: minimum elevation (in deg)
      --has-azimuth            rotator supports Azimuth (default true)
      --has-elevation          rotator supports Elevation
  -h, --help                   help for lan
      --http-enabled           enable HTTP Server (default true)
  -w, --http-host string       Host (use '0.0.0.0' to listen on all network adapters) (default "127.0.0.1")
  -k, --http-port int          Port for the HTTP access to the rotator (default 7070)
  -n, --name string            Name tag for the rotator (default "myRotator")
      --pollingrate duration   rotator polling rate (default 1s)
  -P, --portname string        portname / path to the rotator (e.g. COM1) (default "/dev/ttyACM0")
      --tcp-enabled            enable TCP Server
  -u, --tcp-host string        Host (use '0.0.0.0' to listen on all network adapters) (default "127.0.0.1")
  -p, --tcp-port int           TCP Port (default 7373)
  -t, --type string            Rotator type (supported: yaesu, dummy (default "yaesu")

Global Flags:
      --config string   config file (default is $HOME/.remoteRotator.yaml)

So in order to launch remoteRotator on Windows with a Yaesu rotator connected at COM3 an having the web HTTP server listening on your local network, we would call:

$ remoteRotator.exe server lan -w "0.0.0.0" -P "COM3" -t yaesu
no config file found
2017/12/08 16:50:25 added rotator (myRotator)
2017/12/08 16:50:25 Listening on 0.0.0.0:7070 for HTTP connections

Connecting via TCP / Telnet

If you have an application (e.g. arsvcom or pstrotator) that can talk to a Yaesu compatible rotator, you can point that application to remoteRotator's built-in TCP server (although disabled by default).

Let's start a dummy rotator instance on Linux and enable the build-in TCP server:

$ ./remoteRotator server lan -t dummy --tcp-enabled
no config file found
2017/12/08 16:50:25 added rotator (myRotator)
2017/12/08 16:50:25 listening on 127.0.0.1:7070 for HTTP connections
2017/12/08 16:50:25 listening on 127.0.0.1:7373 for TCP connections
2017/12/08 16:50:25 discovery disabled; the HTTP server must listen on an accessible network interface (e.g. 0.0.0.0)

For testing, we connect directly via telnet:

$ telnet localhost 7373
Trying ::1...
Connected to localhost.
Escape character is '^]'.

?>C
+0303
C2
+0303+0000
M310
+0303+0000
+0304+0000
+0305+0000
+0306+0000
+0307+0000
+0307+0000
+0308+0000
+0309+0000
+0310+0000

Web Interface

Alt text

A more comfortable way of accessing the rotator is through a web Interface. You can specify the host and port in the settings above, or deactivate the built-in webserver if you don't need it.

The red arrow indicates the heading of the rotator and the yellow arrow indicates the preset value to which the rotator will turn. The yellow arrow disappears when the desired direction has been reached.

The dotted red line indicates the mechanical stop of the rotator. A green arc segment indicates a limited turning radius for this rotator. A blue arc segment indicates the mechanical overlap supported by this rotator. These indicators are just visual helpers and are configurable through command line flags or in the config file.

Web Interface (Aggregator)

Alt text

If you have multiple rotators, you might want to use the dedicated aggregation web server. The following example starts the webserver on port 6005 and listens on all network interfaces.

$ remoteRotator web -w "0.0.0.0" -k 6005

The Webserver automatically discovers the available remoteRotator instances in your local network and adds them from the web interface. Depending on which transport you have chosen, the discovery process is either done through MDNS (lan) or NATS. The discovery functionality doesn't require any configuration.

Config file

The repository contains an example configuration file. By convention, it is called .remoteRotator.[yaml|toml|json] and is located by default either in the home directory or the directory where the remoteRotator executable is located. The format of the file can either be in yaml, toml, or json.

The first line after starting remoteRotator will indicate if / which config file has been found.

If you have several rotators, you have to create a configuration file for each of them and specify them with the --config flag.

Priority:

  1. Pflags (e.g. -p 4040 -t dummy)
  2. Values from config file
  3. Default values

Behaviour on Errors

If an error occurs from which remoteRotator can not recover, the application exits. This typically happens when the connection with the rotator has been lost or if the rotator is not responding anymore. It is recommended to execute remoteRotator as a service under the supervision of a scheduler, like systemd.

Bug reports, Questions & Pull Requests

Please use the Github Issue tracker to report bugs and ask questions! If you would like to contribute to remoteRotator, pull requests are welcome! However please consider providing unit tests with the PR to verify the proper behavior.

If you file a bug report, please include always the version of remoteRotator you are running:

$ ./remoteRotator version
copyright Tobias Wellnitz, DH1TW, 2020
remoteRotator Version: v0.6.0, darwin/arm64, BuildDate: 2021-04-18T03:35:42+02:00, Commit: 00fe466

Documentation

The auto-generated documentation can be found at pkg.go.dev.

How to build

To compile remoteRotator from the sources, you need to have Go >= 1.16 installed and configured.

Install the dependencies if you haven't already

$ sudo apt-get install git build-essential upx

Download, prepare and compile remoteRotator under Linux/MacOS:

$ mkdir -p $GOPATH/src/github.com/dh1tw && cd "$_"
$ git clone https://github.com/dh1tw/remoteRotator.git
$ cd remoteRotator
$ go get ./...
$ make install-deps
$ make generate
$ make

How to execute the tests

All critical packages have their own set of unit tests. The tests can be executed with the following commands:

$ cd $GOPATH/src/github.com/dh1tw/remoteRotator
$ go test -v -race ./...

The data race detector might not be available on all platforms / operating systems.

remoterotator's People

Contributors

dependabot[bot] avatar dh1tw avatar ea4tx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remoterotator's Issues

Moving Azimuth and Elevation simultaneously causes jitter in the web UI

Whenever either azimuth or elevation are updated, a struct containing both (azimuth AND elevation) are sent to the clients connected through the web server. This causes under some circumstances jitter in the (red) direction needle since the values are not always exactly synchronized.

This behavior can be reproduced with the dummy rotator model.

Probably it would make more sense to only send the values which have actually changed to the connected Web browsers.

remoteRotator=RCI-USB-Ham-M Series 5 integration - relay chattering and failed fuse in Ham-M

I solved the earlier connectivity issues and now can display the rotor control from the web page.

I blew a fuse on the HAM-M when remoteRotator/RCI-USB continued to request CW movement when the motor was fully CW. This is a old Ham-M series 5that is North centered - 0 degrees. The rotor operates normally when used with the RCI-USB panel controls.

The rotor was set to 90 degrees on old controller and RCI-USB matched that heading. When I moved the pointer to about 45 degrees (CCW motion), the relays in the RCI-USB started chattering quickly and the meter lights on the HAM-M controller flashed quickly (see video). I interrupted the power to the RCI-USB to avoid blowing another fuse in the Ham_M

I suspect the problem is with the ars1.toml azimuth limits. The CCW limit on my controller is -180 degrees and CW limit is +180 degrees = centered N 0 or 360 degrees. (remoteRotator would not accept negative values so I set azimuth-min= 180 and azimuth=180.)

I've attached Pablos default ars1.toml configuration. I have 90MB MB compressed video showing the behavior and will send you a link when I can move it to a cloud location.

Thanks for you insight and expertise.

Jim

Elevation not supported (K3NG interface)

Hi Tobias,
RemoteRotator is working great using K3NG interface for controlling azimuth, however elevation is not working.
K3NG interface is expecting GS232 command Wxxx yyy (3-digit x:azimuth y:elevation), which seems not to be supported.

Could you please support the "W" command for elevation control? Would be great!

73, Thomas

Hamlib support

Hamlib is an Open Source project that implements common API for controlling different HAM radio setups that, well, can be controlled by software. Including rotators. It would be quite simple to add hamlib support to remoteRotator. If only I had some skills in Go, I would've implemented it myself. Unfortunately, I know nothing about it.

check if rotator already exists on the network

On startup of a rotator (remoteRotator server lan --name=myRotator) it should be checked that this rotator does not exist on the lan. Otherwise there will be collisions between the two rotator instances.

This applies only the the lan transport option. This check is already included in the nats transport.

install remoteRotator in $GOPATH/bin?

i notice that remoteRotator is not installed in $GOPATH/bin. is this intentional? seems natural to install in $GOPATH/bin. not critical issue, just means another step when upgrading code.

Support for more rotator features

I noticed a couple of limitations that prevent using remoteRotator with our rotors:

  • Support <1° precision (important for e.g. EME work); azimuth/elevation appear to currently be represented by integers.
  • Support for continuous rotation rotors; it looks like you can't avoid specifying an azimuthStop.
  • Support for velocity commands.
  • Support for brake on/off as a separate command (i.e. the full set of possible states for each axis are "position servo", "velocity servo", "brake", and "coast"). This could also be represented as "velocity servo with velocity=0" and not have a separate state, but maybe there are some rotors for which that is different.

Not all rotors support all of these options, of course, but we have rotors that need some combination of each of them.

Not knowing about remoteRotator, we also implemented our own rotator library in Go, at https://github.com/w1xm/rci_interface/blob/master/rci/rci.go, if you'd like to see how we solved these problems.

missing directory "dh1tw" component in section "How to build" in readme.md

In the section "How to build" of readme.md, the directory component appears to be missing
the component "dh1tw". The line

cd $GOPATH/src/github.com/remoteRotator

i believe should say

cd $GOPATH/src/github.com/dh1tw/remoteRotator

i have tested with GOPATH=$HOME/go and no value for GOPATH. the golang version is go1.13.5 under both mac catalina and high sierra.

Add Authentication & preset buttons

Hi Tobi,

I'm using the remoteRotator since Dec/2017 and I'm really excited about it. It's running 100% so congrats for a great project! I use it with a Raaspberry Pi (Raspbian Stretch).

It could be very interesting to incluse some features to the remoteRotator proyect. Some of them are:

  • Add a Login menu option. In some cases where the remoteRotator is available on internet, it could be great to be logged before to get the rotor(s) control.

  • Add a Stop button. So you can stop any previous command.

  • Add a Preset (4 or 8 presets). So if this option is enabled it will be displayed some several buttons with those presets. The user can define the button label (i.e. "North", "USA", "Japan") and the angle for the preset (0, 300, 30, ...)

73's Pablo EA4TX

Yaesu G-5500

Hello Tobias.

RemoteRotator is great idea, interesting and user-friendly program.
But when I run remoteRotator in Windows XP or Windows 8 after 30 seconds, I get the error:

"serial port read error <'Rotator on COM3'>: multiple Read calls return no data or error
panic: close of nil channel"

Could you please solve this problem?

I use version 0.4.1. Thank you!

remoterotator

WebUI: occasionally rotators disappear randomly

Using remoteRotator version v0.5.2 using nats as the messaging broker.

Symtoms:
Randomly a rotator disappears and reappears from the WebUI within the same moment. The log states:

2020-04-20 00:45:52.664425 I | removed rotator (Tower2)
2020-04-20 00:45:52.799524 I | added rotator (Tower2)

window settings

This program is a very helpful mastery. I just can't find a way to present two rotors on one page. I can, of course, display it, but only in the form as in the attachment. How to make them simultaneously in the "foreground". Can you add this to the documentation of the program?
Of course, I mean working with 2 rotors.
Best 73! Pawel SQ5LTL
Zrzut ekranu 2023-06-1 o 11 06 26

Linux and OSX binaries should be executable

In the process of migrating the CI pipeline from Travis-CI to Github Actions the release process was also ajusted. Instead of publishing tarballs for Posix based systems, all binaries are now packed into a zip file. However with the current release (v0.5.1) the binaries are not marked as executables after unzipping.

The files have to be marked as executables on the local system chmod +x ./remoteRotator.

Modify the steps in the CI pipeline and ensure that the zipped binaries are actually executable.

yaesu output

hallo,
fantastic job !!!
I think that to have more compatibility the output string should be only +0000 and not +0000+0000 if only azimuth
is correct ??

Support GS232B Protokoll and CGAntenna RTC-200

Hi Tobias,

great application, really like the easy and clean webinterface.

I am setting up a remote station for our club and would like to use the remoteRotator there.
Our setup consists of a Yaesu G-1000DXC, a CG Antenna RTC-200 USB Interface, remoteRotator is running on a RPi.

I am able to connect to the deivce and turn the antenna, but there is no feedback about the beam direction.
Could you add the device to the supported interfaces, please?

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.