Giter VIP home page Giter VIP logo

itokawa's People

Contributors

dependabot[bot] avatar elpollouk avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

itokawa's Issues

Add support for other elink versions

thanks for sharing your code,
I have tried running this on an elink R8311 but receive the following errors:

2020-04-25T04:13:59.437Z:ERROR:Application: CommandStationError: Unsupported eLink version encountered, version=105
at ELinkCommandStation.
(/home/pi/Itokawa/Itokawa/dist/devices/commandStations/elink.js:347:23)

and also this error keeps scrolling through, is this a pi configuration issue?

2020-04-25T04:14:10.896Z:ERROR:Application: Command station error
2020-04-25T04:14:10.898Z:ERROR:Application: Error: Error Resource temporarily unavailable Cannot lock port

Add command station setting to config file

As a developer, I want to be able to specify persistent test command station settings so that I don't have to keep specifying command line args.

This will require updating application._openDevice() to check the config for command station settings.

Unrecognised INFO response

CommandStationError: Unrecognised INFO_RESPONSE, got 62 22 c1 81
    at ELinkCommandStation.<anonymous> (/mnt/data/projects/Itokawa/dist/devices/commandStations/elink.js:233:23)
    at Generator.next (<anonymous>)
    at fulfilled (/mnt/data/projects/Itokawa/dist/devices/commandStations/elink.js:5:58)

Add backup/restore functionality

As a Raspberry Pi user, I would like to be able to back up my loco and config data so that I don't lose everything if I suffer an SD card file system error.

This will also need a corresponding restore feature.

Files that need backing up:
~/.itokawa/data.sqlite3
~/.itokawa/config.xml - If present

Process should zip these files and present them as a download.

UI to create Itokawa scripts

As a server admin, I want to be able to create scripts for interesting action sequences.

These scripts will need to included in back up zips created by Itokawa.

CLI exit fails if eLink unplugged

  1. Start CLI with eLink plugged in
  2. Unplug eLink
  3. Execute exit command

Following callstack reported:

dcc> exit
Error: Port is not open
    at SerialPort.close (C:\Projects\Itokawa\node_modules\@serialport\stream\lib\index.js:426:29)
    at C:\Projects\Itokawa\dist\devices\asyncSerialPort.js:87:24
    at new Promise (<anonymous>)
    at AsyncSerialPort.close (C:\Projects\Itokawa\dist\devices\asyncSerialPort.js:86:16)
    at ELinkCommandStation.<anonymous> (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:103:30)
    at Generator.next (<anonymous>)
    at C:\Projects\Itokawa\dist\devices\commandStations\elink.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:4:12)
    at ELinkCommandStation.close (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:99:16)
dcc> exit
TypeError: Cannot read property 'close' of null
    at C:\Projects\Itokawa\dist\devices\asyncSerialPort.js:87:24
    at new Promise (<anonymous>)
    at AsyncSerialPort.close (C:\Projects\Itokawa\dist\devices\asyncSerialPort.js:86:16)
    at ELinkCommandStation.<anonymous> (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:103:30)
    at Generator.next (<anonymous>)
    at C:\Projects\Itokawa\dist\devices\commandStations\elink.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:4:12)
    at ELinkCommandStation.close (C:\Projects\Itokawa\dist\devices\commandStations\elink.js:99:16)
    at C:\Projects\Itokawa\dist\cli\main.js:53:31
dcc>

Exit command doesn't work

Add Command Line Tool For Setting Admin Password

As a layout owner, I want to be able to set an admin password to protect sensitive operations.

This is a stop gap measure to set an admin password in config.xml until it's client UI is implemented. The password should be bcrypt or script hashed in the XML. The tool should directly read the password from stdin without echoing it back to stdout while being entered.

Move restart after update request to a prompt in the GUI

As a Itokawa server maintainer, I want to be asked if I want to restart the server after an update so that I can update both the application and OS in one go.

With the new life cycle lock, it's now safe to perform a restart at any time. This can be triggered by a request from the client UI, simplifying the server updater logic further.

Add support for multiple branches for updates

As a developer, I want to be able to push out updates for testing without impacting stable branch users.

This will require creating specific branches for version point releases, latest stable and latest test.

Add Admin Password

As a layout owner, I want to prevent guest users from modifying the train roster or shutting down the server.

Things to restrict to admin users only:

  • Adding, removing, modifying locos on server
  • Access to the loco roster in client
  • Access to server update, shutdown, restart on server
  • Access to server menu in client

Admin mode should be locked behind a password and once a session has been granted an admin token, it should be valid for both web socket and REST API requests. Admin restricted items should be hidden in the client UI if the user has not enabled admin mode. Admin tokens should persist between Itokawa reboots but have a maximum life time (TBD).

Add periodic vacuuming of the database

