Code Monkey home page Code Monkey logo

hhscstartline's People

Contributors

mbradley612 avatar

Watchers

 avatar  avatar

Forkers

robw-uk

hhscstartline's Issues

App fails to start when lights disabled

If you disable the lights in the ini file then controllers.py crashes at line 819 because comPort isn’t defined. This is because when you check for the lights being enabled at line 773, comPort is only becomes defined if Lights enabled = Y. I got round this by adding a line to the else to set comPort=0 which will cause the any if statements to return a False

PYTHONPATH environment variable doesn't work when startline launched automatically

PYTHONPATH does not contain a valid directory if the script is launched automatically i.e. as part of an xsession file.

2 Changes are requried

  1. PYTHONPATH needs to be exported as an absolute path name
  2. $PYTHONPATH needs to be prefixed to the call to start controllers.py and the location of startline.ini

e.g.

export PYTHONPATH=
python $PYTHONPATH/controllers/controllers.py $PYTHONPATH/../startline.ini

Postponed start

From Matthew West:

if the start is delayed, we should be raising the AP (postponed) flag. The warning signal should be sounded 1 minute after removal. The sequence should therefore be:

-6: gun
-5: gun

and then as a normal start.

We are no longer using the F flag start, so the simple change is to repurpose the F flag start to a "Postponed" start and make the first gun at 6 minutes instead of 10. The label underneath should show "(6,5,4,1,0 minutes)".

Also change the Class flag start label to "(5,4,1,0)"

Apps fails to shutdown when lights disabled

When shutting down at line 739 there is no guard condition to check the lights were enabled before sending the off command to them. This causes the shutdown sequence to fail if running with lights = N

Add delete button for a finish

There is currently no way to delete a finish. A delete button would enable a race officer to keep the finishes nice and neat, for what should be very little work.

sensors config produces false alarms

We are running sensorsd to capture temperature information. But the config isn't very good, and we are getting continuous errors in the logs for a null temperature on a fan. Need to tune the sensors module configuration down so that we are monitoring only the sensors that are available to us.

Reconnect to audio if disconnected

Startine currently only attempts to create a PyAudio connection object on startup. if the audio is not connected at startup, or becomes disconnected after startup, the only way to recover is to restart Startline.

The fix is to:

  1. catch any PyAudio exceptions
  2. track the state of the connection (are we connected or not? if not, try to create a connection object before playing a sound)

USB serial device disconnects from ttyUSB0 then reconnects as ttyUSB1

For example:

Jun 30 22:01:48 startline kernel: [350816.004273] hub 2-0:1.0: port 1 disabled by hub (EMI?), re-enabling...
Jun 30 22:01:48 startline kernel: [350816.004302] usb 2-1: USB disconnect, device number 2
Jun 30 22:01:48 startline kernel: [350816.004628] ftdi_sio ttyUSB0: usb_serial_generic_submit_read_urb - usb_submit_urb failed: -19
Jun 30 22:01:48 startline kernel: [350816.004659] ftdi_sio ttyUSB0: error from flowcontrol urb
Jun 30 22:01:48 startline kernel: [350816.005044] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
Jun 30 22:01:48 startline kernel: [350816.005126] ftdi_sio 2-1:1.0: device disconnected
Jun 30 22:01:48 startline kernel: [350816.244147] usb 2-1: new full-speed USB device number 3 using uhci_hcd
Jun 30 22:01:48 startline kernel: [350816.422411] usb 2-1: New USB device found, idVendor=0403, idProduct=6001
Jun 30 22:01:48 startline kernel: [350816.422423] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jun 30 22:01:48 startline kernel: [350816.422430] usb 2-1: Product: USB <-> Serial
Jun 30 22:01:48 startline kernel: [350816.422436] usb 2-1: Manufacturer: FTDI
Jun 30 22:01:48 startline kernel: [350816.428556] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
Jun 30 22:01:48 startline kernel: [350816.428759] usb 2-1: Detected FT232BM
Jun 30 22:01:48 startline kernel: [350816.428781] usb 2-1: Number of endpoints 2
Jun 30 22:01:48 startline kernel: [350816.428800] usb 2-1: Endpoint 1 MaxPacketSize 64
Jun 30 22:01:48 startline kernel: [350816.428819] usb 2-1: Endpoint 2 MaxPacketSize 64
Jun 30 22:01:48 startline kernel: [350816.428837] usb 2-1: Setting MaxPacketSize 64
Jun 30 22:01:48 startline kernel: [350816.430655] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB1
Jun 30 22:01:49 startline mtp-probe: checking bus 2, device 3: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1"
Jun 30 22:01:49 startline mtp-probe: bus: 2, device: 3 was not an MTP device
Jun 30 22:01:49 startline kernel: [350816.996275] hub 2-0:1.0: port 1 disabled by hub (EMI?), re-enabling...
Jun 30 22:01:49 startline kernel: [350816.996302] usb 2-1: USB disconnect, device number 3
Jun 30 22:01:49 startline kernel: [350816.997107] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1
Jun 30 22:01:49 startline kernel: [350816.997211] ftdi_sio 2-1:1.0: device disconnected
Jun 30 22:01:49 startline kernel: [350817.244101] usb 2-1: new full-speed USB device number 4 using uhci_hcd
Jun 30 22:01:49 startline kernel: [350817.420376] usb 2-1: New USB device found, idVendor=0403, idProduct=6001
Jun 30 22:01:49 startline kernel: [350817.420389] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jun 30 22:01:49 startline kernel: [350817.420396] usb 2-1: Product: USB <-> Serial
Jun 30 22:01:49 startline kernel: [350817.420402] usb 2-1: Manufacturer: FTDI
Jun 30 22:01:49 startline kernel: [350817.425494] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
Jun 30 22:01:49 startline kernel: [350817.425614] usb 2-1: Detected FT232BM
Jun 30 22:01:49 startline kernel: [350817.425625] usb 2-1: Number of endpoints 2
Jun 30 22:01:49 startline kernel: [350817.425634] usb 2-1: Endpoint 1 MaxPacketSize 64
Jun 30 22:01:49 startline kernel: [350817.425643] usb 2-1: Endpoint 2 MaxPacketSize 64
Jun 30 22:01:49 startline kernel: [350817.425652] usb 2-1: Setting MaxPacketSize 64
Jun 30 22:01:49 startline kernel: [350817.427523] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB1
Jun 30 22:01:49 startline mtp-probe: checking bus 2, device 4: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1"
Jun 30 22:01:49 startline mtp-probe: bus: 2, device: 4 was not an MTP device

