Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2014
    Posts
    1

    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.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    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 client
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •