Commit Graph

206 Commits

Author SHA1 Message Date
Mike Black W9MDB
5d3d35d7be Fix logic error in spid.c 2024-09-08 09:03:53 -05:00
Mike Black W9MDB
25ecaea63a Fix build on Linux 2024-08-28 16:45:59 -05:00
dernasherbrezon
3a09649816 Fix compilation on linux 2024-08-28 19:26:56 +01:00
dernasherbrezon
4d1148c1ba Add legal headers 2024-08-28 15:50:43 +01:00
dernasherbrezon
099cc7fc48 Implement initial skywatcher rotator
Use GOTO mode when setting position.
Use cache for CPR (Counts Per Revolution) because it is hardcoded for the motor
2024-08-27 23:41:01 +01:00
Mike Black W9MDB
5ba43ba00e Fix mingw compiles
https://github.com/Hamlib/Hamlib/issues/1597
2024-08-18 08:15:11 -05:00
Mike Black W9MDB
6e0aa59cc2 Add ROT_MODEL_SPID_ROT1PROG to priv allocation in spid.c -- fixes potential segfaults 2024-08-16 06:54:15 -05:00
Mike Black W9MDB
64518dac35 Fix possible segfault in spid.c 2024-08-15 16:10:11 -05:00
George Baltz N3GB
c28caa7a9c Use macros/pointers for rot->state references 2024-07-14 01:17:28 -04:00
George Baltz N3GB
d1520aa166 Fix other rotators that try to do I/O before open.
Get rid of possible infinite recursion.
2024-06-14 16:33:39 -04:00
George Baltz N3GB
81a8745fca Implement the first user of the deferred set_conf entries.
Testing with simrotorez shows the correct sequence of actions and
  correct commands being received.
2024-06-14 16:23:36 -04:00
Mike Black W9MDB
3549dfe22c Revert "Move rot_dummy to rotators/dummy -- in preparation for PSKRotator dummy device"
This reverts commit 205e03bc57.
2024-06-02 08:47:27 -05:00
Mike Black W9MDB
205e03bc57 Move rot_dummy to rotators/dummy -- in preparation for PSKRotator dummy device 2024-06-02 08:29:54 -05:00
Mike Black W9MDB
745e72a6cf Add
ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW
ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW
ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW
ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW
Supported by SPID rotators
2024-05-30 17:34:02 -05:00
George Baltz N3GB
9f997d799d Fix incorrect port read for elevation
Add missing port parameters for rotp2
Remove funky character(^B) from simrotorez.c so `file` and `more` think it
  is plain text.

Dunno if this works on the real H/W, but at least the simulator can get
  and set az/el position without errors.