As a space conscious user, I'd want the Sqlite database periodically vacuumed.

This can just be a boot counter stored as a KV setting in the DB and then running the vacuum command every N(20?) boots after loading the DB.

Serial port is not closed if there is an error during initialisation

Looking at the initial error in issue #20, the error Error Resource temporarily unavailable Cannot lock port is reported in a loop. This is probably caused by the serial port not being closed when the initial handshake error is raised.

Adding automatic device closing after an error in application.ts should make this more robust across all future command station implementations.

Application life cycle locking

As an Itokawa dev, I want a way to prevent user triggered shutdowns and restarts while a sensitive operation is in progress to prevent accidental corruption of local data.

This could be implemented as a simple semaphore style counter on the application object.

  • When a sensitive operation starts, it requests to increment the counter.
  • When the operation completes or fails, decrement the counter.
  • If a life cycle change request is made and the counter is non-zero, reject it.
  • If a life cycle change request is in progress, reject any requests to increment the counter.

Improve update flow

As a normal user, I don't want to install and build everything when there are no new changes to pull.

Add quick restore via file system

As an Itokawa maintainer, I want to be able to restore a backup by dropping a zip file onto the exposed file share.

At boot, Itokawa should check for the presence of restore.zip in the data directory. If present, it should extract config.xml and data.sqlite3 and then rename the zip file to _restore.zip.

adm-zip looks like the best option for this.

Add support for manually specifying CV range to read

As a Loco Tweaker, I want to be able to specify smaller ranges to read so that I don't have to wait for the full set of CVs to be read.

This is most useful for working with decoders like the ESU LokSound 5 that has the ability to auto configure CVs related to back EMF control.

Added search column to repository tables

As a developer, I want to prepare the database for searching so that I don't have to perform the needed schema update in the future.

Add an indexed text field that contains a concatenation of the locomotive address and name. In the future, if we need to search for a loco, we can use this field without having to unpack the JSON.

Add tests to cover remaining code is application.ts

As an Itokawa developer, I want as close to 100% test coverage as possible.

With #85 and #86 completed, the remaining code in application.ts should be fairly straightforward to test as it's mostly initialisation code and property getters.

Add loco speed controls to loco panel

As a loco driver, I want to be able to control speed, direction and functions from the loco panel.

I also want to add a speed display and single step speed adjustments to make matching loco speeds easier.

Add RESTCommandStation

As a developer, I'd like to be able to connect the CLI to an running Itokawa server so that I can manually issue commands for testing.

This could also be used for running simple scripts without a web browser.

Add OS update option to client GUI

As an Itokawa server maintainer, I want to be able to update the OS without needing to SSH into the server.

This needs a new life cycle command which should run:
sudo apt-get update && sudo apt-get -y dist-upgrade && sudo apt-get autoremove.

Add customisable locomotive views

As a train driver, I want to be able to filter the full locomotive list down to only usable locomotives.

Views should be:

  • Created by an admin.
  • Persisted to the database.
  • Selectable by a guest user.

Add support for cancelling long running commands

As a CV Reader, I don't want to have to wait until all the CVs are read if I accidentally start reading the full list.

This will require proper command status tracking on the server side so that the client can issue an out of band request to cancel another command it has started.

Add about screen to System Drawer

As a web interface user, I want to know the following details:

  • Server version
  • Server code hash (with link to commit)
  • Command station type and version
  • Number of currently connected clients

Add auto run-in feature

As a new locomotive purchaser, I want a convenient way to run-in my new loco.

This can be a simple procedure launched from the loco setup screen that will run the loco forward for X minutes and then backwards for X minutes.

A progress/time remaining bar would also be helpful for keeping track of how far through the run-in we are.

Add verbose log level

The eLink heartbeat messages are to bit too frequent to be useful. Adding a verbose log level between info and debug should make logging a bit more manageable.

Move application life cycle methods into their own class

As an Itokawa developer, I want a single class to encapsulate the life cycle API so that it's easier to cover with tests.

Creating a dedicated life cycle class will allow for testing as it would be independent of the non-automated Application singleton.

UI to run Itokawa scripts

As a train driver, I want to be able to run scripts created by the server admin.

To run the scripts, the CLI script executor will need to be made available to the server. Script commands will need to be organised into guest and admin commands to that the users privileges can be checked when running them.

Broadcast Speed Changes

As a train driver, I want see if someone else has adjusted the control of my train so that I can take corrective action if necessary.

This will require the server to broadcast speed changes over all the WebSocket connections and a request to query current speeds.

Create Config Screen

As an admin, I want an easy way to configure the server port and enable/disable ngrok publishing

Move emergency stop to system draw

As a loco driver, I want to be able to issue an emergency stop from any screen.

This change would also address the issue of the emergency stop button being pushed off the bottom of the main screen when there are a large number of locos available.

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.