09-30-14, 13:02 #1Registered User
- Join Date
- Sep 2014
how to store 2 bytes ten times each second on a Raspberry Pi web server (or client)
I have a Tornado web server on a Raspberry Pi that has a Websocket set up between the server and the client. The Websocket passes virtual joystick commands from the client browser to the server and out to an RC car via a radio transceiver attached to the Raspberry Pi. The Raspberry Pi server receives range finder data from the car and passes it through the Websocket to the client browser.
I want to take this range finder data (that comes in as two bytes about ten times each second) and display it graphically in the client web browser. I'm stuck on the storage part of the process, though. I tried to store the data as it comes in to my Python serial process script herehttp://pastebin.com/wdpryYZL, but it dramatically lags the server. I'd imagine this is because I'm trying to write too frequently to the Raspberry Pi's SD card.
How can I store this data and access it right after I store it for client side visualization? I don't necessarily need it stored on the server, I just want to display it for the client. If a database is not the way to go, please let me know.
09-30-14, 15:13 #2Jaded Developer
- Join Date
- Nov 2004
- out on a limb
If you are not worried about where the device was, just the current position then I don't see the point in storing such data inside a db. The problem is the stateless nature of a westerner. You may well be better off writing your own data server that passes the last received data to the clientI'd rather be riding on the Tiger 800 or the Norton