Chat freely about anything...

User avatar
By candre23
#20619 My goal is to build a cheap lap timing system for RC cars. Each car will have an ESP8266 with a 38khz IR receiver tied to an input pin. A bar suspended above the finish line will support half a dozen IR LEDs pointing down, flashing at 38khz. When a car passes under the bar, the IR receiver pin goes high, and triggers the ESP to send a signal to a nearby PC. Software on the PC will note the time and originating IP address of the signals from each car to keep track of lap counts/times for multiple cars at once.

This would be a pretty straightforward project for an experienced programmer, but as someone who has never done any networked programming, I'm at a loss.

On the ESP end, what's the best way to connect to the PC? Obvioulsy a wireless router would be simplest, but then you have to power it, and most races are outdoors without easy access to power. Can the ESPs be set up in ad-hoc mode to connect back to a laptop directly? Once connected, what's the best way to send the "crossed-the-line" signal?

On the PC end, I'm not sure where to start. I know I need to set up a "server" of some sort to listen for the signals from the ESPs. What language/IDE would be quickest and easiest? The program only needs to have a very basic GUI - just the ability to assign names to ESP addresses and a grid to show lap times. If I could set up that UI quickly with a WYSIWYG editor, that would be preferred.

I realize this is incredibly basic stuff, so if you could even point me in the direction of a good tutorial for programming over a network, I'd really appreciate it.
User avatar
By tytower
#20655 Not simple stuff I fear . from what I've seen I recomend you use Arduino IDE from Arduino.cc as there is a big example library to pull from. You quickly learn whats needed in C++ .
Interesting concept though . The modem only has to be close to the finish (50 meters maybe ) but the chips are going to have to make a quick connect when in range and I'll bet it won't be reliable that way. Otherwise stay connected throughout and that probably suits you .How to separate signals arriving at the same time ?
User avatar
By candre23
#20737 The tracks are not large - at least the one I'm using isn't. With the wifi router placed near the middle, the cars will always be within 100ft of it, so I expect the ESPs to stay connected the whole time.

As the ESPs will always be connected, the router will determine "ties", I guess. If you have two computers on a network pinging a third computer, even if the pings come in at the exact same instant, the router will still send one at a time. The loser will be held in the buffer until the first ping goes through. But they would have to be literally simultaneous for that to even occur. Otherwise, the pings will be sent from the router to the server in the order they were received, even if only one millisecond separated those requests. The requests would be noted by the server with timestamps, presumably down to the millisecond.