I have an Arducam OV2640
There is a lot of documentation on how the code works wth a HTML and js script which calls the camera IP address, after arducam creates a web server.
This web server listens to get requests and sends a post response of the image.
The only problem is this is all over local wifi...source:
https://github.com/ArduCAM/Arduino/tree/master/ArduCAM/examples/ESP8266/ArduCAM_ESP8266_OV2640_Capture
Has anyone done anything such as sending to Imgur via api or for instance a cloud based program like python anywhere?
I've been trying different methods all day, but a lot it comes to people saying "you need to send each byte and the other side have a handler."
I'm asking because the local wifi method works so easily I thought there must be a way to extend this to external addresses in a nicer way?
Has anyone done or heard of anything like this?
Thanks
Related
I’m trying to learn sockjs for a small university project.
I’ve a local server (with typical LAMP configuration), my goal is writing a python script (running on my local server) that is able to send data to client browser in order to update a text information.
Sockjs was seemed to me the best solution (tornado-sockjs for python server).
I read the tutorial examples (https://github.com/mrjoes/sockjs-tornado/tree/master/examples) but I’ve difficult to understand the basic functions.
It would be very useful to understand an example code. An example could be:
A python-server script generates a random number each 5 seconds and send this number to client. In webpage there is a definite element to update this value.
In the same webpage there is a button to send a text message to python server. When python server received this message, print it in the server console.
Thank you in advance for your help.
I hope that this post will be useful to other people.
Does anybody know of an example Python script to receive an image sent via http POST from Postman? I'd like to write a simple Python server script that could receive an image sent like this:
I'm 100% flexible on how the image is sent from Postman, for example I could use "form-data", then specify key/value/file, or use "binary". Either way I'm looking for the Python server script to receive the file and either save it (to the same location as the Python server script, or a different location, does not really matter) or display it, either way to prove out that the server did receive the image.
Unfortunately all the Python server examples I can find send stuff rather than receive. Can anybody provide some assistance?
Here's a good example that uses the built in BaseHTTPServer package for receiving GET/POST requests in python: http://joelinoff.com/blog/?p=1658
I am trying to make a "proxy" in Python that allows the user to route all of their web traffic through a host machine (this is mainly for me and a couple people I know to confuse/avoid hackers and/or spies, who would only see web pages and so on coming in through one IP). I have run into several difficulties. The first is that I would like to be able to use the final, compiled product with Firefox, which can be set to route all of its traffic through an installed proxy program. I don't know what kind of configuration my proxy needs to have to do this. Second, the way the proxy works is by using urllib.requests.urlretrieve (yes, going to die soon, but I like it) to download a webpage onto the host computer (it's inefficient and slow, but it's only going to be used for a max of 7-10 clients) and then sending the file to the client. However, this results in things like missing pictures or broken submission forms. What should I be using to get the webpages right (I want things like SSL and video streaming to work as well as pictures and whatnot).
(wince) this sounds like "security through obscurity", and a lot of unnecessary work.
Just set up an ssh tunnel and proxy your web traffic through that.
See http://www.linuxjournal.com/content/use-ssh-create-http-proxy
I have some code running on my Raspberry Pi (client running Python) that gets my public IP-address every hour. Now I want my IP to send that string to App Engine datastore.
Unfortunatly I do not know how to post data from a client, and all the examples I tried to google seems to handle browser inputs, not posting with Python from a client.
Does anyone know a good tutorial, or have some example code that a novice like me can understand? Maybe some pointers?
You just need to send your data as an HTTP POST. As Tim says in the comments, the third-party requests library is a great way to do this, although you can do it with the built-in urllib2.
From the server point of view, getting data from a POST like this is exactly the same as getting it from a form submission.
I'm looking for a bit of web development advice. I'm fairly new to the area but I'm sure there are some gurus out there willing to part with some wisdom.
Objective: I'm interested in controlling a Python application on my computer from my personal web hosted site. I know, this question has been asked several times before but in each case the requirements were a bit different from my own. To reduce the length of this post I'll summarize my objective in a few bullet points:
Personal site is hosted by a web hosting company
Site uses HTML, PHP, MySQL, Python and JavaScript, the majority of everything is coded by me from the ground up
An application that is coded in Python will run on a PC within my home and will communicate with an Arduino board
The app will receive commands from the internet to control actuation via the Arduino, and will transmit sensor data back to the site (such as temperature)
Looking for the communication to be bi-directional, fast and secure
Securing the connection between site and Python app would be most ideal
I'm not looking to connect to the Python application directly, the web server must serve as the 'middle man'
So far I've considered HTTP Post and HTML forms, using sockets (Python app would run as a web server), an IRC bot and reading/writing to a text file stored on the web server.
I was also hoping to have a way to communicate with the Python app without needing to refresh the webpage, perhaps using AJAX or JavaScipt? Maybe with Flash?
Is there something I'm not considering? I feel like I'm missing something. Thanks in advance for the advice!
Just thinking out loud for how I would start out with this. First, regarding the website itself, you can just use what's easiest to you, or to the environment you're in. For example, a basic PHP page will do just fine, but if you can get a site running in Python as well, I'd prefer using the same language all over.
That said, I'm not sure why you would need to use a hosted website? Given that you're already forced to have a externally accessible PC at home for the communication, why not run a webserver on that directly (Apache, Nginx, or even something like CherryPy should do)? That webserver can then communicate with the python process that is running to control your Arduino (by using e.g. Python's xmlrpclib). If you would run things via the hosting company, you would still need some process that can handle external requests securely... something a webserver is quite good at. Just running it yourself gives you all the freedom you want, and simplifies things by lessening the number of components in your solution.
The updates on your site I'd keep quite basic: commands you want to run can be handled in the request handlers of the webserver by just calling the relevant (xmlrpclib) calls. Dynamically updating the page is best done by some AJAX calls I reckon. Based on your story, these updates are easily put in a JSON object, suitable for periodically updating only the relevant segments of your page.