How do I make the wifi-password unreachable on raspberry pi? - raspberry-pi

I'm using Raspberry Pis for a department store. Because of the new GDPR I have to make the Raspberry Pis completely safe. So if someone potentially steals one of them, he absolutely can't access to anything. The Raspberries themselves play videos from a server, so they need to be connected to the wifi. Does anyone have an idea how I can protect the password of the wifi or maybe just delete the... "login-protocol" or something like that? Or do I need to use a second network?
Thanks and Greetings,
Elias

You can use wpa_passphrase to obscure the WiFi password, which would throw up a big (but not absolute*) obstacle to someone who grabbed the Pi, pulled out the SD card, and rummaged through it for sekret stuff.
A safer move might be to treat the Pi as an inherently insecure device. Put an access point on a network segment that only has access to the videos you want to show, and give the Pi those credentials. If someone nabs the Pi and tears the SD card apart, all they'll find are credentials that let them attach to the store WiFi and watch the same videos.
* A determined attacker can run a 'dictionary attack' to try to generate the psk formed from the SSID and the pass phrase. Time consuming and slow to succeed if you have a long, strong WiFi password, but if your requirements are to be "completely safe", and you're liable to get in to long arguments with auditors, wpa_passphrase might not be worth the hassle.

Related

How does real time communication over the internet work?

I'm researching and trying to building a RC car that can be controlled by the internet. I've started looking into how communication over the web works, but I seem to be going nowhere. My goal for the project is straight forward:
The RC car has an on-board camera and 4g wifi router that enables communication (driving commands, video streaming) over the internet. A Raspberry Pi will serve as the on-board computer.
I will be able to control the car with my PC even across the globe, as long as I'm connected.
I want to preferably do as much by myself as possible without relying too much on other people's code.
So here are my questions:
How does an application communicate over the internet? What is the interface between the application's logic (e.g pressing "w" to go forward), and transmitting/receiving that command over the internet?
How is video data stream handled?
I've looked into WebRTC and WebSockets for communication, but they are aimed at providing real time communication to web browsers and mobile, not something like a raspberry pi, and I'm still in the blind as for exactly what technology should I use, and in general the overview and architecture of real time communication.
All I've achieved so far was an app that sends text messages between devices through a server on my network, with very primitive reading/writing using java Socket.
In short, what does messenger/skype/zoom do in the background when you send a message or video call?
Any guidance would be greatly appreciated.
First things first. You cannot do real-time control over Internet, period. There is absolutely no way to guarantee the delivery latency. Your control commands can arrive with a delay from milliseconds to seconds, or never. No way around it.
Now, you can still do a number of reasonable steps to absorb that unpredictable latency as much as possible and safe-guard your remote robot from the consequences of the unreliable communication.
For example, instead of sending the drive commands directly - as in, acceleration, deceleration, turn angle, etc., you can send a projected trajectory that is calculated from your drive commands locally on a model. Your RC car must be sufficiently smart to do some form of localisation - at the very least, wheel odometry, and with a good enough time sync between the sender and the RC car you'll be able to control the behaviour remotely without nasty consequences of drive commands executed at an unpredictable delay.
You can add a heart-beat to your protocol, to monitor the quality of the communication line, and if hear-beat is delayed or missing, initiate emergency stop.
Also, don't bother with TCP, use UDP only and maintain your own sequence counter to monitor missing packets. Same applies to the telemetry stream, not just command channel.

How do I create a Near Edge computing system? (Send sensor data with Raspberry Pi/DHT11 sensor)

I am working on edge computing for IoT applications and expected to create a system that acts as a near edge computer with the use of a raspberry pi hooked up to a dht11 sensor. How do I send this data over to a computer that is at the edge? Ideally I want to use my PC as this device but I have no clue how to send this data over in real time.
So far I have created the circuit and can view the temperature and humidity readings on the raspberry pi in python. Unsure of what the next steps are - I don't want to send this data over to the cloud just yet.
Side note: I believe i may be missing knowledge regarding this but is the raspberry pi an edge device because it is hooked up to the sensor directly?
Any help is greatly appreciated.
You need to think this through a bit more. What will you do with the temperature and humidity data that you receive?
For example, if you're just experimenting and want to just see the readings in a console on your PC, you can use netcat to send the console output of your Python program from the RPi to PC. No SW development needed, they just have to be in the same network. Not particularly useful for anything else, either.
Otherwise you need to set up some client-server solution between the RPi and your PC. There's a ton of possible solutions, all depending on what you plan to do with the data. You can use MQTT, HTTP, a straight database connection (MySQL, PostgreSQL), etc. You have to supply both sides of the connection. The Python code on client side which connects and sends data; and the server side thing that accepts the samples and stores them somewhere. Plus all the networking, authentication etc.
Or you can just download the Python client libraries for your favourite cloud solution and set that up according to a tutorial. TBH, this sounds a lot less work to me.

