nilbus / pinewood-derby

Pinewood derby status board & sensor driver
Other
17 stars 9 forks source link

Combine the mock-sensor into the daemon via command line option #26

Open nilbus opened 10 years ago

nilbus commented 10 years ago

When starting the daemon with something like:

rake daemon:sensor_watch MOCK=NewboldDt8000

Start the daemon in a thread, and run the mock-sensor in the foreground. Automatically set $TRACK_SENSOR_DEVICE so the user doesn't have to.

nilbus commented 10 years ago

Also consider instead combining the daemon into the main app server process as a thread. This may cause performance to suffer because of the GIL and the polling the daemon does so frequently, but maybe not in practice. This wouldn't be a problem if we switch the daemon to an evented model and use EventMachine.

nilbus commented 9 years ago

I recently noticed the serial params error reported by @st-atila in #45 happening on Linux with the mock sensor after the 1st run. It seems that on Linux, the kernel doesn't like us to set the serial parameters more than once.

A workaround is to restart the bin/mock-sensor program before each rails server restart.

I am replying under this issue instead, because this issue will no longer occur once the mock-sensor is built into the rails server.