2024-03-28 16:26:21 -04:00
George Baltz N3GB
8ff07c47f9 Finish rotators/ 2024-02-19 13:06:53 -05:00
George Baltz N3GB
f247ee2088 Convert first part of rotators/ 2024-02-19 13:06:53 -05:00
Mike Black W9MDB
e1f2342982 Promote all BETA to STABLE
Promot all ALPHA to BETA
2024-02-14 07:11:20 -06:00
Mike Black W9MDB
05033171c3 Change token_t to hamlib_token_t to avoid collsions with libbsm and others
https://github.com/Hamlib/Hamlib/issues/1469
2024-01-21 23:11:55 -06:00
Mike Black W9MDB
7334da6d89 Split AZ/EL request into two transactions for easycomm.c 2023-12-19 09:29:31 -06:00
Mike Black W9MDB
21cbd77047 Add retries in easycomm.c 2023-12-18 09:11:19 -06:00
Mike Black W9MDB
a3676e0e3b Improve error output in easycom.c to show message 2023-12-18 09:05:15 -06:00
Mike Black W9MDB
e267c62764 astyle files 2023-12-16 11:37:58 -06:00
Mike Black W9MDB
5dc55ff9e1 Fix some double entries 2023-12-12 12:11:31 -06:00
pdaderko
c0457a0d7b
Fixed functionality (AZ Mount Pro), added improvements
Updated code to work with current AZ Mount Pro firmware.
Current firmware uses serial at 115200.
Original code looked for # delimiter on responses, but not all responses end in #.  This caused the software to timeout, which caused slow response time, and in some cases returned a failure (including :MountInfo# used at open).  All responses have fixed length replies, so code updated to look at fixed length data rather than delimiter.
Added workarounds for a couple firmware bugs.
Minor cleanup.
2023-11-28 05:07:00 -05:00
Mike Black W9MDB
464fa3f478 Revert "Promote token_t to unsigned long long"
This broke several things -- have to do this inside kenwood.c instead
This reverts commit 01292b261f.
2023-10-21 12:39:47 -05:00
Mike Black W9MDB
01292b261f Promote token_t to unsigned long long
https://github.com/Hamlib/Hamlib/issues/1402
2023-10-19 23:35:20 -05:00
Mike Black W9MDB
9f053799e9 Fix indi build
d72127f29a (commitcomment-130010062)
2023-10-15 07:44:50 -05:00
Mike Black W9MDB
8d15c04727 Fix more cppcheck items 2023-10-14 12:01:41 -05:00
Mike Black W9MDB
534fe449a2 Fix more cppcheck items 2023-10-13 17:36:29 -05:00
Mike Black W9MDB
5ac1e50b80 Fix always true conditions found by cppcheck
https://github.com/Hamlib/Hamlib/issues/1351
2023-10-02 23:10:58 -05:00
Mike Black W9MDB
f00661a8ae Fix unused cppcheck warnings
https://github.com/Hamlib/Hamlib/issues/1351
2023-10-01 12:01:38 -05:00
Mike Black W9MDB
53855c868d Fix remaining cppcheck redundant warnings
https://github.com/Hamlib/Hamlib/issues/1351
2023-10-01 08:24:06 -05:00
Mike Black W9MDB
6e8d328fb1 Fix most of the redundant warning from cppcheck 2023-09-30 23:42:22 -05:00
torque
d049b90aa9
spid: flush serial input buffer before command send
This seems to take care of the log data pretty much entirely and is
possibly a much simpler alternative solution to the previous two
commits. However, for full robustness, I think it makes sense to keep
all three of these changes together. Also, it's entirely possible that
this approach introduces a performance regression: I haven't
particularly looked at how the buffer flushing is implemented, but if
it ends up doing looped reads with a timeout, this could slow down
command processing for the SPID object significantly. Since I've only
tested this through the command line interface, I have not taken a
close look at performance.
2023-08-22 17:25:53 -07:00
torque
ccab50a7df
spid: account for another type of debug message
When the settings are saved via the front panel on the MD-01, the
following debug messages are printed on COM 0:

    thread_motionController: settings changed!\r\n
    thread_protocols: settings changed!\r\n

Notably, because these aren't timestamped the way the other debug
messages are, they were missing the our debug message sieve and causing
protocol errors. Address this by treating anything that doesn't start
with the ROT2PROG start byte ('W') as a log frame.
2023-08-22 17:25:53 -07:00
torque
470c71dd93
spid: handle a control stream containing log packets
I have an MD-01 controller running firmware 2.0.237 that is connected
to the computer via the COM0 DB9 port. When it receives a control
command to move the rotator, it prints debug logs to the serial output
that look like this:

  input:
    W3600\x0A4500\x0A\x2F\x20

  output:
    W\x03\x06\x00\x00\x0A\x04\x05\x01\x00\x0A\x20
    287925671: in motion\r\n
    287925673: Change motion state M0 to mcsStart\r\n
    287925678: GO  A 0.000000 0.000000 t ---\r\n
    287925680: in motion\r\n
    287925683: Change motion state M1 to mcsStart\r\n
    287925686: GO  E 90.000000 91.000000 t ---\r\n
    287925690: distance to go M0 too small. End.\r\n
    287925694: Change motion state M0 to mcsStopped\r\n
    287925698: Stop on motor 0 on angle 0.000000\r\n
    287925703: Change motion state M1 to mcsRunning\r\n
    287926610: distance to go M1 too small. End.\r\n
    287926613: Change motion state M1 to mcsStopped\r\n
    287926617: Stop on motor 1 on angle 90.000000\r\n

