しばらく更新していない間に、OnStepXのバージョンがかなり上がりました。
Config.hのバージョンも上がり(本当に長い間ブログ放置してました)、ちょっと設定の仕方も変わっているので、その3を書くことにしました。以前書いたものはこちらです。
OnstepXの最新ヴァージョンをダウンロードします。ダウンロードしたファイルを解凍します。解凍されたフォルダ名をOnStepXとします(※inoファイル名とそれを含むフォルダ名は同一にする必要)。ヴァージョンごとに管理したい場合は、ヴァージョン名のフォルダを作り、その中に先ほどのOnStepXフォルダを入れます。
Config.hファイルを設定します。
以下、Config.hの序盤部分です。
/* ---------------------------------------------------------------------------------------------------------------------------------
* Configuration for OnStepX
*
* For more information on setting OnStep up see http://www.stellarjourney.com/index.php?r=site/equipment_onstep
* and join the OnStep Groups.io at https://groups.io/g/onstep
*
* *** Read the compiler warnings and errors, they are there to help guard against invalid configurations ***
*
* ---------------------------------------------------------------------------------------------------------------------------------
* ADJUST THE FOLLOWING TO CONFIGURE YOUR CONTROLLER FEATURES ----------------------------------------------------------------------
* <-Req'd = always must set, <-Often = usually must set, Option = optional, Adjust = adjust as req'd, Infreq = infrequently changed
*/
// Parameter Name KeenOne-LV8729-9289-JP Default Notes Hint
// =================================================================================================================================
// CONTROLLER ======================================================================================================================
#define HOST_NAME "KEENONE_HD001" // "OnStep", Hostname for this device up to 16 chars. Adjust
#define DRIVER_TMC_STEPPER
// PINMAP ------------------------------------------------- see https://onstep.groups.io/g/main/wiki/Configuration_Controller#PINMAP
#define PINMAP MaxESP4 // OFF, Choose from: MiniPCB, MiniPCB2, MaxPCB4, MaxESP4, MaxSTM3, FYSETC_E4, <-Req'd
// BTT_SKR_PRO, etc. Other boards and more info. in ~/src/Constants.h
// SERIAL PORT COMMAND CHANNELS --------------------- see https://onstep.groups.io/g/main/wiki/Configuration_Controller#SERIAL_PORTS
#define SERIAL_A_BAUD_DEFAULT 9600 // 9600, n. Where n=9600,19200,57600,115200,230400,460800 (common baud rates.) Infreq
#define SERIAL_B_BAUD_DEFAULT 9600 // 9600, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments. Infreq
#define SERIAL_B_ESP_FLASHING OFF // OFF, ON Upload ESP8266 WiFi firmware through SERIAL_B with :ESPFLASH# cmd. Option
#define SERIAL_C_BAUD_DEFAULT OFF // OFF, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments. Infreq
#define SERIAL_D_BAUD_DEFAULT OFF // OFF, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments. Infreq
#define SERIAL_E_BAUD_DEFAULT OFF // OFF, n. Baud rate as above. See (src/pinmaps/) for Serial port assignments. Infreq
#define SERIAL_RADIO WIFI_ACCESS_POINT // OFF, Use BLUETOOTH or WIFI_ACCESS_POINT or WIFI_STATION (ESP32 only.) Option
- 13行目【任意】value を、後でConfig.hファイルを識別するために、固有の名前を付けておきます。後々ファイルが増えていくとどれがどれだか分からなくなる時があります。名前をつけておくと便利です。今回はKeenOne-LV8729-9289-JP(機材名-ドライバ名-減速比-WEBSEVERの言語)としました。
- 17行目 最近変わった部分だと思うのですが、HOST_NAME(ホスト名)を16文字以内で設定します。ここで設定したホスト名は、アクセスポイントモードでSSIDになったり、Bleutoothの接続先になります。今回は”OnStepX”を”KEENONE_HD001″に変更しました。
- 22行目 PINMAPはご自身の環境に合わせて変更してください。
- 32行目 お自身の接続環境に合わせて変更します。WIFI_ACCESS_POINTを利用する場合、WIFI_ACCESS_POINT、はBluetoothを利用する場合はBLUETOOTH、家のWIFI等に接続する場合は、WIFI_STATIONに変更します。
それ以降は、その2で書いた内容で設定してください。
次にExtended.config.hを設定します。
/* ---------------------------------------------------------------------------------------------------------------------------------
* Extended configuration for OnStepX INFREQUENTLY USED options
*
* For more information on setting OnStep up see http://www.stellarjourney.com/index.php?r=site/equipment_onstep
* and join the OnStep Groups.io at https://groups.io/g/onstep
*
* *** Read the compiler warnings and errors, they are there to help guard against invalid configurations ***
*
* ---------------------------------------------------------------------------------------------------------------------------------
* ADJUST THE FOLLOWING TO CONFIGURE YOUR CONTROLLER FEATURES ----------------------------------------------------------------------
* <-Req'd = always must set, <-Often = usually must set, Option = optional, Adjust = adjust as req'd, Infreq = infrequently changed
*/
// Parameter Name 192,168,30,256(IPアドレス変更) Default Notes Hint
// =================================================================================================================================
// CONTROLLER ======================================================================================================================
// DEBUG ---------------------------------------------------------------------------------------------------------------------------
// Enables additional debugging and/or status messages on the specified SERIAL_DEBUG port (be sure to disable when done!)
// Note: The SERIAL_DEBUG port is often (almost always) attached to the same SERIAL_A port so it cannot be used for normal
// LX200 protocol communications. If this is the case set both to the same (faster) baud rate specified below.
#define DEBUG OFF // OFF, Use ON for background error messages only, use VERBOSE for all Infreq
// error and status messages, use CONSOLE for VT100 debug console,
// or use PROFILER for VT100 task profiler.
#define DEBUG_SERVO OFF // OFF, n. Where n=1 to 9 as the designated axis for logging servo activity. Option
#define DEBUG_ECHO_COMMANDS OFF // OFF, Use ON or ERRORS_ONLY to log commands to the debug serial port. Option
#define SERIAL_DEBUG Serial // Serial, Use any available h/w serial port. Serial1 or Serial2, etc. Option
#define SERIAL_DEBUG_BAUD 230400 // 230400, n. Where n=9600,19200,57600,115200,230400,460800 (common baud rates.) Option
// NON-VOLATILE STORAGE ------------------------------------------------------------------------------------------------------------
#define NV_WIPE OFF // OFF, Causes the defaults to be written back into NV (FLASH,EEPROM,etc.) Infreq
// *** IMPORTANT: ENABLE THIS OPTION THEN UPLOAD, WAIT A MINUTE ***
// Warning ---> // *** OR TWO THEN SET THIS OPTION TO OFF AND UPLOAD AGAIN. ***
// *** LEAVING THIS OPTION ENABLED CAN CAUSE EXCESSIVE NV ***
// *** WEAR AND DAMAGE THE MICROCONTROLLER NV SUBSYSTEM !!! ***
// Additional settings ------------------------------------------------------------------------------------------------------------
#define AP_SSID "KEENONE_MGT001" // Wifi Access Point SSID
#define AP_PASSWORD "12345678" // Wifi Access Point password
#define AP_IP_ADDR {192,168,30,256} // Wifi Access Point IP Address
#define AP_GW_ADDR {192,168,30,256} // Wifi Access Point GATEWAY Address
Extended.config.hファイルは、ちょっと前に比べるとシンプルになりました。基本変更する部分はなく、必要なものを追記していきます。何も追記しなくても問題なく動作します。
- 38行目 SSIDをホスト名と別にしたい場合追記します。ホスト名に設定した名前のままでよければ不要。
- 39行目 最初から特定のパスワードを設定したい場合追記します。後ほどWEBサーバに接続してブラウザでも変更可能です。
- 40-41行目 初期設定のアクセスポイントのIPアドレスは、192.168.0.1になりますが、違うIPを設定したければ追記します。今回は適当にIPアドレスを192.168.30.256にしました。ローカルネットワークではIPアドレスは自由に設定出来ます。IPアドレスの設定ルールについてはご自身で調べてください。
#define SERIAL_BT_MODE SLAVE // use SLAVE to enable the interface (ESP32 only)
#define SERIAL_BT_NAME HOST_NAME // Bluetooth name of command channel
#define SERIAL_BT_PASSKEY "1234" // Bluetooth four digit passkey
Bluetoothを利用する場合は、上記を追記します。WIFIとの併用はできません。接続先を別の名前にする場合は、HOST_NAMEを “My Bluetooth”のように変更します。
今回はこの辺で。次回は、WEBSERVERの日本語化について書こうと思います。
コメント