Giter Site home page Giter Site logo

ousmartinfrastructure / flir_stream_over_websocket_http_server Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 1.0 5.38 MB

FLiR_Stream_Over_Websocket_HTTP_Server

License: GNU General Public License v3.0

HTML 22.59% Python 77.41%
websocket-server websocket websockets html5 thermal-imaging http http-server socket python streaming

flir_stream_over_websocket_http_server's Introduction

FLiR_Stream_Over_Websocket_HTTP_Server

This project is an enhanced version of the websocket_http_server that I wrote, which is designed to be used specifically with the FLiR Lepton Camera to stream data to a browser over a websocket connection after being served index.html through http, in which index.html launches a small javascript program to hook into the websocket server to collect image data.

alt+text

Please setup the FLiR camera to the microcontroller properly. For a Raspberry Pi 3, it will look like:

Websocket_HTTP_Server is a collection of files that will easily display a set of data being gathered over a web browser, the collection was originally built to display thermal images over http/tcp port 80 in a real-time fashion. When connecting to the http server, the server delivers index.html to the client that will launch a javascript program on load. This program connects to the websocket server, where the websocket server will stream to all the clients.

By running websocket_http_server.py, the python program will startup an http server and a websocket server which will pull configuration settings from server.conf which also has a file path to the image that will be constantly sent in a loop. The program will encode thermal.jpg into a base64 format and sent it over the websocket connection.

Click here for more information about the websocket_http_server.py

In order to get this to work, you will need to import these packages:

alt+text

Furthermore, I added FLiR Lepton cammera support to the websocket_http_server.py, in which the program will save the file as a jpeg in the form of a matplot heatmap.

alt+text

server.conf is the configuration file that websocket_http_server.py will use in order to determine that port and interface numbers that the servers will broadcast on, as well as the image data that will be sent over the websocket connection.

alt+text

index.html is server by the http server, which onload will hook into the websocket server. index.html will collect the data that is being streamed from the websocket server and display it as an image by decoding the image and placing it on the web browser. index.html handles the formating of the image in terms of the dimensions that it will be displayed as.

alt+text

Now we would like to start the program on boot. To do this we are going to make a service in systemd.

First, sudo cp websocket_http.service /etc/systemd/system/websocket_http.service

Second, sudo systemctl daemon-reload

Third, sudo systemctl enable websocket_http.service

Lastly, sudo systemctl start websocket_http.service --no-block

To check to make sure everything is working properly, we can sudo systemctl status websocket_http.service, which should look like this:

alt+text

flir_stream_over_websocket_http_server's People

Contributors

cj667113 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tushar-31093

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.