Recursive connect can fail after multiple hours

e.g.

File "C:\Users\mbradley\git\HHSCStartLine\HHSCStartLine\src\lightsui\hardware.py", line 221, in reconnect
self.connect()
File "C:\Users\mbradley\git\HHSCStartLine\HHSCStartLine\src\lightsui\hardware.py", line 211, in connect
self.reconnect()
File "C:\Users\mbradley\git\HHSCStartLine\HHSCStartLine\src\lightsui\hardware.py", line 221, in reconnect
self.connect()
File "C:\Users\mbradley\git\HHSCStartLine\HHSCStartLine\src\lightsui\hardware.py", line 211, in connect
self.reconnect()
File "C:\Users\mbradley\git\HHSCStartLine\HHSCStartLine\src\lightsui\hardware.py", line 221, in reconnect
self.connect()
File "C:\Users\mbradley\git\HHSCStartLine\HHSCStartLine\src\lightsui\hardware.py", line 210, in connect
self.beReconnecting()
File "C:\Users\mbradley\git\HHSCStartLine\HHSCStartLine\src\lightsui\hardware.py", line 105, in beReconnecting
self.setSessionState(RECONNECTING)
File "C:\Users\mbradley\git\HHSCStartLine\HHSCStartLine\src\lightsui\hardware.py", line 94, in setSessionState
logging.info("Session state is %s" % self.sessionStateDescription())
File "C:\Python27\lib\logging__init
.py", line 1592, in info
root.info(msg, args, *kwargs)
File "C:\Python27\lib\logging__init
.py", line 1132, in info
self.log(INFO, msg, args, **kwargs)
File "C:\Python27\lib\logging__init
.py", line 1250, in log
self.handle(record)
File "C:\Python27\lib\logging__init
.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging__init
.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging__init__.py", line 926, in emit
StreamHandler.emit(self, record)
File "C:\Python27\lib\logging__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 125, in print_exception
print_tb(tb, limit, file)
File "C:\Python27\lib\traceback.py", line 69, in print_tb
line = linecache.getline(filename, lineno, f.f_globals)
File "C:\Python27\lib\linecache.py", line 14, in getline
lines = getlines(filename, module_globals)
RuntimeError: maximum recursion depth exceeded

Add live wind speed

Integrate with weewx for live wind speed, five minute average, five minute gusts

Disable fleet finish buttons if no finishes

We have logic to enable the fleet finish buttons when the first finish is created, but no logic to disable the buttons if all finishes are removed, e.g. on a reset start event.

Change audio from PyAudio to PyGame's audio module

A quick test of Startline on a Raspberry Pi (original model B) revealed that PyAudio with PortAudio on Raspbian results in audio that breaks up - even in simple in the simplest use case as per the "play" example on http://people.csail.mit.edu/hubert/pyaudio/

In contrast, an equivalent sample test of the PyGame pygame.mixer API worked perfectly. PyGame also includes a built in queuing mechanism, so it looks like we can greatly simplify the audio manager in Startline, see http://www.nerdparadise.com/tech/python/pygame/basics/part3/.

As part of this, test the behaviour on Windows and Linux if the line out is disconnected and reconnected.

Fleet list not long enough for all fleets

The list of fleets is to short for all the fleets configured in the ini file.

Fix is to make the frame bigger - also good to have scroll bars.

probably one for implementing when changing the UI.

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.