I struggled for some time with this exact same problem. I believe that I've solved it, though I have to be honest, I don't understand exactly why it works. The key was turning off debugging in Flask. I got a hint at doing it by the comments on this page Video Streaming with Flask
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8000, debug=False)
exec() is potentially insecure, because it can execute any command on your system that the PHP process has permission to run. The key to using it securely is to ensure that the command you send to exec() never contains direct user input.
Your example code is insecure because $command depends on unfiltered user input from $_POST via $r. Although $r is only ...
to your second question:
yes, Flask would be a very good framework for this kind of thing, because you could set it up very simply, something like like this:
import RPI.GPIO as gpio
#put your setup here
from flask import Flask, render_template, request
return render_template('alarmClock.html', **templateData)
to hide all output while booting you can boot "silent". this means all output will be redirected to tty3.
edit /boot/cmdline.txt !! every thing need to be in one line!!
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty3 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet vt.global_cursor_default=0 logo.nologo ...
I suspect the issue here is that the script was being run in a directory where another socket.py file existed. When importing modules, Python by default looks in the current directory first. Only if the module is not found there does Python move on to search other directories (like /usr/lib/python2.7, etc). The module search path can be inspected as follows:
Typically adding a web application to a server will make it considerably less safe.
There are two main reasons for this. One is just that a web application itself has a much broader attack surface than an SSH server. A web application must process relatively (as compared to SSH) complex unauthenticated requests (to handle, say, login to the site) and there'...
What you run on your website is irrelevant, so long as you have a safe login functionality and clients can receive messages.
Make the PIs login (python, perl libwww, even just curl if you're frisky) at intervals, and retrieve instructions to act on.
Limit these actions with a whitelist on the PI, since much will require root. You can use textfiles/fifos ...
About point 1:
You will need a RTC if your Rasperry can't rely on an internet connection to get synchronized.
I suppose you want your alarm-clock to be "disconnection-proof", unless you want to explain your boss you are late because of an ISP failure conjugated with your DIY-addiction :)
So yes, an alarm clock definitively needs some hardware RTC, some ...
Flask is one of the many Python web frameworks you could use. Arguably, it would be better to pick a more "mainstream" framework like Django or web2py, since you'll be learning about technologies you'll likely encounter later on in other projects or at work.
To implement the alarm function itself you'll need to have a function which executes periodically ...
What you would need to do is utilise a socket. A socket allows a server and client to communicate directly with an ongoing connection.
The advantage of this is fairly high. Let's say you want a user interface on the Raspberry Pi, you'll find most interfaces are fairly lacking. Except on of course: HTML. This pretty much sounds like what you want. You have a ...
An Access Point is NOT a router. See Using the Raspberry Pi as an access point to share an internet connection (bridge) in Access Point
Adding an Access Point to an existing network just adds complication, and a normal network does not need one. If you do implement an Access Point DO NOT implement a DHCP server - use the server on your router - thus all ...
Only you really understand what you mean by "but I would like to build a cohesive GUI in a single webpage."
My pigpio will let you control the GPIO of multiple Pis from a single location.
The pigpio daemon must be running on each Pi.
I think making a web page would be the best option for what you're trying to do. I think the main problem with this is how are your users going to know the IP address of the pi? Doing this with your router is easy because you know its IP.
Disregarding that issue (maybe you've figured that out) I would just run an Apache web server on the pi with one page ...
They don't necessarily need to talk directly to each other. A Polling program could periodically ping each device and update a database with the status of each device, and a server-side program written in something like node.js or Python could query the database and build the web pages. They don't even have to be on the same server.
I'd suggest looking in ...
Run Wheezy (No, Really)
I cannot run Wheezy as it will not run on the Pi 3 due to kernel support for ARMv8
According to this answer, you can run Wheezy on the RPi3. You just need to update Wheezy on a different, older Pi before putting the SDcard into the RPi3.
Not sure if it's the best solution though...
a USB to Serial converter
As far as I am aware, like many basic USB peripherals, those are reasonably standardized, and a stock linux kernel should have drivers available.
but I am not sure with RPi. because USB (of the serial converter) would functional on the Pi (if I connect serial converter USB to Pi USB plugin)
It probably will. Plug it in and ...
Yes, there is no requirement that you set up a bridge or router with your wifi hotspot configuration, but this is a common thing so often included in examples. Simply skip the bridging portion of any guide or tutorial you are following
Creating a Wifi hotspot with internet access requires bridging to another interface with internet access e.g. wired ...
You can do it all in one PHP page. I personally would not I would have the processing done in a separate PHP file, but this will get you started
$selected = $_POST['songlist'];
echo "<form method='post' name='songlist'>";
Yes, you can run a browser on your RPI and show the dynamic content on your display.
There are a few commercial packages and some signage open source. The TV will have enough USB power to feed the Raspberry.
Here is a list of open source and commercial signage for the Raspberry family.
Does your file.py start with a correct shebang line? (i.e. #!/usr/bin/python)? That's how the system decides which interpreter to use when you're trying to execute the script.
In any case, you can just specify the interpreter in the system command itself:
system ("python ./file.py");
CoovaChilli on its own doesn't have enough user management capabilities to track utilisation properly. Whatever "state" you set for a particular session would get lost once that session terminates (disconnect, device reboot, etc.)
You may find more flexibility in doing user/bandwidth/capacity management using RADIUSdesk (which also has a JSON API), then ...
First, it you have error message like Could not get status from wpa_supplicant this obviously means that there's a problem with wpa_supplicant. Make sure you have it installed withdpkg -s wpasupplicant. If not, install it with sudo aptitude install wpasupplicant
If this fails to fix the problem, read on.
I suppose that you are trying to connect to a WPA/...
I agree with joan.
The tutorial How do I set up networking/WiFi/Static IP describes the contents and locations of configuration files (assuming you are using a recent Raspbian - which you haven't specified).
There is ABSOLUTELY NO REASON to fiddle with /etc/network/interfaces.
If you have done any other damage you may have to start from scratch.
Short answer, I'd say, is no. If you're using ratchet (or similar), the js will have no knowledge of where the WS server is being hosted from. What you will find though, is that without specifically allowing another domain, you'll need to have the web socket client connecting to the same domain that the HTML is being served from.
Not sure if you've solved ...
You just need a basic webpage with a button for each site.
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *...
I suggest using a web browser in kiosk mode.
The aptly named Minimal Kiosk Browser ("kweb" and "kweb3") is highly customizable , so don't forget to read the manual !
It is explicitly designed for "embedded" applications ,
so i guess it fits nicely.
Remove keyboard and mouse or check the manual whether an option to disable
input exists (wouldn't ...
Rpi Cam Web Interface cannot do that. UV4L can do what you want. Not only it can live stream the native or an USB camera to any browser via WebRTC thanks to the Rpi camera or UVC drivers, but can also create a virtual device from an external source like IP camera thanks to the MJPEGStream driver. You can also have both streaming at the same time as the ...