MotionEyeOS without internet

I am trying to build a small system which include a rPi and rPi Zero. rPi act as local wifi hotspot and rPi zero connect to rPi hotspot.Then I access zero camera through rPi. My diagram looks like this.
It works totally fine if I have a LAN connection. Once I remove the lan connection motionEyeOs won't stream any data. And even it disconnect from wifi and go to boot loop.
So my question, is there any way we can make motionEyeOs works with out actual internet ?.
The answer to your question: You can set link_watch="false" in /data/etc/watch.conf
But this come with a few other problems:
If your camera boots without network connection (internet), it has no time set (your videos and images could get overwritten)
If your camera boots without or looses network connection (internet), the camera does not try to reconnect and you have no other chance and have to connect a keyboard an monitor to it
A hardware clock would help for the first problem but I am still searching for a solution for the second. If you already have one, I would appreciate it, if you could help me out.
https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspivid.md
This is what I use for an offline video recorder and it only needs the software and a power source..Camera also but you get the idea. Keep your image (os) small as possible as this can fill an sd card fast. If I remember right, I used 800 x 600 and it would use a gig an hour.

Extending Wifi/WLAN Range with one NIC on a Laptop

I plan to extend the range of my Wifi with my Notebook. - My question to this, is it possible to build a wireless repeater with only one NIC? or do I really need at least two NICs, one for being logged in and receiving the packets and the other for extending the WiFi/Signal. - Actually, what I wanna do is, using my laptop as a WiFi-Repeater, but only with the built-in NIC, no second one.
I've searched the net already but found nothing about the functionality of a WiFi-Repeater and if they have two NICs integrated.
Hope you guys can enlight me ;)
EDIT(added schemes):
Possibility A
Possibility B
What can be achieved with an AP capable Chip/Firmware, for instance, the Ath9k.
You can't turn laptop's WiFi into range extender, since I believe it requires a special WiFi chip firmware and a special configuration of antenna(s).
However, you might try to look on the internet if WiFi chip you have supports AP mode in firmware (not all manufacturers provides that), and if yes, you can set up the access point with the same SSID. In this case your WiFi clients will roam from one AP to another. Of course, this kind of setup requires Ethernet cable attached to your laptop.

Receiving data in a raspberry pi sent through IEEE.802.11n

I want to send/receive out some data from a raspberry pi using the WLAN protocol IEEE-802.11n. I tried searching a lot but could not find any library in any language which can send/receive data sent through the ieee 802.11n protocol. My receiver is also a raspberry pi.
Basically, the sender is connected to some devices and is supposed to send out some data which is to be sent through the wifi (ieee.802.11n) to another raspberry pi. And to add to my problems how is the data sent from the sender is not known. All I know is that it is sent through the ieee.802.11n protocol.(There is a wifi dongle attached to the senders raspberry pi.)
So if someone could point me to a library or any solution as to how to read that data sent through this protocol.
You need to research this more so that you can ask more specific questions. I doubt any answer is worth an upvote except for the effort put in.
I'll give it a try, and hope this "puts you" in the right direction.
If you manage to setup the RPi-sender as an access point and manage to connect the RPi-receiver to that network, you are well on your way. Since beacons and probe request will start being sent automagically from the sender to the receiver. From there you can start injecting, injecting or in some other way sending packets from sender to receiver. Easiest first step is of course pinging (this can go either way. sender->receiver and vice versa)
If you manage to setup an ad-hoc network, then there is no real "sender" and/or "receiver", but injecting/sending packets work the same way.
Here is a similar question on SO.
Also mentioning libraries