Note that the response frame is not necessarily present in an specific
order relative to the log messages: I have seen it come after the logs
as well. Because the current implementation just slurps up response
bytes without checking the framing or anything, as soon as any of this
log data enters the command stream, all subsequent commands will read
completely bogus responses.

Regardless of whether it's due to a misconfiguration, a weird artifact
of the firmware, or something more sinister, the MD-01 is awkwardly
interspersing its normal fixed-size-frame response with these
line-based log messages. As shown above, the log messages appear to be
consistently of the format <timestamp>: <message>\r\n, where
<timestamp> is some kind of integer timestamp (possibly relative to
unit boot) and <message> is an ASCII string.

Due to poor(?) design decisions by the protocol designers, the frame
start and end bytes are both printable ASCII characters ('W' and ' '
respectively) and the MD-01 response frame contains no other
validation information (such as a CRC), which means that a valid log
line could fairly easily contain a character sequence that is
indistinguishable from a valid response frame, without actually being
a valid response frame.

However, since the log messages appear to be reasonably strictly
structured, we can make a small number of assumptions that will allow
us to reliably separate response frames from log lines without having
to fall back on a heuristic-based parsing strategy. These assumptions
are as follows:

1. A log line will always begin with an ASCII character in the range
   [0-9], none of which are the frame start byte.
2. A log line will never contain \r\n in the middle of the line (i.e.
   multi-line log messages do not exist). This means a log "frame" will
   always be of the form [0-9]<anything>\r\n.
3. The controller will not emit a response frame in the middle of a log
   line.
4. The operating system's serial port read buffer is large enough that
   we won't lose data while accumulating log messages between commands.

Provided the above assumptions are true, a simple state machine can be
used to parse the response by treating the log lines as a different
type of frame. This could be made much more robust by applying
additional heuristics for specific packets (e.g. get_position has some
reasonably strict numerical bounds that could be used to sanity check
the contents of the reply frame).
2023-08-22 17:25:53 -07:00
Mike Black W9MDB
dad55ef148 astyle files getting ready for WSJT-x-2.7.0rc1 2023-05-08 07:37:13 -05:00
Mike Black W9MDB
5d130be05c Fix another mingw compile warning on rotorez.c 2023-05-07 16:44:43 -05:00
Mike Black W9MDB
5648e587a8 Fix mingw compile warning on rotorez.c 2023-05-07 16:42:44 -05:00
Mike Black W9MDB
1e9ecb079a Fix RT21 2nd device for elevation
https://github.com/Hamlib/Hamlib/issues/1257
https://github.com/Hamlib/Hamlib/issues/1258
2023-04-30 17:04:34 -05:00
Mike Black W9MDB
bbda209fc0 Add park to rotorez
https://github.com/Hamlib/Hamlib/issues/1257
2023-03-28 11:53:00 -05:00
Daniele Forsi IU5HKX
2db37fe7db Fix typos 2023-03-26 11:01:51 +02:00
Matthew J. Wolf
a64bb4fc7d Duplicated other changes made to easycom 2023-03-10 14:28:43 -05:00
Matthew J. Wolf
631a7a5faa change from commit cdb3a60 to master 2023-03-10 13:48:29 -05:00
Matthew J. Wolf
16f03dcdfb Type casting from easycom 2023-03-10 13:40:37 -05:00
Matthew J. Wolf
f5c26bf235 Inital add of rotator saebrtrack 2023-03-10 13:03:14 -05:00
Daniele Forsi IU5HKX
cdb3a60f02 [rotators] Fix includes 2023-02-16 19:08:24 +01:00
Daniele Forsi IU5HKX
b6ec70fcb2 [rotators] Remove unused include of config.h 2023-02-14 19:57:06 +01:00
Mike Black W9MDB
14016be817 Some updates to fix rc2800 operations
be72027f9a
2023-01-28 12:42:14 -06:00