lzrtag / LZRTag

AVR-Based easily modifyable DIY Lasertag!
GNU General Public License v3.0
94 stars 11 forks source link

Conceptualize MQTT<->ESP<->AVR Communication #5

Closed Xasin closed 7 years ago

Xasin commented 7 years ago

Since the ESP will be acting as a bridge between these different software levels, it is now important to come up with a fitting and "smooth" concept to handle data.

We could either:

Personally, I would go for the last option. It would give us the most processing power for that stuff (with floats, 32-bit processing power and more RAM), and since the communication between AVR and ESP will be so close and error-free, it would be easy to have the ESP "master" the AVR.

We also have to think about how to implement things like special effects, how damage is received, and especially: Shot Arbitration

I know it's a lot, but it would be nice to come up with a simple and hackable system that allows for easy expansion of everything :3

Xasin commented 7 years ago

After performing a short test on different pings, I've got pretty promising results!

Here's a graph depicting the Round-Trip ping time, measured by sending a Timestamp to the MQTT Network and recording its arrival time. The ESP was connected over my mobile-phone ((which had its mobile hotspot open), which connected via the internet to my local MQTT server.

pinggraph

As you can see, most pings are in the 250ms region, with only a few of them exceeding a second. This isn't perfect, but sufficient for most cases, as the lasertag-weapons will be capable of running fairly stand-alone.

A direct WiFi connect was, understandably, hard to beat. I got a constant ~20ms Round-Trip time for the ping. HOWEVER, at the same time the signal reach is very limited and would require us to set up a fairly large outdoor WiFi net to achieve similar coverage.

My vote is to use our phone's mobile hotspots. It's a bit slower but covers any area with normal broadband internet access.