hjd1964 / onstepx Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Hello,
Yesterday I finished the hardware for OnStep (ESP32) controller and tried to build OnStepX for it. I used my favorite development tool PlatformIO (I don't have any relations to this company) to convert the Arduino project into PlatformIO project. It went without any trouble, I was able to build OnStepX with Visual Studio Code (PlatformIO is a plugin for VS Code).
I thought it could be beneficial for the OnStep project to migrate to PlatformIO for at least 2 reasons:
Regarding the 2., you can see an example in one of my ESP32 projects here ESP32Focuser. It uses Arduino platform and I developed it using PlatformIO and integrated into the Github Actions.
I configured it such a way, that every commit will be automatically build on Github cloud build agents, which is for free, and you will see if the build is successful or not (red cross or green check mark):
From what I know you would be able to develop both in VSCode with PlatformIO and Arduino IDE after that, but the build with Arduino would not be automatically checked (so it could be a case that the build on Github is successful, but locally you can't build with Arduino IDE because of some build errors).
Are you interested on this? If yes, I can help you by creating a pull request with the migration files and build pipeline configuration.
When OnStepX is connected to the ASCOM driver, the RA motor only slews west, regardless of the command (slew east/west).
Steps to reproduce:
Can't be reproduced with Stellarium when using native LX200 communication.
Can be reproduced with Stellarium when using ASCOM communication.
The protocol implementation of the LX200 command :SCMM/DD/YY# is returning "1#" (when the date is valid). This is causing a long delay to the Skysafari connection as commented in the Wiki, when configured to set time/location.
The original LX200 returns exactly the following string after receiving this command (the number of spaces matter) (the "s are not part or the return):
"1Updating planetary data. # #"
(As a side note, actually it gives two returns. First returns "1Updating planetary data. #" and after about 4 seconds,
returns " #" )
I've tested this using the following code in the file "src/telescope/mount/site/Site.commands.cpp":
---- line 138:
if (command[0] == 'S') {
// :SC[MM/DD/YY]# or :SC[MM/DD/YYYY]#
// Change local standard date
// Return: 0 on failure, 1 on success
if (command[1] == 'C') {
GregorianDate local = calendars.julianToGregorian(UT1ToLocal(getDateTime()));
if (strToDate(parameter, &local)) {
dateIsReady = true;
setDateTime(localToUT1(calendars.gregorianToJulian(local)));
updateTLS();
// --- modification: (the last '#' is added after this funcion)
sprintf(reply,"%s", "1Updating planetary data. # ");
*numericReply = false;
// --- End modification
} else *commandError = CE_PARAM_FORM;
} else
.........
This modification makes Skysafari connection happen almost immediately, solving the problem.
I tested this modification using Skysafari Pro version 7, setting telescope to "LX200 Classic", LXD650 and LXD55.
Using Skysafary Pro version 6 and telescope "LX200 Classic", there is still a delay of about 30 seconds, but using LXD650 or LXD55 works normally and the connection happens immediately.
./src/lib/ethernet/EthernetManager.cpp
backslash in place of slash for Unix build
#include "../tasks/OnTask.h"
Hello,
I've noticed some changes in the AXIS limits compared to OnStep. On the validate.h, I see you combined the AXIS1 limits for ALTAZ and EQ mounts, such that the largest sets of values is allowed to be specified (without checking if we have ALTAZ or EQ).
But for AXIS2, the validation values make it impossible to have sensible defaults on the config.h for an ALTAZ mount.
#if AXIS2_LIMIT_MIN < -360 || AXIS2_LIMIT_MIN > -90
#error "Configuration (Config.h): Setting AXIS2_LIMIT_MIN unknown, use value in the range -90 to -360."
#endif
#if AXIS2_LIMIT_MAX < 90 || AXIS2_LIMIT_MAX > 360
#error "Configuration (Config.h): Setting AXIS2_LIMIT_MAX unknown, use value in the range 90 to 360."
#endif
For ALTAZ I would want a min value of 0 degrees (or maybe somewhere around +10/-10), and a maximum of around 95/98.
Both fails the tests.
I would suggest:
#if AXIS2_LIMIT_MIN < -90 || AXIS2_LIMIT_MIN > -0
#error "Configuration (Config.h): Setting AXIS2_LIMIT_MIN unknown, use value in the range -90 to -360."
#endif
#if AXIS2_LIMIT_MAX < 0 || AXIS2_LIMIT_MAX > 90
#error "Configuration (Config.h): Setting AXIS2_LIMIT_MAX unknown, use value in the range 90 to 360."
#endif
Or maybe we can split the check depending on ALTAZ or EQ selections? I don't know what you would consider to be better.
I think that all the rest is good - it's just a setting validation issue. If I change the limits at run time, it all seems to work well.
reference to common.h instead of Common.h in:
src/lib/pushButton/PushButton.cpp
src/lib/serial/Serial_ST4_Master.cpp
src/lib/sound/Sound.cpp
src/lib/sound/Sound.h
--- a/src/lib/axis/motor/servo/filters/rolling.cpp
+++ b/src/lib/axis/motor/servo/filters/rolling.cpp
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------------------
// rolling average filter
-#include "Rolling.h"
+#include "rolling.h"
--- a/src/lib/axis/motor/servo/filters/windowing.cpp
+++ b/src/lib/axis/motor/servo/filters/windowing.cpp
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------------------
// windowing average filter
-#include "Windowing.h"
+#include "windowing.h"
I could not get the FYSETC S6 to compile until I removed the software serial section from the HAL_STM32F446.h file:
Once we get this working with Serial3, we will need to revisit this later for those who have it wired to the soft serial port.
diff --git a/src/HAL/HAL_STM32F446.h b/src/HAL/HAL_STM32F446.h
index b05ddad..5844eb0 100644
--- a/src/HAL/HAL_STM32F446.h
+++ b/src/HAL/HAL_STM32F446.h
@@ -29,24 +29,6 @@
#define SERIAL_C Serial3
#endif
-// Handle special case of using software serial for a GPS
-#if SerialGPS == SoftwareSerial2
- #define SWSERIAL_1
- #define SWSERIAL_1_RX PA3
- #define SWSERIAL_1_TX PA2
- #define SERIAL_GPS SWSerial1
-#endif
-
-/*
-// Handle special case of using software serial for a GPS
-#if SerialGPS == SoftwareSerial2
- #include <SoftwareSerial.h>
- SoftwareSerial SWSerialGPS(PA3, PA2); // RX2, TX2
- #undef SerialGPS
- #define SerialGPS SWSerialGPS
-#endif
-*/
-
// New symbol for the default I2C port ---------------------------------------------------------------
#include <Wire.h>
#define HAL_Wire Wire
My Config.h has:
#define TIME_LOCATION_SOURCE GPS
#define SERIAL_GPS Serial3
#define SERIAL_GPS_BAUD 9600
When I try to compile with GPS (for the S6), I get the following errors
sketch/src/telescope/mount/site/Site.cpp: In function 'void gpsCheck()':
sketch/src/telescope/mount/site/Site.cpp:24:40: error: 'elevation' was not declared in this scope
24 | tls.getSite(latitude, longitude, elevation);
| ^~~~~~~~~
sketch/src/telescope/mount/site/Site.cpp:34:7: error: 'dateIsReady' was not declared in this scope
34 | dateIsReady = true;
| ^~~~~~~~~~~
sketch/src/telescope/mount/site/Site.cpp:35:7: error: 'timeIsReady' was not declared in this scope
35 | timeIsReady = true;
| ^~~~~~~~~~~
exit status 1
main does not compile atm because first parameter for
StepDirMotor::move(const int16_t stepPin)
is int16_t in header and int8_t in implementation. Assuming that int16_t is correct this fixes the issue:
diff --git a/src/lib/axis/motor/stepDir/StepDir.cpp b/src/lib/axis/motor/stepDir/StepDir.cpp
index f211501..28c86bc 100644
--- a/src/lib/axis/motor/stepDir/StepDir.cpp
+++ b/src/lib/axis/motor/stepDir/StepDir.cpp
@@ -315,7 +315,7 @@ IRAM_ATTR void StepDirMotor::updateMotorDirection() {
}
#if STEP_WAVE_FORM == SQUARE
- IRAM_ATTR void StepDirMotor::move(const int8_t stepPin) {
+ IRAM_ATTR void StepDirMotor::move(const int16_t stepPin) {
if (direction > DirNone) return;
if (microstepModeControl == MMC_SLEWING_REQUEST && (motorSteps + backlashSteps) % homeSteps == 0) {
@@ -372,7 +372,7 @@ IRAM_ATTR void StepDirMotor::updateMotorDirection() {
takeStep = !takeStep;
}
- IRAM_ATTR void StepDirMotor::moveFF(const int8_t stepPin) {
+ IRAM_ATTR void StepDirMotor::moveFF(const int16_t stepPin) {
if (microstepModeControl >= MMC_SLEWING_PAUSE) return;
if (takeStep) {
@@ -385,7 +385,7 @@ IRAM_ATTR void StepDirMotor::updateMotorDirection() {
takeStep = !takeStep;
}
- IRAM_ATTR void StepDirMotor::moveFR(const int8_t stepPin) {
+ IRAM_ATTR void StepDirMotor::moveFR(const int16_t stepPin) {
if (microstepModeControl >= MMC_SLEWING_PAUSE) return;
if (takeStep) {
For your Information:
In file "src/telescope/addonFlasher/AddonFlasher.h" (Typo Common.h instead of common.h)
line 3 #include "../../Common.h"
In File src/Validate.h
Line 43 #if RETICLE_LED != OFF && RETICLE_LED != ON
it is in contradiction with comment in file Config.h
Line #define RETICLE_LED ON // OFF, n. Where n=0..255 (0..100%) activates feature sets default brightness. Option
I suppose default brightness is obsolete now
After making changes everything is running fine
Hope this helps
I enabled PPS using the new syntax.
#define TIME_LOCATION_PPS_SENSE HIGH
This is on an F303CC Blue Pill with the DS3231 and the 1Hz pin wired in.
But I don't see PPS on the SWS status page.
Would using LOW make a difference here?
OnStep10.18c, Smart Web Server 2.06j
I'm beginning a MaxPCB4 build. Both Teensy4.1 and WeMos D1 Mini Pro (SWS) are installed, running, and communicating. But no motor drivers yet. Relevant config:
#define STATUS_LED ON // OFF, Steady illumination if no error, blinks w/error code otherwise. Option
#define AXIS1_DRIVER_MODEL TMC5160 // OFF, Enter motor driver model (above) in both axes to activate the mount. <-Often
#define AXIS1_DRIVER_STATUS ON // OFF, ON, HIGH, or LOW. For driver status info/fault detection. Option
#define AXIS2_DRIVER_MODEL TMC5160 // OFF, Enter motor driver model (above) in both axes to activate the mount. <-Often
#define AXIS2_DRIVER_STATUS ON // OFF, ON, HIGH, or LOW. Polling for driver status info/fault detection. Option
#define STATUS_MOUNT_LED OFF // OFF, ON Flashes proportional to rate of movement or solid on for slews. Option
Because the TMC5160 drivers are not installed, SWS correctly reports "Driver Status: Comms failure (Fault)" for both axes. According to the Wiki ( https://onstep.groups.io/g/main/wiki/30067#STATUS_LED ), the status LED should blink 4 times per cycle if a motor driver initialization error was detected. It does not, it illuminates steadily beginning a few seconds after power up.
Guessing the code may only set the status LED if it receives an error from the stepper controller, but doesn't if it's unable to communicate with the controller. It should.
Hope to help with these
diff --git a/src/plugins/sample/Sample.h b/src/plugins/sample/Sample.h
index 54e5298..9f2a7e3 100644
--- a/src/plugins/sample/Sample.h
+++ b/src/plugins/sample/Sample.h
@@ -1,5 +1,5 @@
// Sample plugin
-#pragma onced
+#pragma once
class Sample {
public:
diff --git a/src/telescope/Telescope.command.cpp b/src/telescope/Telescope.command.cpp
index 54ffecf..74ffcbb 100644
--- a/src/telescope/Telescope.command.cpp
+++ b/src/telescope/Telescope.command.cpp
@@ -61,20 +61,20 @@ bool Telescope::command(char reply[], char command[], char parameter[], bool *su
#endif
// B - Reticule/Accessory Control
if (reticuleBrightness > 255-8) scale = 1; else
if (reticuleBrightness > 255-32) scale = 4; else
if (reticuleBrightness > 255-64) scale = 12; else
if (reticuleBrightness > 255-128) scale = 32; else scale = 64;
if (command[1] == '-') reticuleBrightness += scale; if (reticuleBrightness > 255) reticuleBrightness = 255;
if (command[1] == '+') reticuleBrightness -= scale; if (reticuleBrightness < 0) reticuleBrightness = 0;
analogWrite(RETICLE_LED_PIN, analog8BitToAnalogRange(reticuleBrightness));
if (reticleBrightness > 255-8) scale = 1; else
if (reticleBrightness > 255-32) scale = 4; else
if (reticleBrightness > 255-64) scale = 12; else
if (reticleBrightness > 255-128) scale = 32; else scale = 64;
if (command[1] == '-') reticleBrightness += scale; if (reticleBrightness > 255) reticleBrightness = 255;
if (command[1] == '+') reticleBrightness -= scale; if (reticleBrightness < 0) reticleBrightness = 0;
analogWrite(RETICLE_LED_PIN, analog8BitToAnalogRange(reticleBrightness));
#if RETICLE_LED_MEMORY == ON
nv.write(NV_TELESCOPE_SETTINGS_BASE, reticleBrightness);
#endif
There is a windows style path in Sense.cpp which causes build to fail on MacOSX.
This fixes the issue:
diff --git a/src/lib/sense/Sense.cpp b/src/lib/sense/Sense.cpp
index e1c617d..64ba4aa 100644
--- a/src/lib/sense/Sense.cpp
+++ b/src/lib/sense/Sense.cpp
@@ -4,7 +4,7 @@
// digital mode reads have basic hf EMI/RFI noise filtering
#include "Sense.h"
-#include "..\tasks\OnTask.h"
+#include "../tasks/OnTask.h"
SenseInput::SenseInput(int pin, int initState, int32_t trigger) {
this->pin = pin;
I want to use NTP server as date/time source for my ESP32/WiFi telescope (it's connected to my home router and have internet access).
I got it working with a small fix provided here #28
It seems to be a problem or misconfiguration.
Here is a verbose log from today, 26th of June:
MSG: Setup, HAL initalize
MSG: Setup, start system service task (rate 10ms priority 7)... success
MSG: Setup, start input sense polling task (rate 1ms priority 7)... success
MSG: NV, correct key found
MSG: Axis1, start monitor task (rate 5000us priority 1)... success
MSG: Axis1, reverting settings to Config.h defaults
MSG: Axis1, stepsPerMeasure=220015.79, reverse=ON
MSG: Axis1, backlash takeup frequency set to 0.10°/s
MSG: Axis1, adding any home and/or limit senses
MSG: StepDir1, pins step=18, dir=0, en=12
MSG: StepDir1, start task to move motor... success
MSG: StepDir1, init model TMC2130 SPI u-step mode 16X (goto mode OFF)
MSG: TmcDriver, init RSENSE=0.13
MSG: SoftSpi, init MOSI=13, SCK=14, CS=23, MISO=4
MSG: StepDir1, TMC Ihold=150mA, Irun=300mA, Igoto=300mA
MSG: StepDir1, TMC standstill automatic current calibration
MSG: StepDir1, sequencer homes every 1 step(s)
MSG: Axis2, start monitor task (rate 5000us priority 1)... success
MSG: Axis2, reverting settings to Config.h defaults
MSG: Axis2, stepsPerMeasure=220015.79, reverse=ON
MSG: Axis2, backlash takeup frequency set to 0.10°/s
MSG: Axis2, adding any home and/or limit senses
MSG: StepDir2, pins step=27, dir=26, en=SHARED
MSG: StepDir2, start task to move motor... success
MSG: StepDir2, init model TMC2130 SPI u-step mode 16X (goto mode OFF)
MSG: TmcDriver, init RSENSE=0.13
MSG: SoftSpi, init MOSI=13, SCK=14, CS=5, MISO=4
MSG: StepDir2, TMC Ihold=150mA, Irun=300mA, Igoto=300mA
MSG: StepDir2, TMC standstill automatic current calibration
MSG: StepDir2, sequencer homes every 1 step(s)
MSG: Mount, site get Latitude/Longitude from NV
MSG: TLS, start NTP monitor task (rate 5 min priority 7)... success
MSG: Site, falling back to Date/Time from NV
MSG: Mount, site start sidereal timer task (rate 10ms priority 0)... success
MSG: Mount, type GEM
MSG: Mount, reset at home and in standby
MSG: Mount, limits start monitor task (rate 100ms priority 2)... success
MSG: Mount, start guide monitor task (rate 2500us priority 3)... success
MSG: Mount, library allocated 204 catalog records
MSG: Mount, PEC allocated buffer 600 bytes
MSG: Mount, PEC start monitor task (rate 10ms priority 3)... success
MSG: Mount, start tracking monitor task (rate 1000ms priority 6)... success
MSG: Setup, start command channel A task (priority 5)... success
MSG: Setup, start command channel PIP1 task (priority 5)... success
MSG: Setup, start command channel PIP2 task (priority 5)... success
MSG: Setup, start command channel PIP3 task (priority 5)... success
MSG: Setup, start command channel IP task (priority 5)... success
MSG: Setup, start command channel Local task (priority 5)... success
MSG: WiFi, Master Pwd = password
MSG: WiFi, AP Enable = 0
MSG: WiFi, AP Fallback = 1
MSG: WiFi, AP SSID = OnStepX
MSG: WiFi, AP PWD = password
MSG: WiFi, AP CH = 7
MSG: WiFi, AP IP = 192.168.0.1
MSG: WiFi, AP GATEWAY = 192.168.0.1
MSG: WiFi, AP SN = 255.255.255.0
MSG: WiFi, Sta Enable = 1
MSG: WiFi, Station# = 1
MSG: WiFi, Sta DHCP En = 0
MSG: WiFi, Sta SSID = XXXXX
MSG: WiFi, Sta PWD = XXXXX
MSG: WiFi, Sta IP = XXXX
MSG: WiFi, Sta GATEWAY = 192.168.1.1
MSG: WiFi, Sta SN = 255.255.255.0
MSG: WiFi, Sta TARGET = 192.168.0.1
MSG: WiFi, starting Station
MSG: WiFi, initialized
MSG: WiFi, started IP commandServer on port 9996
MSG: WiFi, started IP commandServer on port 9997
MSG: WiFi, started IP commandServer on port 9998
MSG: WiFi, started IP commandServer on port 9999
MSG: TLS, transmit NTP Request
MSG: TLS, receive NTP Response
1656257544
MSG: TLS, next NTP query in 24 hours
MSG: cmdA = GC, reply = 06/24/22#
I added some debug to read what comes from NTP server, and 1656257544 is a Unix timestamp in seconds which seems to be correct (it's Sunday, 26 June 2022 15:32:24, you can check with https://www.epochconverter.com/).
But after it receives time, I request the date from the controller with :GC# command, and it responses 24th of June, last time I set date/time from the mobile app.
It seems like NTP does not set controller time. I tried to compare code with the GPS source, but everything looks good for me.
Could you please check what could be a problem?
As already mentioned in forum, compilation fails for esp32 unless the default parameter is removed.
diff --git a/src/lib/analog/AN_ESP32.h b/src/lib/analog/AN_ESP32.h
index 15f7cd6..5dcb047 100644
--- a/src/lib/analog/AN_ESP32.h
+++ b/src/lib/analog/AN_ESP32.h
@@ -6,7 +6,7 @@
#ifdef ESP32
// starts tone on the specified pin of frequency (Hz) for the duration (in ms)
- extern void tone(uint8_t pin, unsigned int frequency, unsigned long duration = 0);
+ extern void tone(uint8_t pin, unsigned int frequency, unsigned long duration);
// stops tone on the specified pin
extern void noTone(uint8_t pin);
New findings shown that this issue is actually related to ESP32 library version. I use MaxESP3 with 2.0.0 and MaxESP4 with 2.0.14 and these are issues I found:
With ESP32 board version 2.0.0:
PPS not working
SWS as a GPIO device compiles (didn't tested if it actually works)
With ESP32 board version 2.0.14:
PPS is working (only with PPS sense set to LOW)
When SWS is set as a GPIO device it doesn't compile at all (throwing an error)
In this thread was mentioned that slew rate can be set per axis separately (satellite tracking use case).
It seems to be a problem in the Guide.cpp startAxis1(...)
and startAxis2(...)
, where rateSelectToRate(GuideRateSelect rateSelect, uint8_t axis)
method is called without sending a second optional argument (axis), which forces the logic to use the slew rate from the axis1 for both axes.
Changing it to float rate = rateSelectToRate(rateSelect, 1);
in startAxis1() and float rate = rateSelectToRate(rateSelect, 2);
in startAxis2() fixes the problem.
If it can help improve ...
1) by defining PEC_STEPS_PER_WORM_ROTATION different from 0 I get the following compilation errors
/home/alain/Development/OnStepX/src/telescope/mount/pec/Pec.cpp: In member function 'void Pec::poll()':
/home/alain/Development/OnStepX/src/telescope/mount/pec/Pec.cpp:117:18: error: 'stepsPerSiderealSecondAxis1' was not declared in this scope
if (dist > stepsPerSiderealSecondAxis1*60.0 && wormIndexState != lastState && wormIndexState == true) {
^
/home/alain/Development/OnStepX/src/telescope/mount/pec/Pec.cpp:125:46: error: 'stepsPerSiderealSecondAxis1' was not declared in this scope
if (wormIndexSenseThisSecond && dist > stepsPerSiderealSecondAxis1) wormIndexSenseThisSecond = false;
^
Erreur de compilation pour la carte Teensy 3.5
2) Redefining handle most probably a typo in here
void tasksMonitor() {
uint8_t handle = tasks.getFirstHandle();
for (int i = 0; i < TASKS_MAX; i++) {
if (handle == 0) break;
tasks.refreshPeriod(handle);
// uint8_t handle = tasks.getNextHandle();
handle = tasks.getNextHandle();
}
}
In the last version of OnStepX it was possible to connect via bluetooth. Namely in "Extended.config" (#define SERIAL_BT_MODE SLAVE // OFF, use SLAVE to enable the interface (ESP32 only).
In the new version OnStep10.23f it is not there.
In file "Goto.command.cpp"
I believe it should be
case '6': reply[0] = "EWB"[preferredPierSide - 1]; reply[1] = 0; break; // preferred pier side
instead of
case '6': reply[0] = "EWB"[preferredPierSide - 10]; reply[1] = 0; break; // preferred pier side
Maybe I did not understand the code but at east for me it works, I receive the correct reply
Regards
+++ b/src/telescope/mount/site/Site.cpp
@@ -93,10 +93,10 @@ IRAM_ATTR void clockTickWrapper() { fracLAST++; }
#if TIME_LOCATION_SOURCE == NTP
void ntpCheck() {
tls->get(jd);
site.tls->get(jd);
In OnStepX/src/lib/encoder/Encoder.h
Line 4
#include "../../common.h"
should be
#include "../../Common.h"
This caused failure to compile on using the Arduino IDE V2.0.0 on 64-bit Raspberry Pi OS. Correcting the case of the include as shown above fixed that error.
Hello,
I think there is an issue with checking the tracking status inside Status.command.cpp.
if (mount.isTracking()) reply[i++] = 'N'; else reply[i++] = 'T';
The above code should be changed as below,
if (!mount.isTracking()) reply[i++] = 'N'; else reply[i++] = 'T';
Thanks.
Phil
It just hangs with following error:
In file included from C:\Users\vzr\Desktop\OnStepX\src\pinmaps\Models.h:91, from C:\Users\vzr\Desktop\OnStepX\src\Common.h:26, from C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.h:3, from C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp:3: C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp: In member function 'void AddonFlasher::run(bool)': C:\Users\vzr\Desktop\OnStepX\src\pinmaps\Pins.defaults.h:19:31: error: 'SERIAL_B_RX' was not declared in this scope #define SERIAL_PASSTHROUGH_RX SERIAL_B_RX ^~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp:82:79: note: in expansion of macro 'SERIAL_PASSTHROUGH_RX' SERIAL_PASSTHROUGH.begin(SERIAL_PASSTHROUGH_BAUD_DEFAULT, SERIAL_8N1, SERIAL_PASSTHROUGH_RX, SERIAL_PASSTHROUGH_TX); ^~~~~~~~~~~~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\pinmaps\Pins.defaults.h:19:31: note: suggested alternative: 'SERIAL_BT' #define SERIAL_PASSTHROUGH_RX SERIAL_B_RX ^~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp:82:79: note: in expansion of macro 'SERIAL_PASSTHROUGH_RX' SERIAL_PASSTHROUGH.begin(SERIAL_PASSTHROUGH_BAUD_DEFAULT, SERIAL_8N1, SERIAL_PASSTHROUGH_RX, SERIAL_PASSTHROUGH_TX); ^~~~~~~~~~~~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\pinmaps\Pins.defaults.h:20:31: error: 'SERIAL_B_TX' was not declared in this scope #define SERIAL_PASSTHROUGH_TX SERIAL_B_TX ^~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp:82:102: note: in expansion of macro 'SERIAL_PASSTHROUGH_TX' SERIAL_PASSTHROUGH.begin(SERIAL_PASSTHROUGH_BAUD_DEFAULT, SERIAL_8N1, SERIAL_PASSTHROUGH_RX, SERIAL_PASSTHROUGH_TX); ^~~~~~~~~~~~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\pinmaps\Pins.defaults.h:20:31: note: suggested alternative: 'SERIAL_BT' #define SERIAL_PASSTHROUGH_TX SERIAL_B_TX ^~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp:82:102: note: in expansion of macro 'SERIAL_PASSTHROUGH_TX' SERIAL_PASSTHROUGH.begin(SERIAL_PASSTHROUGH_BAUD_DEFAULT, SERIAL_8N1, SERIAL_PASSTHROUGH_RX, SERIAL_PASSTHROUGH_TX); ^~~~~~~~~~~~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp: In member function 'void AddonFlasher::flash()': C:\Users\vzr\Desktop\OnStepX\src\pinmaps\Pins.defaults.h:19:31: error: 'SERIAL_B_RX' was not declared in this scope #define SERIAL_PASSTHROUGH_RX SERIAL_B_RX ^~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp:106:52: note: in expansion of macro 'SERIAL_PASSTHROUGH_RX' SERIAL_PASSTHROUGH.begin(115200, SERIAL_8N1, SERIAL_PASSTHROUGH_RX, SERIAL_PASSTHROUGH_TX); ^~~~~~~~~~~~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\pinmaps\Pins.defaults.h:19:31: note: suggested alternative: 'SERIAL_BT' #define SERIAL_PASSTHROUGH_RX SERIAL_B_RX ^~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp:106:52: note: in expansion of macro 'SERIAL_PASSTHROUGH_RX' SERIAL_PASSTHROUGH.begin(115200, SERIAL_8N1, SERIAL_PASSTHROUGH_RX, SERIAL_PASSTHROUGH_TX); ^~~~~~~~~~~~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\pinmaps\Pins.defaults.h:20:31: error: 'SERIAL_B_TX' was not declared in this scope #define SERIAL_PASSTHROUGH_TX SERIAL_B_TX ^~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp:106:75: note: in expansion of macro 'SERIAL_PASSTHROUGH_TX' SERIAL_PASSTHROUGH.begin(115200, SERIAL_8N1, SERIAL_PASSTHROUGH_RX, SERIAL_PASSTHROUGH_TX); ^~~~~~~~~~~~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\pinmaps\Pins.defaults.h:20:31: note: suggested alternative: 'SERIAL_BT' #define SERIAL_PASSTHROUGH_TX SERIAL_B_TX ^~~~~~~~~~~ C:\Users\vzr\Desktop\OnStepX\src\telescope\addonFlasher\AddonFlasher.cpp:106:75: note: in expansion of macro 'SERIAL_PASSTHROUGH_TX' SERIAL_PASSTHROUGH.begin(115200, SERIAL_8N1, SERIAL_PASSTHROUGH_RX, SERIAL_PASSTHROUGH_TX);
As of the title. I think this would be a useful feature.
It is not entirely clear when homing is complete, since the last phase is quite slow.
The file "src/telescope/mount/site/Site.command.cpp" does not implement the following format for the :SG command:
:SGsHH.H#
that is used by programs like SkySafari. This returns un error to set the "number of hours added to local time" . This format is documented in the LX200 protocol docs.
The comment on the .cpp file does not mention the above format:
// :SG[sHH]# or :SG[sHH:MM]# (where MM is 00, 30, or 45)
// Set the number of hours added to local time to yield UT1
// Return: 0 failure, 1 success
I've tested using an LX200 telescope and all 3 formats (without the "[ ]") are allowed by the original firmware.
It seems that the method "Convert::tzToDouble()" in the file "src/lib/convert/Convert.cpp" should be changed to something like below to allow this format.
bool Convert::tzToDouble(double *value, char *hm) {
int16_t sign = 1;
int16_t hour, minute = 0;
double dHour = 0.0;
if (strlen(hm) < 1 || strlen(hm) > 6) return false;
// determine if the sign was used, skip any '+'
if (hm[0] == '-') { sign = -1; hm++; } else if (hm[0] == '+') hm++;
// if there is a float part, convert it:
charf = strchr(hm,'.');
if (f != NULL) {
if (!atof2(hm, &dHour, false)) return false;
value = sign(dHour);
} else {
// if there's a minute part convert it and mark the end of the hours string
char m = strchr(hm,':');
if (m != NULL) {
m[0] = 0;
m++;
if (strlen(m) != 2) return false;
if (!atoi2(m, &minute, false)) return false;
// only these exact minutes are allowed for time zones
if (minute != 45 && minute != 30 && minute != 0) return false;
}
if (!atoi2(hm, &hour, false)) return false;
*value = sign*(hour + minute/60.0);
}
Hi Howard,
Kinda strange that after flashing 10.18c WiFi stopped working in ESP32S. It was fine with 10.17c. And now I don't have a copy 10.17c to revert back. Can you please add it to the repo.
Here is the Verbose dump of 10.18c. It doesn't start the servers.
MSG: OnStepX, version 10.18c
MSG: OnStepX, MCU ESP32
MSG: OnStepX, pinmap MaxESP v4
MSG: Setup, HAL initalize
MSG: Setup, start system service task (rate 10ms priority 7)... success
MSG: Setup, start input sense polling task (rate 5ms priority 7)... success
MSG: NV, correct key found
MSG: Axis1, reverting settings to Config.h defaults
WRN: StepDirDriver::validateParameters(), Axis1 subdivisions OFF (assuming 1X)
MSG: Axis1, stepsPerMeasure=381933.67, reverse=OFF
MSG: Axis1, backlash takeup frequency set to 0.01 deg/s
MSG: Axis1, adding any home and/or limit senses
MSG: StepDir1, pins step=18, dir=0, en=SHARED
MSG: StepDir1, start task to move motor... success
MSG: StepDirDriver1, init model TMC2209/TMC2226 (UART) u-step mode OFF (assuming 1X) (goto mode OFF)
MSG: StepDirDriver1, TMC Ihold=150mA, Irun=300mA, Igoto=300mA
MSG: StepDirDriver1, TMC HW UART driver pins rx=39, tx=4, baud=460800bps
MSG: StepDirDriver1, TMC UART driver found
MSG: StepDir1, sequencer homes every 1 step(s)
MSG: Axis1, start monitor task (rate 10000us priority 1)... success
MSG: Axis2, reverting settings to Config.h defaults
WRN: StepDirDriver::validateParameters(), Axis2 subdivisions OFF (assuming 1X)
MSG: Axis2, stepsPerMeasure=1527849.26, reverse=OFF
MSG: Axis2, backlash takeup frequency set to 0.01 deg/s
MSG: Axis2, adding any home and/or limit senses
MSG: StepDir2, pins step=27, dir=26, en=SHARED
MSG: StepDir2, start task to move motor... success
MSG: StepDirDriver2, init model TMC2209/TMC2226 (UART) u-step mode OFF (assuming 1X) (goto mode OFF)
MSG: StepDirDriver2, TMC Ihold=150mA, Irun=300mA, Igoto=300mA
MSG: StepDirDriver2, TMC HW UART driver pins rx=39, tx=4, baud=460800bps
MSG: StepDirDriver2, TMC UART driver found
MSG: StepDir2, sequencer homes every 1 step(s)
MSG: Axis2, start monitor task (rate 10000us priority 1)... success
MSG: StepDirDriver1, TMC standstill automatic current calibration
MSG: StepDir1, driver powered down using secondary method
MSG: StepDirDriver2, TMC standstill automatic current calibration
MSG: StepDir2, driver powered down using secondary method
MSG: Mount, site get Latitude/Longitude from NV
MSG: Mount, site get Date/Time from NV
MSG: Mount, site start sidereal timer task (rate 10ms priority 0)... success
MSG: Mount, type GEM
MSG: Mount, reset at home and in standby
MSG: Mount, limits start monitor task (rate 100ms priority 2)... success
MSG: Mount, start guide monitor task (rate 5000us priority 3)... success
MSG: Mount, library allocated 175 catalog records
MSG: Mount, start tracking monitor task (rate 1000ms priority 6)... success
MSG: Setup, start command channel A task (priority 5)... success
MSG: Setup, start command channel B task (priority 5)... success
MSG: Setup, start command channel Local task (priority 5)... success
I've build a simple ESP32 board (pin compatible with MaxESP3, but only ESP32 and 2 TMC2130 SPI V3 from Bigtreetech installed).
I want to know how to enable StealthChop mode? I tried to set TMC2130S as AXIS1_DRIVER_MODEL and AXIS2_DRIVER_MODEL, but after a restart the tracking does not start and I see following log (DEBUG set to VERBOSE):
MSG: Setup, HAL initalize
MSG: Setup, start system service task (rate 10ms priority 7)... success
MSG: Setup, start input sense polling task (rate 1ms priority 7)... success
MSG: NV, correct key found
MSG: Axis1, start monitor task (rate 5000us priority 1)... success
MSG: Axis1, reverting settings to Config.h defaults
MSG: Axis1, stepsPerMeasure=220015.79, reverse=OFF
MSG: Axis1, backlash takeup frequency set to 0.10°/s
MSG: Axis1, adding any home and/or limit senses
MSG: StepDir1, pins step=18, dir=0, en=12
MSG: StepDir1, start task to move motor... success
WRN: StepDir1, incorrect model for current control, disabling current settings
MSG: StepDir1, init model TMC2130 legacy u-step mode 16X (goto mode OFF)
MSG: StepDir1, pins m0=13, m1=14, m2=23, decay=23
MSG: StepDir1, sequencer homes every 1 step(s)
MSG: Axis2, start monitor task (rate 5000us priority 1)... success
MSG: Axis2, reverting settings to Config.h defaults
MSG: Axis2, stepsPerMeasure=220015.79, reverse=OFF
MSG: Axis2, backlash takeup frequency set to 0.10°/s
MSG: Axis2, adding any home and/or limit senses
MSG: StepDir2, pins step=27, dir=26, en=SHARED
MSG: StepDir2, start task to move motor... success
WRN: StepDir2, incorrect model for current control, disabling current settings
MSG: StepDir2, init model TMC2130 legacy u-step mode 16X (goto mode OFF)
MSG: StepDir2, pins m0=13, m1=14, m2=5, decay=5
MSG: StepDir2, sequencer homes every 1 step(s)
MSG: Mount, site get Latitude/Longitude from NV
MSG: Mount, site get Date/Time from NV
MSG: Mount, site start sidereal timer task (rate 10ms priority 0)... success
MSG: Mount, type GEM
MSG: Mount, reset at home and in standby
MSG: Mount, limits start monitor task (rate 100ms priority 2)... success
MSG: Mount, start guide monitor task (rate 2500us priority 3)... success
MSG: Mount, library allocated 204 catalog records
MSG: Mount, set tracking sidereal
MSG: Mount, status start general status task (1s rate priority 4)... success
MSG: Axis1, enabled
MSG: Axis2, enabled
MSG: Mount, set date/time is unknown so limits are disabled
MSG: Mount, start tracking monitor task (rate 1000ms priority 6)... success
MSG: Setup, start command channel A task (priority 5)... success
MSG: Setup, start command channel B task (priority 5)... success
MSG: Setup, start command channel BT task (priority 5)... success
MSG: Setup, start command channel Local task (priority 5)... success
Here is the output when I set TMC2130 (without S)
MSG: Setup, HAL initalize
MSG: Setup, start system service task (rate 10ms priority 7)... success
MSG: Setup, start input sense polling task (rate 1ms priority 7)... success
MSG: NV, correct key found
MSG: Axis1, start monitor task (rate 5000us priority 1)... success
MSG: Axis1, reverting settings to Config.h defaults
MSG: Axis1, stepsPerMeasure=220015.79, reverse=OFF
MSG: Axis1, backlash takeup frequency set to 0.10°/s
MSG: Axis1, adding any home and/or limit senses
MSG: StepDir1, pins step=18, dir=0, en=12
MSG: StepDir1, start task to move motor... success
MSG: StepDir1, init model TMC2130 SPI u-step mode 16X (goto mode OFF)
MSG: TmcDriver, init RSENSE=0.13
MSG: SoftSpi, init MOSI=13, SCK=14, CS=23, MISO=4
MSG: StepDir1, TMC Ihold=350mA, Irun=700mA, Igoto=700mA
MSG: StepDir1, TMC standstill automatic current calibration
MSG: StepDir1, sequencer homes every 1 step(s)
MSG: Axis2, start monitor task (rate 5000us priority 1)... success
MSG: Axis2, reverting settings to Config.h defaults
MSG: Axis2, stepsPerMeasure=220015.79, reverse=OFF
MSG: Axis2, backlash takeup frequency set to 0.10°/s
MSG: Axis2, adding any home and/or limit senses
MSG: StepDir2, pins step=27, dir=26, en=SHARED
MSG: StepDir2, start task to move motor... success
MSG: StepDir2, init model TMC2130 SPI u-step mode 16X (goto mode OFF)
MSG: TmcDriver, init RSENSE=0.13
MSG: SoftSpi, init MOSI=13, SCK=14, CS=5, MISO=4
MSG: StepDir2, TMC Ihold=350mA, Irun=700mA, Igoto=700mA
MSG: StepDir2, TMC standstill automatic current calibration
MSG: StepDir2, sequencer homes every 1 step(s)
MSG: Mount, site get Latitude/Longitude from NV
MSG: Mount, site get Date/Time from NV
MSG: Mount, site start sidereal timer task (rate 10ms priority 0)... success
MSG: Mount, type GEM
MSG: Mount, reset at home and in standby
MSG: Mount, limits start monitor task (rate 100ms priority 2)... success
MSG: Mount, start guide monitor task (rate 2500us priority 3)... success
MSG: Mount, library allocated 204 catalog records
MSG: Mount, set tracking sidereal
MSG: Mount, status start general status task (1s rate priority 4)... success
MSG: Axis1, enabled
MSG: Axis2, enabled
MSG: Mount, set date/time is unknown so limits are disabled
MSG: Mount, start tracking monitor task (rate 1000ms priority 6)... success
MSG: Setup, start command channel A task (priority 5)... success
MSG: Setup, start command channel B task (priority 5)... success
MSG: Setup, start command channel BT task (priority 5)... success
MSG: Setup, start command channel Local task (priority 5)... success
It seems like TMC2130S does not initialize SPI at all, and basically it can't set required mode.
In the source code, I don't see where TMC2130S is implemented, all if (model == TMC2130)
does not check for TMC2130S
I attached my configs.
config.zip
Is the StealthChop supported at all, and if yes, how it should be configured?
From what I can see, at the moment AXIS2_HOME_DEFAULT (and AXIS1_HOME_DEFAULT) are set up so that they expect the user to use a value in radians.
It would be good, and more intuitive, imo, to modify the default value assignment such that the values are in degree, I think.
:SX42,1# is not successfully completing and won't sync properly.
Potential solution via programming via analogy. Assume the same conditions should be used for :SX42,1# as used in :SX44,12.34,9.876#
Line numbers are from release OnStepX-10.20a.zip.
In src/telescope/mount/Mount.command.cpp line 233 which was
if (e != CE_NONE) { *commandError = e; return true; }
should be replaced with
if (e != CE_NONE && e != CE_SLEW_ERR_IN_STANDBY && e != CE_SLEW_IN_SLEW) { *commandError = e; return true; }
assuming line 255 is correct.
Also, I assume that line 235 which is
if (isnan(encoderAxis1) || isnan(encoderAxis2) || syncFromOnStepToEncoders) { *commandError = CE_0; return true; }
should be replaced with
if ( isnan(encoderAxis1) ||
isnan(encoderAxis2) ||
syncFromOnStepToEncoders ||
(goTo.state != GS_NONE && goTo.stage != GG_NEAR_DESTINATION_WAIT) ||
guide.state != GU_NONE) { *commandError = CE_0; return true; }
Assuming that lines 258-262 are correct. Although this check was not causing my issue I assume the extra conditions are probably needed.
I have tried this on my local build and it does seem to resolve the initial issue.
Hi, All your changes work fine except the Backslash hereunder
---------------------- src/lib/serial/Serial_ST4_Slave.h ---------------------- line 24
-#include "....\Common.h"
+#include "../../Common.h"
Thanks for all the huge work you invest in OnStep
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.