diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c5ba54f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# go-scsupdate Changelog + +## v0.1 + +Initial release \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d0b635e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Torsten Harenberg (DL1THM) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index d720006..50c3fca 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,45 @@ # go-scsupdate +A tool to update the firmware of SCS PACTOR modems. Should run on most OSes. + +Author: Torsten Harenberg, DL1THM. + + +Usage: + +``` +usage: go-scsupdate [-h|--help] [-s|--serialDevice ""] [-b|--baudrate +] -f|--file "" [-d|--debug] [-n|--dryrun] +[--force] [-t|--timeout ] + + Update Firmware of SCS PACTOR modems + +Arguments: + +-h --help Print help information +-s --serialDevice (optional) serial device the modem is attached to, e.g. +/dev/ttyUSB0. If not set, go-scsupdate will search for +SCS modems. +-b --baudrate (optional, required when -s is set) sets the serial +baudrate, e.g. 115200 +-f --file (required) the file to flash, e.g. profi41r.pro +-d --debug (optional) enable debug logs +-n --dryrun (optional) drying: if set, modem will detected but no +firmware being written +--force (optional) skip testing if firmware fits modem. Useful if +the modem is bricked and you need to put it into BIOS +mode. Read the manual! +-t --timeout (optional) Sets the read and write timeout. Default: 70. +If you have handshake problems, enlarge this values, +especially for older modems.` +``` + +All options but -f, --file are optional. This requires that your OS is connected to the PACTOR modem through USB or Bluetooth (USB highly recommended!). + +If more than one, or if none, modem can be automatically detected, you can still select the device manually. + +If your modem does not boot properly, the BIOS mode could help. See the handbook for details (you need to set a jumper on the PCB). Use the --force flag in this case, as the code cannot check which modem is attached. + +This whole project is derived from the C-based "scsupdate" by SCS, Hanau, Germany. + +A big thanks to the folks at SCS for their help and support making this possible. \ No newline at end of file diff --git a/main.go b/main.go index 62552fe..51fbeba 100644 --- a/main.go +++ b/main.go @@ -16,14 +16,14 @@ import ( ) func main() { - parser := argparse.NewParser("go-scsupdate", "Update Firmware of SCS PACTOR modems") + parser := argparse.NewParser("go-scsupdate", "Updates Firmware of SCS PACTOR modems") serialDevice := parser.String("s", "serialDevice", &argparse.Options{Required: false, Help: "(optional) serial device the modem is attached to, e.g. /dev/ttyUSB0. If not set, go-scsupdate will search for SCS modems."}) brate := parser.Int("b", "baudrate", &argparse.Options{Required: false, Help: "(optional, required when -s is set) sets the serial baudrate, e.g. 115200"}) f := parser.String("f", "file", &argparse.Options{Required: true, Help: "(required) the file to flash, e.g. profi41r.pro"}) debug := parser.Flag("d", "debug", &argparse.Options{Required: false, Help: "(optional) enable debug logs"}) dryrun := parser.Flag("n", "dryrun", &argparse.Options{Required: false, Help: "(optional) drying: if set, modem will detected but no firmware being written"}) - force := parser.Flag("", "force", &argparse.Options{Required: false, Help: "(optional) skip testing if firmware fits modem. Useful if the modem is bricked and you need to put it into BIOS mode. Read the manual!"}) + force := parser.Flag("", "force", &argparse.Options{Required: false, Help: "(optional) skip testing if firmware fits the modem. Useful if the modem is bricked and you need to put it into BIOS mode. Read the manual!"}) sertimeout := parser.Int("t", "timeout", &argparse.Options{Required: false, Help: "(optional) Sets the read and write timeout. Default: 70. If you have handshake problems, enlarge this values, especially for older modems."}) err := parser.Parse(os.Args) cLog := console.New(true)